volumential.meshgen#
Box mesh generation on top of the boxtree tree-of-boxes interface.
This module owns the mesh generators that produce the quadrature nodes,
weights, cell centers and cell measures a volume FMM run integrates over.
MeshGenBase wraps a volumential.tree_interactive_build.BoxTree
and its quadrature; the dimension-specific subclasses only pin the dimension.
The module also owns the small helpers that turn a generated mesh into boxtree
tree/traversal data.
- volumential.meshgen.provider = 'meshgen_boxtree'#
Name of the mesh generation backend in use.
- class volumential.meshgen.MeshGenBase(degree: int, nlevels: int, a=-1, b=1, queue: CommandQueue | None = None)[source]#
Bases:
objectBase class for Meshgen via BoxTree. The arguments a and b can be scalars or vectors to define dim-dependent bounding boxes.
This base class cannot be used directly since the boxtree is not built in the constructor until dimension_specific_setup() is provided.
This class also implements native CL getters like get_q_points_dev() that play well with boxtree-based workflows.
- n_cells() int[source]#
Note that this value can be larger than the actual number of cells used in the boxtree. It mainly serves as the bound for iterators on cells.
- update_mesh(criteria, top_fraction_of_cells: float, bottom_fraction_of_cells: float) None[source]#
Refine the highest-criteria cells and coarsen the lowest-criteria ones.
- Parameters:
criteria – One refinement indicator per active cell.
top_fraction_of_cells – Fraction of active cells to refine.
bottom_fraction_of_cells – Fraction of active cells to coarsen.
- volumential.meshgen.make_uniform_cubic_grid(degree: int, nlevels: int = 1, dim: int = 2, queue: CommandQueue | None = None, **kwargs) tuple[ndarray, ndarray, None][source]#
Uniform cubic grid in [-1,1]^dim.
- class volumential.meshgen.MeshGen1D(degree: int, nlevels: int, a=-1, b=1, queue: CommandQueue | None = None)[source]#
Bases:
MeshGenBaseMeshgen in 1D
- class volumential.meshgen.MeshGen2D(degree: int, nlevels: int, a=-1, b=1, queue: CommandQueue | None = None)[source]#
Bases:
MeshGenBaseMeshgen in 2D
- dimension_specific_setup()[source]#
Promote scalar bounds to a 2D box, or check that the bounds are 2D.
MeshGenBasereads the dimension off the length of the bounds it was given, so the commona=-1, b=1call arrives here asdim == 1; widening it (and the root vertex with it) is what makes that call mean \([-1, 1]^2\).
- class volumential.meshgen.MeshGen3D(degree: int, nlevels: int, a=-1, b=1, queue: CommandQueue | None = None)[source]#
Bases:
MeshGenBaseMeshgen in 3D
- dimension_specific_setup()[source]#
Promote scalar bounds to a 3D box, or check that the bounds are 3D.
The 3D counterpart of
MeshGen2D.dimension_specific_setup().
- volumential.meshgen.build_geometry_info(ctx, queue, dim: int, q_order: int, mesh, bbox=None, a=None, b=None)[source]#
Build tree, traversal and other geo info for FMM computation, given the box mesh over/encompassing the domain.
The bounding box can be specified in one of two ways: 1. via scalars a, b, dim-homogeneous ([a, b]^dim) 2. via bbox (e.g. np.array([[a1, b1], [a2, b2], [a3, b3]]))