salvus.mesh.algorithms.unstructured_mesh.metrics
Metrics for unstructured meshes.
Functions
compute_maximum_edge_length_per_element()
compute_maximum_edge_length_per_element()def compute_maximum_edge_length_per_element(
mesh: UnstructuredMesh, mask: typing.Optional[npt.NDArray] = None
) -> npt.NDArray: ...Return the max edge size for each element.
Parameters
meshUnstructuredMesh — The mesh to compute it for.masktyping.Optional[npt.NDArray] — Apply a mask on the connectivity.
Returns npt.NDArray
compute_mesh_quality()
compute_mesh_quality()def compute_mesh_quality(
mesh: UnstructuredMesh, quality_metric: str = "edge_aspect_ratio"
) -> npt.NDArray: ...Compute a few proxies for for mesh quality.
Parameters
meshUnstructuredMesh — The mesh to compute it for.quality_metricstr — The quality metric to compute.
Returns npt.NDArray
compute_minimum_edge_length_per_element()
compute_minimum_edge_length_per_element()def compute_minimum_edge_length_per_element(
mesh: UnstructuredMesh,
mask: typing.Optional[npt.NDArray] = None,
direction: typing.Optional[int] = None,
) -> npt.NDArray: ...Compute the smallest edge-length in an element.
Assumes a first order shape approximation.
Parameters
meshUnstructuredMesh — The mesh to compute it for.masktyping.Optional[npt.NDArray] — Optional mask to only compute it for a subset of elements.Trueincludes elements.directiontyping.Optional[int] — Shortest edge-length along a given direction of the reference element in reference coordinates.
Returns npt.NDArray
estimate_resolved_frequency()
estimate_resolved_frequency()def estimate_resolved_frequency(
mesh: UnstructuredMesh,
min_velocity: npt.NDArray,
elements_per_wavelength: float,
) -> typing.Tuple[float, npt.NDArray]: ...Estimate the highest resolved frequency in each element.
Parameters
meshUnstructuredMesh — The mesh to compute it for.min_velocitynpt.NDArray — Minimum velocity in each element.elements_per_wavelengthfloat — The elements per wavelength.
Returns typing.Tuple[float, npt.NDArray]
estimate_time_step()
estimate_time_step()def estimate_time_step(
mesh: UnstructuredMesh,
max_velocity: typing.Union[npt.NDArray, float],
courant_number: float = 1.0,
min_gll_point_distance: float = 1.0,
fast: bool = True,
return_hmin_elemnodes: bool = False,
) -> typing.Union[
typing.Tuple[float, npt.NDArray],
typing.Tuple[float, npt.NDArray, npt.NDArray],
]: ...Compute an estimation of the time step set by each element.
Parameters
meshUnstructuredMesh — The mesh to compute it for.max_velocitytyping.Union[npt.NDArray, float] — Fastest velocity in each element.courant_numberfloat — Courant numbermin_gll_point_distancefloat — min_gll_point_distancefastbool — fastreturn_hmin_elemnodesbool — return_hmin_elemnodes
Returns typing.Union[typing.Tuple[float, npt.NDArray], typing.Tuple[float, npt.NDArray, npt.NDArray]]