I would like to convert a simple 2D gmsh mesh for use in fenics, t1.geo from the gmsh tutorial, for instance. It seems that dolfin-convert is deprecated, so I decided to use meshio. The suggested format xdmf however is not compatible with dolfin, see https://github.com/nschloe/meshio/issues/260. On the other hand, with the following code
from dolfin import * import meshio msh = meshio.read("t1.msh") meshio.write("mesh.xml",msh) mesh = Mesh("mesh.xml")
dolfin is still complaining (“DOLFIN XML can only handle one cell type at a time. Using triangle, discarding vertex, line.”), although the file is readable. However, the mesh is interpreted as 3D.
So, what is a clean way of importing 2D gmsh meshes?