XDMF Export does not generate a valid XDMF file

Issue #1133 resolved
Tim Suchan created an issue

I have been scratching my head at the following issue:

from fenics import *

# Create mesh
mesh = UnitSquareMesh(8, 8)

# Save mesh to file in XDMF format
xdmffile_open = XDMFFile('mesh.xdmf')
xdmffile_open.write(mesh, XDMFFile.Encoding.HDF5)
xdmffile_open.close()

This code (on the cluster where I installed FEniCS myself) generates an XDMF and a H5 file, and the H5 file looks good. However, the XDMF file does not have the correct file structure of the h5. This of course makes Paraview crash. The errors are:

  • in the topology part: the mesh.h5 should be followed by a “:/Mesh/mesh/topology”
  • in the geometry part: the mesh.h5 should be followed by a “:/Mesh/mesh/geometry”
  • if I were to export a function swell, then there the mesh.h5 should be followed by a “:/VisualisationVector/0”

However, none of this is the case. I have attached the xdmf and the h5 file that were generated on the cluster. I assume this is an error in the configuration on my side, but I really don’t know where to look for the mistake. Maybe someone has an idea beforehand, though? I have tried the same code on a workstation and there the file structure is generated correctly.

Comments (4)

  1. Henrik Finsberg

    What is the version of HDF5 and boost that you used to compile FEniCS? We haven’t really tested FEniCS properly on new versions of HDF5 and boost so there might be an issue with the new versions.

  2. Tim Suchan reporter

    Thanks for your answer. On the cluster (where it is not working correctly), I am using HDF5 version 1.12.1 and Boost 1_77, while on the workstation, HDF5 version 1.12.1 and Boost 1_71 is used.

  3. Tim Suchan reporter

    I have uninstalled boost 1.77, installed boost 1.71 and reinstalled FEniCS using this. Now the XDMF is created correctly. Thanks for the hint @Henrik Finsberg, I was really clueless before!

  4. Log in to comment