Errors when reading xdmf files converted from msh mesh containing both wedge and hexahedron cells

Hi everyone

I am using XDMFFile to read a complex mesh file. My MSH mesh contains ‘hexahedron’, ‘wedge’ 3D cells in the body and ‘quad’ 2D cells on the surfaces.

Since Fenics can not read “mixed” mesh file. I have to seperate the original MSH mesh into “mesh_wedge.xdmf” and ‘mesh_hexahedron.xdmf’.

My questions rise from here.

  1. How to read the xdmf files and recombine them with Fenics mesh? i.e.

mesh1 = Mesh()
with XDMFFile(“mesh_wedge.xdmf”) as infile:
infile.read(mesh1)

mesh2 = Mesh()
with XDMFFile(“mesh_hexahedron.xdmf”) as infile:
infile.read(mesh2)

How to define mesh1 + mesh2 ?

  1. I have errors when read the ‘mesh_wedge.xdmf’ and ‘mesh_hexahedron.xdmf’ files.

*** Error: Unable to recognise cell type.
*** Reason: Unknown value “wedge”.
*** Where: This error was encountered inside XDMFFile.cpp.

and


*** Error: Unable to order hexahedron cell.
*** Reason: Cell is not orderable.
*** Where: This error was encountered inside HexahedronCell.cpp.
*** Process: 0

  1. Is there away to convert wedge and hexahedron into tetrahedron?

Thank you very much
Best regards

There is no support in FEniCS for Mixed meshes (element wise). Also, for hexahedron meshes, i strongly advice you to move to dolfinx, as there has been done several significant improvements in handling non-simplistic meshes there.

Thank Dokken

I will think about dolfinx latter.

Do you know how to convert hexahedron meshes, wedge meshes into tetrahedron meshes?

I found a solution for converting all mesh types to tetra.

https://gmsh.geuz.narkive.com/o68c1K1C/from-hexahedrons-to-tetrahedrons