Mesh#
- class Mesh(*values)[source]#
Bases:
EnumEnum identifying the stagger position of one array axis.
MAS and POT3D solve their equations on Yee-type staggered spherical grids. Each axis of a multi-dimensional output array is independently classified as
MAIN(cell-center position) orHALF(cell-face/edge position, displaced by half a grid spacing along that axis).The stagger arrangement is physically motivated:
Magnetic field components (\(B_r\), \(B_\theta\), \(B_\varphi\)) are face-centred — each component lives on the face through which it is the outward normal — so that \(\nabla \cdot \mathbf{B} = 0\) is satisfied exactly at the discrete level.
Current density components follow from \(\mathbf{J} = \nabla \times \mathbf{B}\) and are therefore edge-centred (half mesh on the two transverse axes).
Scalar quantities (temperature, density, pressure) occupy the cell corners, which correspond to the half-mesh position on all three axes (
0b111).
Meshmembers appear as elements of the normalized mesh tuple returned bymeshand accepted byremesh_array().- Attributes:
Examples
>>> from psi_io._mesh import Mesh >>> Mesh.MAIN.value 0 >>> Mesh.HALF.value 1 >>> Mesh('half') <Mesh.HALF: 1> >>> Mesh('m') <Mesh.MAIN: 0> >>> str(Mesh.HALF) 'HALF'