salvus.mesh.algorithms.distributed_mesh.submesh
salvus.mesh.algorithms.distributed_mesh.submesh salvus mesh algorithms distributed_mesh submesh Submesh construction algorithms.
Functions
get_aperture_sfs()
get_aperture_sfs()def get_aperture_sfs(
mesh: DistributedMesh,
element_ids: npt.NDArray,
block_dms: list[tuple[bindings.DMPlex, bindings.DMPlex]] | None = None,
) -> tuple[list[bindings.PetscStarForest], list[bindings.PetscStarForest]]: ...Get per-block section and aperture star forests for a set of elements.
The section SFs map each block’s local nodal DOFs to a global vector. The aperture SFs map the global vector to the closure of the selected elements on each block.
Collective over the communicator associated with the mesh.
meshDistributedMesh — The distributed mesh.element_idsnpt.NDArray — The Salvus global element IDs to open the aperture over.block_dmslist[tuple[bindings.DMPlex, bindings.DMPlex]] | None — Pre-computed block DMPlex objects. If None, will be computed via discretize_blocks. Pass this to avoid recomputing when calling multiple times on the same mesh.
get_aperture_sfs_full()
get_aperture_sfs_full()def get_aperture_sfs_full(
mesh: DistributedMesh,
element_ids: npt.NDArray,
block_dms: list[tuple[bindings.DMPlex, bindings.DMPlex]] | None = None,
) -> tuple[
list[bindings.PetscStarForest],
list[bindings.PetscStarForest],
list[bindings.PetscStarForest],
list[bindings.PetscStarForest],
]: ...Get per-block nodal and elemental section/aperture star forests.
Extends get_aperture_sfs with an additional (sf_sec_p0, sf_ap_p0) pair
built from the order-0 DMPlex, suitable for broadcasting elemental fields.
Collective over the communicator associated with the mesh.
meshDistributedMesh — The distributed mesh.element_idsnpt.NDArray — The Salvus global element IDs to open the aperture over.block_dmslist[tuple[bindings.DMPlex, bindings.DMPlex]] | None — Pre-computed block DMPlex objects. If None, will be computed via discretize_blocks. Pass this to avoid recomputing when calling multiple times on the same mesh.
(sf_sec, sf_ap, sf_sec_p0, sf_ap_p0): - sf_sec, sf_ap: nodal (order-n) section/aperture SFs. - sf_sec_p0, sf_ap_p0: elemental (order-0) section/aperture SFs. Each list has one entry per block.Classes
BlockDms
BlockDmsclass BlockDms(builtins.object):
def __init__(
self,
comm: int,
block_id: int,
dm_n0: bindings.DMPlex,
dm_nn: bindings.DMPlex,
) -> None: ...The DMPlex objects corresponding to a single block in the mesh.
commint — The MPI communicator associated with the DMPlex objects.block_idint — The id of the block.dm_n0bindings.DMPlex — The DMPlex object corresponding to the elemental discretization of the block.dm_nnbindings.DMPlex — The DMPlex object corresponding to the nodal discretization of the block.
get_elemental_vector_size int
get_elemental_vector_size intSize of the elemental vector for this block.
get_nodal_vector_local_size int
get_nodal_vector_local_size intLocal size of the nodal vector for this block.
get_nodal_vector_size int
get_nodal_vector_size intSize of the nodal vector for this block.