XDMF Saving Issue - Apt vs Conda

I have some code that was working before (when using apt installed Fenics) and doesn’t seem to work with conda installed Fenics:

from dolfin import Mesh,MeshFunction
mesh = Mesh()
... #(some conversion code from meshio mesh)
mesh.order() 
subdomains = MeshFunction('size_t',mesh,mesh.topology().dim())
subdomains.array()[:] = HexCellsDataID

with XDMFFile(MPI.comm_world,os.path.join(savePath,filename+'.xdmf')) as file:
            file.write(mesh)
            file.write(subdomains)
with HDF5File(MPI.comm_world,os.path.join(savePath,filename+'_ID.h5'),'w') as file:
            file.write(mesh,'/mesh')
            file.write(subdomains,'/meshfunction')

In the apt installed Fenics it saves lines like:

<Topology NumberOfElements="239872" TopologyType="Hexahedron" NodesPerElement="8">
        <DataItem Dimensions="239872 8" NumberType="UInt" Format="HDF">STA26_27.h5:/Mesh/mesh/topology</DataItem>
</Topology>

But now, using the conda installed Fenics it only saves:

<Topology NumberOfElements="239872" TopologyType="Hexahedron" NodesPerElement="8">
        <DataItem Dimensions="239872 8" NumberType="UInt" Format="HDF">STA26_27.h5</DataItem>
</Topology>

Manually adding back in the :/Mesh/mesh/topology I am able to open the mesh in Paraview. I’ve search for the error but can’t find a good explanation.

NOTE: I check the version and Dolfin is version 2019.2.0.dev0 from PPA and version 2019.1.0 in Conda.

This could be due to some boost behavior when doing string concatenation, ref: Concatenating strings in a more portable way -- for some unclear reason by massimiliano-leoni · Pull Request #1743 · FEniCS/dolfinx · GitHub
We have resolved this in DOLFINx

1 Like