salvus.mesh.algorithms.connectivity
salvus.mesh.algorithms.connectivity salvus mesh algorithms connectivity Connectivity helpers.
Functions
compact_indices()
compact_indices()def compact_indices(global_connectivity: npt.NDArray) -> npt.NDArray: ...Convert global connectivity indices to compact local indices.
global_connectivitynpt.NDArray — Connectivity array with global indices.
get_connectivity_permutation()
get_connectivity_permutation()def get_connectivity_permutation(
n_dim: typing.Literal[2, 3],
model_order: int,
permutation: Permutation = Permutation.DMPlex,
) -> (
tuple[npt.NDArray, npt.NDArray, npt.NDArray]
| tuple[npt.NDArray, npt.NDArray, npt.NDArray, npt.NDArray]
): ...Get the connectivity permutation for varying dimension and model order.
Depending on the permutation and dimension, this function will map a tensor product connectivity array to:
n_dim = 2:
- Permutation.DMPlex: [cells, vertices, edges]
- Permutation.VTK: [vertices, edges, cells]
n_dim = 3:
- Permutation.DMPlex: [cells, vertices, edges, facets]
- Permutation.VTK: [vertices, edges, facets, cells]n_dimtyping.Literal[2, 3] — The dimension of the mesh.model_orderint — The model order of the mesh.permutationPermutation — The desired permutation.
get_connectivity_permutation_2d()
get_connectivity_permutation_2d()def get_connectivity_permutation_2d(
model_order: int,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...Get the connectivity permutation for a 2D quadrilateral mesh.
Permutes element connectivity from a tensor product order [r x s] with r varying fastest, to a VTK Lagrange ordering. To get the inverse permutation (VTK Lagrange ordering -> tensor product ordering), simply run np.argsort on the result.
model_orderint — The model order.
get_connectivity_permutation_3d()
get_connectivity_permutation_3d()def get_connectivity_permutation_3d(
model_order: int,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray, npt.NDArray]: ...Get the connectivity permutation for a 3D hexahedral mesh.
Permutes element connectivity from a tensor product order [r x s x t] with r varying fastest, to a VTK Lagrange ordering. To get the inverse permutation (VTK Lagrange ordering -> tensor product ordering), simply run np.argsort on the result.
model_orderint — The model order.
interior_slice()
interior_slice()def interior_slice(ndim: int) -> tuple[slice, ...]: ...Get the interior slice for a given number of dimensions.
ndimint — The number of dimensions.
Classes
Permutation
Permutationclass Permutation(enum.Enum):
def __init__(self): ...Enum for different types of connectivity permutations.