Required
mesh| Type: | UnstructuredMesh |
| Description: | The mesh whose tensor order to change. |
interpolation_kwargs dictionary):"linear": The default. Perform a bi/trilinear interpolation. No
extra keyword arguments are supported or required for this mode."spherical": Linearly interpolate in radial direction, and apply
spherical linear interpolation (slerp) laterally. The center of the
sphere is always considered to be at the origin of the coordinate
system.
Supported additional keywords:"r1_spherical": Apply slerp only for radii >= r1_spherical,
default: 0.0."r0_spherical": Apply bi/trilinear interpolation for radii <
r0_spherical, default: 0.0.r1_spherical > r0_spherical intermediate radii will linearly
interpolate between both modes."cylindrical": Linearly interpolate radially and along the last
dimension. Slerp in the middle dimension. Only defined in 3D, for
2D point symmetry use "spherical".
Supported additional keywords:"r1_cylindrical": Apply slerp only for radii >= r1_cylindrical,
default: 0.0."r0_cylindrical": Apply bi/trilinear interpolation for radii <
r0_cylindrical, default: 0.0.r1_cylindrical > r0_cylindrical intermediate radii will linearly
interpolate between both modes."SmoothieSEM": Special interpolation mode for spherical
SmoothieSEM mesh that preserves the cylindrical "inner core".
Supported additional keywords:
"r0_spherical", "r1_spherical", "r0_cylindrical", and
"r1_cylindrical" with the same meaning as for the other
interpolation modes.def change_tensor_order(
mesh: UnstructuredMesh,
tensor_order: salvus._core.types.int_ | None = None,
interpolation_mode: InterpolationMode | str = InterpolationMode.linear,
interpolation_kwargs: dict | None = None,
make_unique_points: bool = True,
tensor_node_locations: npt.NDArray | None = None,
) -> None: ...| Type: | UnstructuredMesh |
| Description: | The mesh whose tensor order to change. |
| Type: | salvus._core.types.int_ | None |
| Default value: | None |
| Description: | Desired new tensor order of the elements. |
| Type: | InterpolationMode | str |
| Default value: | InterpolationMode.linear |
| Description: | How to interpolate the location of the new grid points. See above description. |
| Type: | dict | None |
| Default value: | None |
| Description: | Extra keyword arguments for the chosen interpolation mode. See above description. |
| Type: | bool |
| Default value: | True |
| Description: | Remove duplicate points. Make sure to have a reason if you set this to False. |
| Type: | npt.NDArray | None |
| Default value: | None |
| Description: | Locations of the tensor nodes. Defaults to the GLL locations of the chosen tensor order. In almost all cases you will not have to change this. |
interpolation_kwargs dictionary):"linear": The default. Perform a bi/trilinear interpolation. No
extra keyword arguments are supported or required for this mode."spherical": Linearly interpolate radially, slerp laterally. The
center of the sphere is always considered to be at the origin of
the coordinate system.
Supported additional keywords:
"r0_spherical" and "r1_spherical". Don't slerp < r0, slerp =>
r0, and linearly interpolate between both modes in between."cylindrical": Linearly interpolate radially and along the last
dimension. Slerp in the middle dimension. Only makes sense in 3D, for
2D point symmetry use "spherical"
Supported additional keywords:
"r0_cylindrical" and "r1_cylindrical". Don't slerp < r0,
slerp => r0, and linearly interpolate between both modes in
between."SmoothieSEM": Special for SmoothieSEM, only for expert usage.def locally_refine_mesh_in_place(
mesh: UnstructuredMesh,
mask: npt.NDArray,
refinement_level: int = 1,
hierarchical_map: npt.NDArray | None = None,
refinement_type: RefinementType | str = RefinementType.unstable,
interpolation_mode: InterpolationMode | str = InterpolationMode.linear,
interpolation_kwargs: dict | None = None,
reinterpolate_nodal_fields: bool = False,
unique_points_tolerance: int = 12,
) -> npt.NDArray | None: ...| Type: | UnstructuredMesh |
| Description: | The unstructured mesh to refine. |
| Type: | npt.NDArray |
| Description: | Mark either elements, nodes or edges to refine, boolean array with shape (nelem,), (npoint,) or (nelem, edges_per_element) |
| Type: | int |
| Default value: | 1 |
| Description: | Refinement level, can only be larger than 1 for stable schemes and an elemental mask. |
| Type: | npt.NDArray | None |
| Default value: | None |
| Description: | Pass a hierarchical map to keep track of which element in a coarser mesh the newly created elements belongs to. |
| Type: | RefinementType | str |
| Default value: | RefinementType.unstable |
| Description: | Choose the refinement style, currently available in 2D are 'stable', 'unstable', 'stable_convex' and 'unstable_convex', in 3D 'unstable_unidir', 'unstable', 'stable_convex', 'unstable_convex', 'unstable_convex_dir', 'unstable_dir'. Here stable refers to maintaining the angles in multilevel refinements, convexity refers to the region in the mesh in terms of its connectivity (which may be different to its geometric shape for non-rectilinar meshes) and directionality refers to isotropic or anisotropic refinements (where the latter need an edge based refinement mask). |
| Type: | InterpolationMode | str |
| Default value: | InterpolationMode.linear |
| Description: | How to interpolate the location of the new grid points. See above description. |
| Type: | dict | None |
| Default value: | None |
| Description: | Extra keyword arguments for the chosen interpolation mode. See above description. |
| Type: | bool |
| Default value: | False |
| Description: | map nodal fields to the newly created nodes using linear interpolation |
| Type: | int |
| Default value: | 12 |
| Description: | The number of decimal digits used to determine unique points in the refined mesh. |
npt.NDArray | Noneclass InterpolationMode(enum.Enum):
def __init__(self): ...class RefinementType(enum.Enum):
def __init__(self): ...