Mondaic

salvus.mesh.data_structures.salvus_mesh.algorithms.comparison

salvus.mesh.data_structures.salvus_mesh.algorithms.comparison salvus mesh data_structures salvus_mesh algorithms comparison

Comparison functionality for meshes.

Functions

blocks_are_equal()

def blocks_are_equal(
    block_a: MeshBlock,
    block_b: typing.Any,
    raise_with_error_if_not_equal: bool = False,
    expand_scalar_nodal_fields: bool = False,
) -> bool: ...

Compare two mesh blocks for equality.

Parameters
  • block_a MeshBlock — First block to compare.
  • block_b typing.Any — Second block to compare.
  • raise_with_error_if_not_equal bool — If True, raise an error with a detailed report if the blocks are not equal.
  • expand_scalar_nodal_fields bool — If True, consider scalar nodal fields equal to non-scalar nodal fields if the non-scalar field is constant and equal to the scalar value.
Returns bool — True if the blocks are equal, False otherwise.

meshes_are_equal()

def meshes_are_equal(
    mesh_a: Mesh,
    mesh_b: typing.Any,
    raise_with_error_if_not_equal: bool = False,
    compare_migration_data: bool = False,
    expand_scalar_nodal_fields: bool = False,
) -> bool: ...

Compare two meshes for equality.

Parameters
  • mesh_a Mesh — First mesh to compare.
  • mesh_b typing.Any — Second mesh to compare.
  • raise_with_error_if_not_equal bool — If True, raise an error with a detailed report if the meshes are not equal.
  • compare_migration_data bool — If True, compare the migration data of the meshes as well.
  • expand_scalar_nodal_fields bool — If True, consider scalar nodal fields equal to non-scalar nodal fields if the non-scalar field is constant and equal to the scalar value.
Returns bool