Hello, I am facing some issues accessing subdomains when using the XDMF format. When reading a 3D mesh from GMSH with two distinct subdomains, I followed the steps mentioned earlier in the post:
However,
subdomains = MeshFunction("size_t", mesh, mesh.topology.dim, 0)
gives me only one single domain (i.e. all the elements have tag 0) when I query:
print(subdomains.where_equal(0))
(perhaps I am reseting the tag created by GMsh…)
When I open the xdmf mesh in paraview, I can see that there are two distinct subdomains. What’s the correct way of accessing the subdomains when using xdmf meshes (I did not have trouble when using the legacy xml format). For eg I run into errors if I write
a = inner(u, v)*dx(1) + inner(u,v)*dx(2)
Any help is highly appreciated!!