Importing a hollow cone with physical group names to FEniCSx

Hi,

I’m trying to import a hollow cone geometry into FEniCSx. I generated the mesh in Gmsh, defined the physical groups (including the base and top surfaces), and exported it as a .msh file. However, after converting it to .xdmf, the physical groups seem to be lost in the resulting file.

Is it possible to create a hollow cone directly in FEniCSx, or should I fix this issue in Gmsh? Could you please guide me on how to preserve the physical groups during the conversion process?

Thank you!

Could you please explain how you generated the .msh file?
DOLFINx has a direct interface to GMSH through: dolfinx.io.gmsh:

(read_from_msh: dolfinx.io.gmsh — DOLFINx 0.10.0.post0 documentation)

Thank you for your response, and sharing the link. I generated mesh (for a hollow cone) directly in Gmsh and saved it as a .msh file. Then I used the following commands:

import meshio
mesh = meshio.read(“mesh_file.msh”)
meshio.write(“file_name.xdmf”, mesh)

It successfully converted the .msh file to .xdmf, but the output didn’t include the facet information and used TopologyType="Mixed". As a result, I got an error due to the mixed mesh type.

This is covered in many tutorials, including: Defining subdomains for different materials — FEniCSx tutorial

1 Like