zoomy_core.mesh.fvm_mesh module#
FVMMesh — BaseMesh with precomputed geometry for FVM solvers.
Caches cell centers, volumes, inradii, face normals, face volumes, and face centers so they are not recomputed every access.
- class zoomy_core.mesh.fvm_mesh.FVMMesh(**kwargs)#
Bases:
BaseMeshBaseMesh + precomputed cell/face geometry.
- cell_centers_computed()#
Compute cell centers from vertex coordinates. Shape (3, n_cells).
- Return type:
ndarray
- cell_volumes_computed()#
Compute cell volumes. Shape (n_cells,).
- Return type:
ndarray
- cell_inradius_computed()#
Compute cell inradius (min distance from center to face plane).
Uses the same projection-based approach as PETSc’s
computeCellGeometryFVMfor consistency.- Return type:
ndarray
- face_normals_computed()#
Compute face normals. Shape (3, n_faces).
Normal always points from
face_cells[0]towardface_cells[1]. Works for any dimension.- Return type:
ndarray
- face_volumes_computed()#
Compute face areas/lengths. Shape (n_faces,).
For 1D meshes, face ‘volumes’ are 1.0 (point has no area).
- Return type:
ndarray
- face_centers_computed()#
Compute face centers. Shape (n_faces, 3).
- Return type:
ndarray
- property cell_centers#
- property cell_volumes#
- property cell_inradius#
- property face_normals#
- property face_volumes#
- property face_centers#
- classmethod from_base(base)#
Build an FVMMesh by computing geometry from a BaseMesh.
- classmethod from_msh(filepath)#
Load .msh and build FVMMesh with precomputed geometry.
- Parameters:
filepath (str) –
- Return type:
- classmethod from_hdf5(filepath)#
Load BaseMesh from H5 and compute geometry.
- Parameters:
filepath (str) –
- Return type:
- classmethod create_1d(domain, n_inner_cells)#
Build a uniform 1D interval mesh.
- Parameters:
domain (tuple) –
n_inner_cells (int) –
- Return type:
- classmethod create_2d(domain, nx, ny)#
Build a uniform 2D quad mesh.
- Parameters:
domain ((x_min, x_max, y_min, y_max)) –
nx (number of inner cells in x and y directions) –
ny (number of inner cells in x and y directions) –
- Return type:
- classmethod create_3d(domain, nx, ny, nz)#
Build a uniform 3D hexahedral mesh.
- Parameters:
domain ((x_min, x_max, y_min, y_max, z_min, z_max)) –
nx (number of inner cells in each direction) –
ny (number of inner cells in each direction) –
nz (number of inner cells in each direction) –
- Return type:
- name = 'FVMMesh'#