salvus.mesh.algorithms.unstructured_mesh.qc
salvus.mesh.algorithms.unstructured_mesh.qc salvus mesh algorithms unstructured_mesh qc Metrics for unstructured meshes.
Functions
qc_connectivity()
qc_connectivity()def qc_connectivity(mesh: UnstructuredMesh) -> list[validation.QCIssue]: ...Quality control for mesh connectivity.
Parameters
meshUnstructuredMesh — The mesh to check.
Returns list[validation.QCIssue]
qc_mesh_materials()
qc_mesh_materials()def qc_mesh_materials(
mesh: UnstructuredMesh, level: validation.QCLevel | str = QCLevel.strict
) -> list[validation.QCIssue]: ...Quality control for mesh materials.
Parameters
meshUnstructuredMesh — The mesh to check.levelvalidation.QCLevel | str — The level of quality control to perform. Available levels are BASIC and STRICT. One can pass an enumeration value or a string representation of the level.
Returns list[validation.QCIssue]
run_mesh_qc_tests()
run_mesh_qc_tests()def run_mesh_qc_tests(
mesh: UnstructuredMesh,
level: validation.QCLevel | str = QCLevel.strict,
display_issues: bool = True,
) -> dict[str, validation.QCIssue]: ...Run a series of mesh quality control tests on the provided mesh.
This function runs various quality control checks on the mesh, such as parameters values and checking the geometry of the elements. It collects issues found during the checks and returns them as a list of QCIssue objects. These issue objects contain information about the severity, message, mitigation steps, and any relevant data associated with the issue.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
Parameters
meshUnstructuredMesh — An instance of UnstructuredMesh to be checked.levelvalidation.QCLevel | str — The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.display_issuesbool — If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
Returns dict[str, validation.QCIssue] — A dictionary of QCIssue objects representing the issues found during the quality control checks. The keys are formatted as “type:code”, where
type is the type of the issue (e.g, “mesh” or “material”) and code is a specific code for the issue (e.g., “NEGATIVE_DET”). If no issues are found, an empty dictionary is returned.