ogstools.meshlib.gmsh_meshing module#

ogstools.meshlib.gmsh_meshing.rect(lengths=1.0, n_edge_cells=1, n_layers=1, structured_grid=True, order=1, mixed_elements=False, jiggle=0.0, out_name=Path('rect.msh'), msh_version=None, layer_ids=None)[source]#
ogstools.meshlib.gmsh_meshing.cuboid(lengths=1.0, n_edge_cells=1, n_layers=1, structured_grid=True, order=1, mixed_elements=False, out_name=Path('unit_cube.msh'), msh_version=None)[source]#
ogstools.meshlib.gmsh_meshing.remesh_with_triangles(mesh, output_file=Path() / 'tri_mesh.msh', size_factor=1.0, order=1)[source]#

Discretizes a given Mesh with triangles and saves as gmsh .msh.

Requires the mesh to be 2D and to contain ‘MaterialIDs in the cell data.

Parameters:
  • mesh (UnstructuredGrid) – The mesh which shall be discretized with triangles

  • output_file (Path | str) – The full filepath to the resulting file

  • size_factor (float) – A factor to scale the element sizes.

  • order (int) – The element order (1=linear, 2=quadratic, …)