zoomy_core.mesh.column_structure

zoomy_core.mesh.column_structure#

Column structure of extruded meshes (cell index = iz * n_horizontal + i_horizontal) for vertical integrals in sigma coordinates.

Module Contents#

Classes#

ColumnStructure

Column-to-cell mapping and uniform layer weights of an extruded mesh, in sigma coordinate zeta in [0, 1].

API#

class zoomy_core.mesh.column_structure.ColumnStructure(n_horizontal: int, n_layers: int)#

Column-to-cell mapping and uniform layer weights of an extruded mesh, in sigma coordinate zeta in [0, 1].

Initialization

Build the (n_horizontal, n_layers) column-cell table for n_horizontal cells and n_layers layers.

integrate(Q: numpy.ndarray) → numpy.ndarray#

Midpoint-rule vertical integral of Q over zeta in [0, 1].

Args

  • Q: (n_vars, n_3d_cells) field on the extruded mesh.

Returns

(n_vars, n_horizontal) integrals per column.

partial_integrate(Q: numpy.ndarray, from_top: bool = True) → numpy.ndarray#

Running vertical integral per cell, from the surface down (from_top) or from the bottom up.

Args

  • Q: (n_vars, n_3d_cells) field on the extruded mesh.

Returns

(n_vars, n_3d_cells) running integral at each cell.

scatter_to_column(Q_horiz: numpy.ndarray) → numpy.ndarray#

Broadcast (n_vars, n_horizontal) values to every layer, giving (n_vars, n_3d_cells).

gather_layer(Q: numpy.ndarray, iz: int) → numpy.ndarray#

Extract layer iz (0 = bottom) of Q as (n_vars, n_horizontal).