I dont really now how to help you further. If you use the docker to install fenics, and then run the following:
docker run -ti --rm -v $(pwd):/home/fenics/shared quay.io/fenicsproject/stable:latest
sudo pip install meshio lxml h5py
I used gmsh 3.0.6 to generate the msh file.
Then running the following script:
import meshio
msh = meshio.read("file.msh")
meshio.write("mesh.xdmf", meshio.Mesh(points=msh.points, cells={"tetra": msh.cells["tetra"]}))
meshio.write("mf.xdmf", meshio.Mesh(points=msh.points, cells={"triangle": msh.cells["triangle"]},
cell_data={"triangle": {"name_to_read": msh.cell_data["triangle"]["gmsh:physical"]}}))
meshio.write("cf.xdmf", meshio.Mesh(
points=msh.points, cells={"tetra": msh.cells["tetra"]},
cell_data={"tetra": {"name_to_read":
msh.cell_data["tetra"]["gmsh:physical"]}}))
from dolfin import *
mesh = Mesh()
with XDMFFile("mesh.xdmf") as infile:
infile.read(mesh)
mvc = MeshValueCollection("size_t", mesh, 2)
with XDMFFile("mf.xdmf") as infile:
infile.read(mvc, "name_to_read")
mf = cpp.mesh.MeshFunctionSizet(mesh, mvc)
mvc = MeshValueCollection("size_t", mesh, 3)
with XDMFFile("cf.xdmf") as infile:
infile.read(mvc, "name_to_read")
cf = cpp.mesh.MeshFunctionSizet(mesh, mvc)
ds_custom = Measure("ds", domain=mesh, subdomain_data=mf, subdomain_id=12)
print(assemble(1*ds_custom))
I get a non-zero output:
3.125e-08