This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Convert COMSOL mesh to FEniCS format

0 votes

Dear all,

What would be the preferred way to use a mesh generated in COMSOL in FEniCS?
I tried exporting it to bdf format, and convert to .msh in gmsh which is supported by dolfin-convert. However, when running it I get the error *** Unable to find cells of supported type.
How could I solve this?
If needed, I could upload the .bdf or .msh file.

asked Jun 14, 2017 by meron FEniCS User (2,340 points)

2 Answers

0 votes

What elements type are you using? Fenics only (at least for now, someone is working on this) supports interval, triangular and tetrahedral elements

answered Jun 14, 2017 by alexmm FEniCS User (4,240 points)

Thank you for replying. When I look at the statistics in Gmesh it says it consists of 232297 tetrahedra, no hexahedra or other unsupported elements are shown there.

0 votes

Hello,

I used to have a similar problem. My solution was to generate my mesh using gmsh and then import the mesh to dolfin using dolfin-convert mesh_file.msh mesh_file.xml .... This way you have a mesh that you can still use at COMSOL and also in FEniCS...
info about dolfin mesh converter: https://people.sc.fsu.edu/~jburkardt/py_src/dolfin-convert/dolfin-convert.html

answered Jun 14, 2017 by lhdamiani FEniCS User (2,580 points)

Thanks for replying, however I already have a mesh in COMSOL. I export it to .bdf and import it in Gmesh where I define some surfaces and then export to .msh. For some unknown reason dolfin-convert crashes when I run it giving the above error.

...