zoomy_core.mesh.mesh_ic#
Initial conditions from mesh-carried gmsh node data: node-to-cell interpolation plus a
field_map from state names to mesh fields, backend-agnostic.
Module Contents#
Functions#
Interpolate a per-vertex field onto cells, by |
|
Build the per-cell initial state from mesh node data, mapping state names to mesh fields via
|
Data#
API#
- zoomy_core.mesh.mesh_ic.FieldSpec#
None
- zoomy_core.mesh.mesh_ic.interpolate_node_data_to_cells(mesh, node_values: numpy.ndarray, method: str = 'nearest', query_points: Optional[numpy.ndarray] = None) numpy.ndarray#
Interpolate a per-vertex field onto cells, by
"nearest"vertex (KD-tree) or"cell_average"of the cell’s vertices.Args
node_values:(n_vertices,)or(n_vertices, k), aligned withmesh.vertex_coordinates.query_points: sample points for"nearest",(n, dim); default the inner cell centres.
Returns
(n_inner_cells,)or(n_inner_cells, k)array.
- zoomy_core.mesh.mesh_ic.initial_conditions_from_mesh(mesh_or_path, field_map: Mapping[str, zoomy_core.mesh.mesh_ic.FieldSpec], state_names: Optional[Sequence[str]] = None, method: str = 'nearest', default: float = 0.0, query_points: Optional[numpy.ndarray] = None) numpy.ndarray#
Build the per-cell initial state from mesh node data, mapping state names to mesh fields via
field_map.Args
mesh_or_path: BaseMesh withnode_dataor a.mshpath.field_map:{state: mesh_field_name}or{state: callable(node_fields) -> node array}, evaluated at nodes then interpolated.state_names: row order of the result (defaultfield_maporder); rows not infield_mapgetdefault.method: node-to-cell interpolation, seeinterpolate_node_data_to_cells.
Returns
(n_state, n_cells)array.