Here attached the python script and an application example (both poorly written, quick&dirty, .gmsh-gml_ogs6.zip.zip the python script comes with no guarantee whatsoever)
The file gmsh_coarse.geo provides the input for GMSH, to build a rectangle with two holes, with the following physical groups defined:
- 3 physical surfaces: the rectangle minus the 2 holes, the hole on the left and the hoel on the right
- 5 physical curves: the 4 borders of the rectangle plus 2 curves defining the circle boundary of each holes.
The mesh generated with GMSH must be saved as GMSH v.2, as always (for example as gmsh.msh, like here )
The script msh2gml.py will then prepare the geometry mesh.gml starting from the gmsh.msh file (Have a look at the Note at the bottom of this message).
Then the mesh is prepared with various iterations of manual editing of the gmsh.msh to remove the holes material, NodeReordering , Paraview to add PointData and CellData, etcetc…
Note: the gml file generated this way almost always produces a segmentation fault error in OGS6 (serial, Singularity container).
For some reasons I don’t understand, manually adding a point (for example, a point id=“236” x=…) before the first point id output by the script makes OGS6 happy.
An example of this behavior can be seen in the simle example attached ( seg_fault.zip (25.7 KB) ) simply by using either geometry_1.gml (ogs6 crashing) or geometry_2.gml (random point added, not used in any polylines, but ogs6 is happy).