ogstools.mesh.utils module#
- ogstools.mesh.utils.node_reordering(mesh, method=1, log=True)[source]#
Reorders mesh nodes to make a mesh compatible with OGS6.
- Parameters:
mesh (
UnstructuredGrid) – mesh whose nodes are to be reordered.method (
int) –0: Reversing order of nodes for all elements.
- 1: Reversing order of nodes unless it’s perceived correct by OGS6
standards. This is the default selection.
- 2: Fixing node ordering issues between VTK and OGS6 (only applies
to prism-elements).
- 3: Re-ordering of mesh node vector such that all base nodes are
sorted before all nonlinear nodes.
log (
bool) – If False, silence the NodeReordering tool’s own log output.
- Return type:
- ogstools.mesh.utils.validate(mesh, strict=False)[source]#
Check conformity of mesh with OGS.
- Parameters:
mesh (
UnstructuredGrid|Path|str) – pyvista mesh or path to the mesh file.strict (
bool) – If True, raise a UserWarning if checkMesh returns an error.
- Return type:
- ogstools.mesh.utils.axis_ids_2D(mesh)[source]#
Return the two axes, in which the mesh (predominantly) lives in.
- ogstools.mesh.utils.unique_cell_types(mesh)[source]#
Returns the unique cell types of the mesh
- Return type:
list[CellType]
- ogstools.mesh.utils.pv_set_attr(mesh, attr, value)[source]#
Set a PyVista mesh attribute.
Updates the attribute if it already exists; otherwise creates it using
pyvista.set_new_attribute().- Return type: