Importing mesh from gmsh 4.7.1 to dolfin 2019.2.0.dev0

Hi there! I am having trouble converting a .msh file to .xml format from gmsh 4.7.1 to dolfin version 2019.2.0.
I used the command (this command worked fine when converting from gmsh 3.0.1 to dolfin 2019.2.0. for a previous file)
dolfin-convert intima_media.msh intima_media.xml
which returns the error

Converting from Gmsh format (.msh, .gmsh) to DOLFIN XML format
Traceback (most recent call last):
  File "/usr/bin/dolfin-convert", line 132, in <module>
    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 271, in gmsh2xml
    num_elements = int(line)
ValueError: invalid literal for int() with base 10: '5 2599 1 2599\n'

Is there a different command for gmsh version 4.7.1?

Dolfin-convert is no longer maintained, and meshio is the recommended way of converting meshes. See for instance:

1 Like

Thanks dokken! That worked.