pystencils.grids.staggered_field.Staggering#
- class pystencils.grids.staggered_field.Staggering(*entries)#
A staggered stencil, given by the entries it stores on a cell.
Each member fixes the direction set stored on a cell: the axis faces only, or the faces plus the diagonal edges. The cell centre is never stored.
Edge2D: axis faces only, 2D (D2Q5edges)Corner2D: faces and corners, 2D (D2Q9edges)Face3D: axis faces only, 3D (D3Q7edges)Corner3D: faces, edges and corners, 3D (D3Q27edges)
Only one of each direction/inverse pair is stored; the physical full
DdQqstencil (stencil_entries) is derived on demand.- Edge2D = ((0, 1), (1, 0))#
Axis faces only, 2D (
D2Q5edges).
- Corner2D = ((0, 1), (1, 0), (1, 1), (1, -1))#
Faces and corners, 2D (
D2Q9edges).
- Face3D = ((0, 1, 0), (1, 0, 0), (0, 0, 1))#
Axis faces only, 3D (
D3Q7edges).
- Corner3D = ((0, 1, 0), (1, 0, 0), (0, 0, 1), (1, 1, 0), (1, -1, 0), (0, 1, 1), (1, 0, 1), (0, 1, -1), (1, 0, -1), (1, 1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, -1))#
Faces, edges and corners, 3D (
D3Q27edges).
- property edges: tuple[tuple[int, ...], ...]#
The stored edge directions, never including the centre.
- property staggered_entries: tuple[tuple[int, ...], ...]#
The stored entries, exactly as laid out in the field’s buffer.
- staggered_index(direction)#
Storage index of an entry; a direction’s inverse maps to the same index.
- Return type:
- staggered_direction(index)#
The stored entry with the given index.