Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.algorithms.unstructured_mesh.side_sets

Side set related algorithms.

Functions

create_side_set()

def create_side_set(
    mesh: UnstructuredMesh,
    side_set_name: str,
    side_set: typing.Optional[
        typing.Union[
            typing.Tuple[npt.NDArray, npt.NDArray],
            typing.Set[typing.Tuple[int, int]],
        ]
    ] = None,
    element_indices: typing.Optional[npt.NDArray] = None,
    side_indices: typing.Optional[npt.NDArray] = None,
) -> None: ...

Create a new side set on the mesh.

There are a two options here:

  • Provide the element and side indices.
  • Directly provide the side set set as provided by UnstructuredMesh.get_side_set().
Parameters
  • mesh UnstructuredMesh — The mesh.
  • side_set_name str — The name of the to be create side set.
  • side_set typing.Optional[typing.Union[typing.Tuple[npt.NDArray, npt.NDArray], typing.Set[typing.Tuple[int, int]]]] — Directly provide the side set.
  • element_indices typing.Optional[npt.NDArray] — The global element indices for the new side set.
  • side_indices typing.Optional[npt.NDArray] — The side ids to use for each element.
Returns None

find_side_sets()

def find_side_sets(
    mesh: UnstructuredMesh, mode: str = "cartesian", tolerance: float = 1e-08
) -> None: ...

Find surfaces of simple box or spherical meshes in 2 or 3 dimension.

Use UnstructuredMesh.find_surface() for more complex shapes.

Parameters
  • mesh UnstructuredMesh — The unstructured mesh.
  • mode str — the side sets to be found depend on the shape of the mesh, should be one of “cartesian”, “cylindrical”, “spherical_full”, “spherical_chunk”, “spherical_chunk_z”, or “spherical_SmoothieSEM”.
  • tolerance float — Floating point tolerance to assume a node is on a given side.
Returns None

find_side_sets_cartesian()

def find_side_sets_cartesian(
    mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...

Find cartesian side sets.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • tolerance float — Distance tolerance.
Returns None

find_side_sets_cylindrical()

def find_side_sets_cylindrical(
    mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...

Find cylindrical side sets.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • tolerance float — Distance tolerance.
Returns None

find_side_sets_enclosing()

def find_side_sets_enclosing(
    mesh: UnstructuredMesh, mode: str = "cartesian", tolerance: float = 1e-08
) -> None: ...

Find surfaces of simple box or spherical meshes in 2 or 3 dimension, augmented by a catch-all surface for unidentified portions of the surface, named “remainder_side_set”.

Runs find_side_sets followed by find_surface to find the remainder side-sets of any non-found facets. Uniquefies side-sets, which will alter existing side-sets.

Parameters
  • mesh UnstructuredMesh — The unstructured mesh.
  • mode str — the side sets to be found depend on the shape of the mesh, should be one of “cartesian”, “cylindrical”, “spherical_full”, “spherical_chunk”, “spherical_chunk_z”, or “spherical_SmoothieSEM”.
  • tolerance float — Floating point tolerance to assume a node is on a given side.
Returns None

find_side_sets_generic()

def find_side_sets_generic(
    mesh: UnstructuredMesh,
    name: str,
    distance: typing.Union[
        typing.Callable[[npt.NDArray], npt.NDArray], npt.NDArray
    ],
    tolerance: float = 1e-08,
    attach_side_set: bool = True,
) -> typing.Optional[typing.Tuple[npt.NDArray, npt.NDArray]]: ...

Find side sets based on a distance function.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • name str — Name of the new side set.
  • distance typing.Union[typing.Callable[[npt.NDArray], npt.NDArray], npt.NDArray] — Callback function taking in points and returning a distance.
  • tolerance float — Point with a distance beneath this are part of the side set.
  • attach_side_set bool — If true, add the side set to the mesh, othewise return the side set elements and sides.
Returns typing.Optional[typing.Tuple[npt.NDArray, npt.NDArray]]

find_side_sets_spherical()

def find_side_sets_spherical(
    mesh: UnstructuredMesh,
    tolerance: float = 1e-08,
    is_chunk: bool,
    is_vertical: bool,
) -> None: ...

Find spherical side sets.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • tolerance float — Distance tolerance.
  • is_chunk bool — Is a chunk, not a full sphere.
  • is_vertical bool — Is a vertically oriented chunk.
Returns None

find_surface()

def find_surface(
    mesh: UnstructuredMesh, side_set_name: str = "surface"
) -> None: ...

Mark all surface faces as a side set.

Parameters
  • mesh UnstructuredMesh — The mesh to use.
  • side_set_name str — Name to give to the found surface.
Returns None

get_side_set()

def get_side_set(
    mesh: UnstructuredMesh, name: str
) -> typing.Set[typing.Tuple[int, int]]: ...

Get one side set as a set.

Useful for logical operations on side sets.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • name str — Name of the side set.
Returns typing.Set[typing.Tuple[int, int]]

get_side_set_facet_nodes()

def get_side_set_facet_nodes(
    mesh: UnstructuredMesh, name: str
) -> typing.Tuple[npt.NDArray[np.float_], npt.NDArray[np.int_]]: ...

Get the tensorized nodes along a side set.

Note that this function respects the tensor order of the mesh, and will therefore return nodes equivalent to a tensorized quad in 3-D and all the nodes along an edge in 2-D.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • name str — The name of the side set.
Returns typing.Tuple[npt.NDArray[np.float_], npt.NDArray[np.int_]] — A tuple of two values: 1st value: The tensorized nodes along the side set, with the shape (n_elem_on_side_set, n_points_per_facet, n_dim). 2st value: The global element nodes indices corresponding to the returned tensorized points.

get_side_set_nodes()

def get_side_set_nodes(mesh: UnstructuredMesh, name: str) -> npt.NDArray: ...

Return side set node ids as an array.

Parameters
  • mesh UnstructuredMesh — The mesh.
  • name str — Name of the side set.
Returns npt.NDArray