magnelio.mesh#

Mesh components. Mesh and MeshControl live in the core magnelio namespace; this component holds the grid container and face identification for custom setups.

class magnelio.mesh.BoxFace(value)#

Identifies one face of the simulation bbox by its outward normal.

The local (u, v) axes per face are chosen so u × v points into the simulation domain (matching the Poynting convention for forward modal waves).

property inward_sign: int#

+1 for MIN faces (inward = +axis); −1 for MAX faces.

property is_max: bool#

True for X_MAX / Y_MAX / Z_MAX faces.

property normal_axis: int#

Global axis index perpendicular to the face (0=x, 1=y, 2=z).

property u_axis: int#

Global axis index for the local-u tangential direction.

property v_axis: int#

Global axis index for the local-v tangential direction.

class magnelio.mesh.GridLines(x, y, z)#

Sorted node positions for a structured non-uniform hexahedral grid.

All coordinates are in meters.

The number of cells in each direction is len(x) - 1, etc.

Parameters:
  • x (np.ndarray) – Sorted array of x node positions, shape (Nx+1,).

  • y (np.ndarray) – Sorted array of y node positions, shape (Ny+1,).

  • z (np.ndarray) – Sorted array of z node positions, shape (Nz+1,).

property Nx: int#

Number of cells in x direction.

property Ny: int#

Number of cells in y direction.

property Nz: int#

Number of cells in z direction.

property courant_dt_max: float#

Maximum stable time step (Courant limit, safety factor = 1.0).

Use stability.courant_dt(grid, accuracy) for production use.

property dx: ndarray#

Cell sizes in x, shape (Nx,).

property dy: ndarray#

Cell sizes in y, shape (Ny,).

property dz: ndarray#

Cell sizes in z, shape (Nz,).

property n_cells: int#

Total number of cells.