How to save a mesh in Dolfin in the gmsh format


467
views
0
8 months ago by
auser  
I have a mesh in the dolfin format. Is there a way for me to export it to the gmsh format? I'm aware of this old post: https://fenicsproject.org/qa/959/how-to-save-a-mesh-in-gmsh-format. However, I was unable to install the required octave package (msh) and I don't think that I will be able to unless I modify the package's code as it has not been updated since 2014! In particular, the code still uses boost's shared pointers instead of those of the standard library, but Dolfin switched from the former to the latter in 1.3 (For a similar, but fixed issue: https://lists.gnu.org/archive/html/help-octave/2017-03/msg00224.html).

Thanks in advance for your help.
Community: FEniCS Project
what about using dolfin-convert? you can save your mesh in xml format and the convert it to .gmsh (or .msh) using the next line from terminal:
dolfin-convert foo.xml foo.gmsh​
written 8 months ago by Hernán Mella  
Dolfin convert can convert from gmsh to xml, but not the other way around. You will get the error:
$ dolfin-convert  foo.xml foo.msh
*** Sorry, cannot convert between xml and DOLFIN xml file formats.
​

If you look at the code for Dolfin convert, you can confirm that this feature is not implemented.
written 8 months ago by auser  

1 Answer


4
8 months ago by
Give a try to lovely https://github.com/nschloe/meshio by Nico Schlömer.
It is indeed quite lovely. Thank you!
written 8 months ago by auser  
meshio-convert is great
written 8 months ago by Nate  
Can you please tell me what sort of code  i have to write to convert .xml to .stl format. I am trying to convert my mesh. I have tried meshio-convert input.xml output.stl but i think something more would be required. Need some guidance please.

Thanks
written 6 months ago by Ovais  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »