ogstools.mesh.differences module#
- ogstools.mesh.differences.difference(base_mesh, subtract_mesh, variable=None)[source]#
Compute the difference of variables between two meshes.
- Parameters:
base_mesh (
UnstructuredGrid) – The mesh to subtract from.subtract_mesh (
UnstructuredGrid) – The mesh whose data is to be subtracted.variable (
Variable|str|None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Return type:
- Returns:
A new mesh containing the difference of variable or of all datasets between both meshes.
- ogstools.mesh.differences.difference_pairwise(meshes_1, meshes_2, variable=None)[source]#
Compute pairwise difference between meshes from two lists/arrays (they have to be of the same length).
- Parameters:
meshes_1 (
ndarray[tuple[Any,...],dtype[UnstructuredGrid]]) – The first list/array of meshes to be subtracted from.meshes_2 (
ndarray[tuple[Any,...],dtype[UnstructuredGrid]]) – The second list/array of meshes whose data is subtracted from the first list/array of meshes - meshes_1.variable (
Variable|str|None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Return type:
- Returns:
An array of meshes containing the differences of variable or all datasets between meshes_1 and meshes_2.
- ogstools.mesh.differences.difference_matrix(meshes_1, meshes_2=None, variable=None)[source]#
Compute the difference between all combinations of two meshes from one or two arrays based on a specified variable.
- Parameters:
meshes_1 (
ndarray[tuple[Any,...],dtype[UnstructuredGrid]]) – The first list/array of meshes to be subtracted from.meshes_2 (
ndarray[tuple[Any,...],dtype[UnstructuredGrid]] |None) – The second list/array of meshes, it is subtracted from the first list/array of meshes - meshes_1 (optional).variable (
Variable|str|None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Return type:
- Returns:
An array of meshes containing the differences of variable or all datasets between meshes_1 and meshes_2 for all possible combinations.
- ogstools.mesh.differences.compare(mesh_a, mesh_b, variable=None, point_data=True, cell_data=True, field_data=True, check_topology=True, atol=0.0, *, strict=False)[source]#
Method to compare two meshes.
Returns
Trueif they match within the tolerances, otherwiseFalse.- Parameters:
mesh_a (
UnstructuredGrid) – The reference base mesh for comparison.mesh_b (
UnstructuredGrid) – The mesh to compare against the reference.variable (
Variable|str|None) – The variable of interest. If not given, all point, cell and field data will be processed.point_data (
bool) – Compare all point data if variable is None.cell_data (
bool) – Compare all cell data if variable is None.field_data (
bool) – Compare all field data if variable is None.check_topology (
bool) – IfTrue, compare topologiesatol (
float) – Absolute tolerance.strict (
bool) – Raises anAssertionError, if mismatch.
- Return type: