Version:

salvus.mesh.algorithms.connectivity

salvus.mesh.algorithms.connectivity salvus mesh algorithms connectivity
Connectivity helpers.

Functions

compact_indices()

Convert global connectivity indices to compact local indices.
SIGNATURE
def compact_indices(global_connectivity: npt.NDArray) -> npt.NDArray: ...
ARGUMENTS
Required
global_connectivity
Type:npt.NDArray
Description:
Connectivity array with global indices.
RETURNS
Return type: npt.NDArray
Connectivity array with local indices (0-based sequential numbering).

get_connectivity_permutation()

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]
SIGNATURE
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]
): ...
ARGUMENTS
Required
n_dim
Type:typing.Literal[2, 3]
Description:
The dimension of the mesh.
Required
model_order
Type:int
Description:
The model order of the mesh.
Optional
permutation
Type:Permutation
Default value:Permutation.DMPlex
Description:
The desired permutation.
RETURNS
Return type: tuple[npt.NDArray, npt.NDArray, npt.NDArray] | tuple[npt.NDArray, npt.NDArray, npt.NDArray, npt.NDArray]
The connectivity permutation array.

get_connectivity_permutation_2d()

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.
SIGNATURE
def get_connectivity_permutation_2d(
    model_order: int,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
ARGUMENTS
Required
model_order
Type:int
Description:
The model order.
RETURNS
Return type: tuple[npt.NDArray, npt.NDArray, npt.NDArray]
The connectivity permutation array.

get_connectivity_permutation_3d()

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.
SIGNATURE
def get_connectivity_permutation_3d(
    model_order: int,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray, npt.NDArray]: ...
ARGUMENTS
Required
model_order
Type:int
Description:
The model order.
RETURNS
Return type: tuple[npt.NDArray, npt.NDArray, npt.NDArray, npt.NDArray]
The connectivity permutation array.

interior_slice()

Get the interior slice for a given number of dimensions.
SIGNATURE
def interior_slice(ndim: int) -> tuple[slice, ...]: ...
ARGUMENTS
Required
ndim
Type:int
Description:
The number of dimensions.
RETURNS
Return type: tuple[slice, ...]
A tuple of slice objects for the interior of each dimension.

Classes

Permutation

Enum for different types of connectivity permutations.
SIGNATURE
class Permutation(enum.Enum):
    def __init__(self): ...
PAGE CONTENTS