read in hexahedral mesh
I'd like to read in a mesh with hexahedral elements (will be generated with gmsh and converted with meshio to XDMF).
However, the MWE
from dolfin import * mesh = UnitCubeMesh.create(16, 16, 16, CellType.Type_hexahedron) XDMFFile('mesh_hex.xdmf').write(mesh) mesh2 = Mesh() XDMFFile('mesh_hex.xdmf').read(mesh2)
gives the following error:
*** Error: Unable to recognise cell type.
*** Reason: Unknown value "hexahedron".
*** Where: This error was encountered inside XDMFFile.cpp.
So hex meshes can be written but not read by XDMFFile.
Is there another way?
Nevertheless note that quad/hex support in DOLFIN is flawed and only meshes which increasing vertex numbers on every cell are supported, see https://bitbucket.org/fenics-project/dolfin/issues/997. A remediation will be provided in DOLFINx.