zoomy_core.mesh.lsq_mesh module

zoomy_core.mesh.lsq_mesh module#

LSQMesh — FVMMesh with precomputed least-squares reconstruction stencils.

This is the highest-fidelity mesh class: it caches the LSQ derivative operators so that compute_derivatives is a single matrix–vector product per cell instead of building the stencil on every call.

class zoomy_core.mesh.lsq_mesh.LSQMesh(*, _face_neighbors, _lsq_gradQ, _lsq_monomial_multi_index, _lsq_neighbors, _lsq_scale_factors, _cell_centers, _cell_inradius, _cell_volumes, _face_centers, _face_normals, _face_volumes, boundary_conditions_sorted_names, boundary_conditions_sorted_physical_tags, boundary_face_cells, boundary_face_face_indices, boundary_face_function_numbers, boundary_face_ghosts, boundary_face_physical_tags, cell_faces, cell_neighbors, cell_vertices, dimension, face_cells, n_boundary_faces, n_cells, n_faces, n_faces_per_cell, n_inner_cells, n_vertices, type, vertex_coordinates, z_ordering, name)#

Bases: FVMMesh

FVMMesh + precomputed LSQ derivative operators.

property lsq_gradQ#
property lsq_neighbors#
property lsq_monomial_multi_index#
property lsq_scale_factors#
property face_neighbors#
compute_derivatives(u, degree=1, derivatives_multi_index=None)#

Compute derivatives using precomputed LSQ stencil.

Parameters:
  • u (ndarray) –

  • degree (int) –

Return type:

ndarray

classmethod from_fvm(fvm, lsq_degree=1)#

Build an LSQMesh by computing LSQ operators from an FVMMesh.

Parameters:
  • fvm (FVMMesh) –

  • lsq_degree (int) –

Return type:

LSQMesh

classmethod from_msh(filepath, lsq_degree=1)#

Load .msh and build FVMMesh with precomputed geometry.

Parameters:
  • filepath (str) –

  • lsq_degree (int) –

Return type:

LSQMesh

classmethod from_hdf5(filepath, lsq_degree=1)#

Load BaseMesh from H5 and compute geometry.

Parameters:
  • filepath (str) –

  • lsq_degree (int) –

Return type:

LSQMesh

classmethod create_1d(domain, n_inner_cells, lsq_degree=1)#

Build a uniform 1D interval mesh.

Parameters:
  • domain (tuple) –

  • n_inner_cells (int) –

  • lsq_degree (int) –

Return type:

LSQMesh

classmethod create_2d(domain, nx, ny, lsq_degree=1)#

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) –

  • lsq_degree (int) –

Return type:

LSQMesh

classmethod create_3d(domain, nx, ny, nz, lsq_degree=1)#

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) –

  • lsq_degree (int) –

Return type:

LSQMesh

name = 'LSQMesh'#