salvus.mesh.algorithms.unstructured_mesh.side_sets
Side set related algorithms.
Functions
create_side_set()
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().
meshUnstructuredMesh — The mesh.side_set_namestr — The name of the to be create side set.side_settyping.Optional[typing.Union[typing.Tuple[npt.NDArray, npt.NDArray], typing.Set[typing.Tuple[int, int]]]] — Directly provide the side set.element_indicestyping.Optional[npt.NDArray] — The global element indices for the new side set.side_indicestyping.Optional[npt.NDArray] — The side ids to use for each element.
find_side_sets()
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.
meshUnstructuredMesh — The unstructured mesh.modestr — 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”.tolerancefloat — Floating point tolerance to assume a node is on a given side.
find_side_sets_cartesian()
find_side_sets_cartesian()def find_side_sets_cartesian(
mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...Find cartesian side sets.
meshUnstructuredMesh — The mesh.tolerancefloat — Distance tolerance.
find_side_sets_cylindrical()
find_side_sets_cylindrical()def find_side_sets_cylindrical(
mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...Find cylindrical side sets.
meshUnstructuredMesh — The mesh.tolerancefloat — Distance tolerance.
find_side_sets_enclosing()
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.
meshUnstructuredMesh — The unstructured mesh.modestr — 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”.tolerancefloat — Floating point tolerance to assume a node is on a given side.
find_side_sets_generic()
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.
meshUnstructuredMesh — The mesh.namestr — Name of the new side set.distancetyping.Union[typing.Callable[[npt.NDArray], npt.NDArray], npt.NDArray] — Callback function taking in points and returning a distance.tolerancefloat — Point with a distance beneath this are part of the side set.attach_side_setbool — If true, add the side set to the mesh, othewise return the side set elements and sides.
find_side_sets_spherical()
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.
meshUnstructuredMesh — The mesh.tolerancefloat — Distance tolerance.is_chunkbool — Is a chunk, not a full sphere.is_verticalbool — Is a vertically oriented chunk.
find_surface()
find_surface()def find_surface(
mesh: UnstructuredMesh, side_set_name: str = "surface"
) -> None: ...Mark all surface faces as a side set.
meshUnstructuredMesh — The mesh to use.side_set_namestr — Name to give to the found surface.
get_side_set()
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.
meshUnstructuredMesh — The mesh.namestr — Name of the side set.
get_side_set_facet_nodes()
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.
meshUnstructuredMesh — The mesh.namestr — The name of the side set.
get_side_set_nodes()
get_side_set_nodes()def get_side_set_nodes(mesh: UnstructuredMesh, name: str) -> npt.NDArray: ...Return side set node ids as an array.
meshUnstructuredMesh — The mesh.namestr — Name of the side set.