Required
masks| Type: | list[npt.NDArray] |
| Description: | List of boolean masks (same shape). |
def analyze_masks(masks: list[npt.NDArray]) -> tuple[bool, bool]: ...| Type: | list[npt.NDArray] |
| Description: | List of boolean masks (same shape). |
tuple[bool, bool]def compute_normal_vectors_towards_side_set(
mesh: UnstructuredMesh,
side_set_to_mask_map: dict[str, npt.NDArray],
outward_pointing: bool = True,
split_per_mask: bool = True,
) -> npt.NDArray | dict[str, npt.NDArray]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | dict[str, npt.NDArray] |
| Description: | A dictionary which maps a side set (string) to a boolean element mask. |
| Type: | bool |
| Default value: | True |
| Description: | Whether to have the normal vectors outward (True) or inward (False) w.r.t to the side set. Outwards is defined as the direction from the elements in the mask towards the side-set. |
| Type: | bool |
| Default value: | True |
| Description: | If set to True, will instead return a dictionary mapping every side set to the original element indices as appearing in order of the mask. |
npt.NDArray | dict[str, npt.NDArray]split_per_mask is True, will return a dictionary with the same keys as side_set_to_mask_map, with entries the normal vectors shaped as (nelem_in_mask, mesh.points_per_element, mesh.ndim). Points for which the normal vector computation failed are set to zero.def create_side_set(
mesh: UnstructuredMesh,
side_set_name: str,
side_set: (
tuple[npt.NDArray, npt.NDArray] | set[tuple[int, int]] | None
) = None,
element_indices: npt.NDArray | None = None,
side_indices: npt.NDArray | None = None,
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | The name of the to be create side set. |
| Type: | tuple[npt.NDArray, npt.NDArray] | set[tuple[int, int]] | None |
| Default value: | None |
| Description: | Directly provide the side set. |
| Type: | npt.NDArray | None |
| Default value: | None |
| Description: | The global element indices for the new side set. |
| Type: | npt.NDArray | None |
| Default value: | None |
| Description: | The side ids to use for each element. |
def create_side_set_between_masks(
mesh: UnstructuredMesh,
mask_A: npt.NDArray,
mask_B: npt.NDArray | None = None,
only_add_side_A: bool = True,
) -> tuple[npt.NDArray, npt.NDArray]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | npt.NDArray |
| Description: | The first mask. |
| Type: | npt.NDArray | None |
| Default value: | None |
| Description: | The second mask. If None, the inverse of mask_A is taken. |
| Type: | bool |
| Default value: | True |
| Description: | Whether or not to only add the elements and facets relating to one side of the boundary. Functionally no different but setting to False will double surface data output size. |
tuple[npt.NDArray, npt.NDArray]def find_side_sets(
mesh: UnstructuredMesh, mode: str = "cartesian", tolerance: float = 1e-08
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The unstructured mesh. |
| Type: | str |
| Default value: | 'cartesian' |
| Description: | 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". |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Floating point tolerance to assume a node is on a given side. |
def find_side_sets_cartesian(
mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Distance tolerance. |
def find_side_sets_cylindrical(
mesh: UnstructuredMesh, tolerance: float = 1e-08
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Distance tolerance. |
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.def find_side_sets_enclosing(
mesh: UnstructuredMesh, mode: str = "cartesian", tolerance: float = 1e-08
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The unstructured mesh. |
| Type: | str |
| Default value: | 'cartesian' |
| Description: | 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". |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Floating point tolerance to assume a node is on a given side. |
def find_side_sets_generic(
mesh: UnstructuredMesh,
name: str,
distance: typing.Callable[[npt.NDArray], npt.NDArray] | npt.NDArray,
tolerance: float = 1e-08,
attach_side_set: bool = True,
) -> tuple[npt.NDArray, npt.NDArray] | None: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | Name of the new side set. |
| Type: | typing.Callable[[npt.NDArray], npt.NDArray] | npt.NDArray |
| Description: | Callback function taking in points and returning a distance. |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Point with a distance beneath this are part of the side set. |
| Type: | bool |
| Default value: | True |
| Description: | If true, add the side set to the mesh, othewise return the side set elements and sides. |
tuple[npt.NDArray, npt.NDArray] | Nonedef find_side_sets_spherical(
mesh: UnstructuredMesh,
tolerance: float = 1e-08,
is_chunk: bool,
is_vertical: bool,
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | float |
| Default value: | 1e-08 |
| Description: | Distance tolerance. |
| Type: | bool |
| Description: | Is a chunk, not a full sphere. |
| Type: | bool |
| Description: | Is a vertically oriented chunk. |
def find_surface(
mesh: UnstructuredMesh, side_set_name: str = "surface"
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh to use. |
| Type: | str |
| Default value: | 'surface' |
| Description: | Name to give to the found surface. |
def get_side_set(
mesh: UnstructuredMesh, name: str, allow_empty: bool = False
) -> set[tuple[int, int]]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | Name of the side set. |
| Type: | bool |
| Default value: | False |
| Description: | Return an empty set if the side set is not present. |
set[tuple[int, int]]elements, _ = mesh.side_sets["r1"] indexer = get_side_set_facet_indexer(mesh, "r1") vp_on_side_set_elms = mesh.element_nodal_fields["VP"][elements] vp_on_side_set = np.take_along_axis( vp_on_side_set_elms, indexer, axis=1)
def get_side_set_facet_indexer(
mesh: UnstructuredMesh, name: str
) -> npt.NDArray[np.int64]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | The name of the side set. |
npt.NDArray[np.int64]def get_side_set_facet_nodes(
mesh: UnstructuredMesh, name: str
) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.int64]]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | The name of the side set. |
tuple[npt.NDArray[np.float64], npt.NDArray[np.int64]]def get_side_set_nodes(mesh: UnstructuredMesh, name: str) -> npt.NDArray: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | str |
| Description: | Name of the side set. |
npt.NDArraydef side_sets_for_element_ids(
mesh: UnstructuredMesh, ids: npt.NDArray
) -> set[str]: ...| Type: | UnstructuredMesh |
| Description: | The mesh. |
| Type: | npt.NDArray |
| Description: | An array of element IDs for which to find the associated side sets. |
set[str]