Mondaic

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

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.

Parameters
  • mesh DistributedMesh — The distributed mesh.
  • element_ids npt.NDArray — The Salvus global element IDs to open the aperture over.
  • block_dms list[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.
Returns tuple[list[bindings.PetscStarForest], list[bindings.PetscStarForest]] — A tuple of (sf_sec, sf_ap) where sf_sec is a list of section star forests (one per block) and sf_ap is a list of aperture star forests (one per block).

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.

Parameters
  • mesh DistributedMesh — The distributed mesh.
  • element_ids npt.NDArray — The Salvus global element IDs to open the aperture over.
  • block_dms list[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.
Returns tuple[list[bindings.PetscStarForest], list[bindings.PetscStarForest], list[bindings.PetscStarForest], list[bindings.PetscStarForest]] — A tuple (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

class 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.

Parameters
  • comm int — The MPI communicator associated with the DMPlex objects.
  • block_id int — The id of the block.
  • dm_n0 bindings.DMPlex — The DMPlex object corresponding to the elemental discretization of the block.
  • dm_nn bindings.DMPlex — The DMPlex object corresponding to the nodal discretization of the block.
Attributes
get_elemental_vector_size int

Size of the elemental vector for this block.

get_nodal_vector_local_size int

Local size of the nodal vector for this block.

get_nodal_vector_size int

Size of the nodal vector for this block.