Hello
I get an error in reading a mesh in parallel that I was not able to fix. Here is the code:
from dolfin import *
mesh = UnitCubeMesh.create(1,1,1,CellType.Type.hexahedron)
# define left face
class Left(SubDomain):
def inside(self, x, on_boundary):
return abs(x[0] - 0.0) < DOLFIN_EPS and on_boundary
left = Left()
boundaries = MeshFunction('size_t', mesh, mesh.topology().dim()-1)
subdomains = MeshFunction('size_t', mesh, mesh.topology().dim())
# marking boundary
boundaries.set_all(0)
left.mark(boundaries, 1)
hdf = HDF5File(mesh.mpi_comm(), "file.h5", "w")
hdf.write(mesh, "/mesh")
hdf.write(subdomains, "/subdomains")
hdf.write(boundaries, "/boundaries")
So far so good but when I want to read it:
mesh = Mesh()
hdf = HDF5File(mesh.mpi_comm(), "file.h5", "r")
hdf.read(mesh, "/mesh", False)
subdomains = MeshFunction('size_t', mesh, mesh.topology().dim())
hdf.read(subdomains, "/subdomains")
boundaries = MeshFunction('size_t', mesh, mesh.topology().dim()-1)
hdf.read(boundaries, "/boundaries")
I get this error:
*** Error: Unable to read meshfunction topology.
*** Reason: Cell dimension mismatch.
The thing is it happens in case of hexahedron element. For example it works fine if I use :
CellType.Type.tetrahedron
But I want to use hexahedron element. Does anybody know how this could be fixed?