I’ve created a file.geo with gmsh, and then generated a 3D mesh, without error nor warning. That mesh looks fine when viewed in gmsh, however dolfin-convert fails to convert it to xml.
Here’s the file.geo:
SetFactory("OpenCASCADE");
// The box
Box(1) = {0, 0, 0, 2, 1, 0.038};
// The rectangular surface over the surface of the box.
Rectangle(7) = {0, 0, 0.038, 0.1, 0.2, 0};
// Define the Physical Surfaces where the boundary conditions will be applied.
Physical Surface("rectangle") = {7};
Physical Surface("top_box") = {6};
Physical Surface("bottom_box") = {5};
Physical Surface("left_box") = {1};
Physical Surface("front_box") = {3};
Physical Surface("behind_box") = {4};
Physical Surface("right_box") = {2};
Physical Volume("box") = {1};
And here’s what “dolfin-convert -i gmsh file.msh file.xml” returns:
Converting from Gmsh format (.msh, .gmsh) to DOLFIN XML format
Expecting 182 vertices
Found all vertices
Expecting 456 cells
Found all cells
Traceback (most recent call last):
File “/usr/bin/dolfin-convert”, line 132, in
main(sys.argv[1:])
File “/usr/bin/dolfin-convert”, line 79, in main
meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
File “/usr/lib/python3/dist-packages/dolfin_utils/meshconvert/meshconvert.py”, line 1301, in convert2xml
convert(ifilename, XmlHandler(ofilename), iformat=iformat)
File “/usr/lib/python3/dist-packages/dolfin_utils/meshconvert/meshconvert.py”, line 1322, in convert
gmsh2xml(ifilename, handler)
File “/usr/lib/python3/dist-packages/dolfin_utils/meshconvert/meshconvert.py”, line 494, in gmsh2xml
index = nodes_as_facets[tuple(nodes)]
KeyError: (0, 1, 62)
Which is essentially exactly the same problem described here back in 2016.
Does someone have an idea on what’s wrong? Thank you!