Mondaic

salvus.mesh.data_structures.salvus_mesh.side_sets

salvus.mesh.data_structures.salvus_mesh.side_sets salvus mesh data_structures salvus_mesh side_sets

Side set data structures for Salvus meshes.

Functions

legacy_from_side_set()

def legacy_from_side_set(
    side_set: SideSet,
) -> tuple[npt.NDArray, npt.NDArray]: ...

Convert a SideSet data structure to the legacy format.

Parameters
  • side_set SideSet — SideSet to convert.
Returns tuple[npt.NDArray, npt.NDArray] — Tuple of (elements, facets), the legacy format for a single side set.

legacy_from_side_sets()

def legacy_from_side_sets(
    side_sets: tuple[SideSet, ...],
) -> dict[str, tuple[npt.NDArray, npt.NDArray]]: ...

Convert a list of SideSet data structures to the legacy format.

Parameters
  • side_sets tuple[SideSet, ...] — List of SideSet instances to convert.
Returns dict[str, tuple[npt.NDArray, npt.NDArray]] — Dictionary mapping side set names to their legacy data.

side_set_from_legacy()

def side_set_from_legacy(
    legacy_name: str, legacy_data: tuple[npt.NDArray, npt.NDArray]
) -> SideSet: ...

Convert a single legacy side set to the new SideSet data structure.

Parameters
  • legacy_name str — Name of the side set.
  • legacy_data tuple[npt.NDArray, npt.NDArray] — Tuple of (elements, facets) in legacy format.
Returns SideSet — SideSet instance. Will by default not assign any boundary condition, as this API for setting boundary conditions isn’t implemented yet.

side_sets_from_legacy()

def side_sets_from_legacy(
    legacy_data: dict[str, tuple[npt.NDArray, npt.NDArray]],
) -> tuple[SideSet, ...]: ...

Convert legacy side set data to the new SideSet data structure.

New format makes having a key-based storage superfluous. Anything on a mesh has a retrieval method.

Parameters
  • legacy_data dict[str, tuple[npt.NDArray, npt.NDArray]] — Dictionary mapping side set names to their legacy data.
Returns tuple[SideSet, ...] — List of SideSet instances.

Classes

BoundaryCondition

class BoundaryCondition(enum.Enum):
    def __init__(self): ...

Enumeration of supported boundary conditions for side sets.

Note that this enumeration is the union of allowed types between the wave equation (elastic and acoustic), the diffusion equation, and the Poisson equation.

SideSet

class SideSet(builtins.object):
    def __init__(
        self,
        name: str,
        element_ids: npt.NDArray[np.int64],
        face_ids: npt.NDArray[np.int64],
        boundary_condition: BoundaryCondition | None = None,
        boundary_condition_parameters: (
            AbsorbingBoundaryParameters | None
        ) = None,
    ) -> None: ...

Side set data structure for defining boundary facets on a mesh.

Elements refer to a mesh’ elements by their global index. Facets are referred to by their local (in-element) index.

Parameters
  • name str — Name of the side set.
  • element_ids npt.NDArray[np.int64] — 1D array of global element IDs.
  • face_ids npt.NDArray[np.int64] — 1D array of local face IDs.
  • boundary_condition BoundaryCondition | None — Boundary condition type for this side set.
  • boundary_condition_parameters AbsorbingBoundaryParameters | None — Parameters for the boundary condition.
Methods
identity()
def identity(name: str) -> SideSet: ...

Identity side set for use in reduction operations.

Parameters
  • name str — Name of the side set.
Returns SideSet — SideSet instance with empty elements and facets.
from_legacy()
def from_legacy(
    legacy_name: str, legacy_data: tuple[npt.NDArray, npt.NDArray]
) -> SideSet: ...

Convert a single legacy side set to the new SideSet data structure.

Parameters
  • legacy_name str — Name of the side set.
  • legacy_data tuple[npt.NDArray, npt.NDArray] — Tuple of (elements, facets) in legacy format.
Returns SideSet — SideSet instance. Will by default not assign any boundary condition.