Can't view xdmf checkpoint of Function in paraview

Is there a trick to viewing a solution (a Function) saved to xdmf as a checkpoint? When I save to file using

fileXDMF = XDMFFile(MPI.comm_world, "solution.xdmf")
fileXDMF.write_checkpoint(u,"u")

then view with paraview, paraview only shows the mesh,not the function, and complains " Skipping attribute u at Node. Warning: In /build/paraview-OJ3Fdc/paraview-5.4.1+dfsg4/VTK/IO/Xdmf2/vtkXdmfHeavyData.cxx, line 1059
vtkXdmfReader (0x558075860f00): Skipping attribute u at Node"

If instead I use

fileXDMF.write(u)

then paraview displays the function as expected.

Is there something that I missed with fileXDMF.write_checkpoint(u,"u")? This is with dolfin 2018.1.0.

Viewing a solution saved to .xdmf using write_checkpoint is working fine for me using Paraview version 5.5.2 and dolfin 2018.1.0. You may want to try a different version of Paraview. I have had small issues with specific versions before.

2 Likes

I’ve got paraview 5.4.1, so what you’re saying makes sense. I need to upgrade my paraview.

Hi all ! I’m experiencing the exact same issue with Paraview 5.7.0 and 5.6.0. Have you managed to solve your problem ?

Thanks !

Hi @RemDelaporteMathurin, finally had a chance to test.

You’re right, I do still get the same error reading a checkpoint file:
vtkXdmfReader (0x5e1d6f0): Skipping attribute u at Node

This is with the paraview 5.6.1 64bit tarball downloaded from https://www.paraview.org/download/

Ah, no, actually it does work, but only conditionally.

There is a clue in the detailed error message it emits (shown in the dialog box):

Warning: In /home/buildslave/dashboards/buildbot/paraview-pvbinsdash-linux-shared-release_superbuild/build/superbuild/paraview/src/VTK/IO/Xdmf2/vtkXdmfHeavyData.cxx, line 1059
vtkXdmfReader (0x5e1d6f0): Skipping attribute u at Node

So the error is coming from Xdmf2/vtk.

But when I start up the paraview from the tarball, it asks me to specify which reader:

Xdmf3ReaderS
Xdmf3ReaderT
XDMF Reader

I had chosen “XDMF Reader” because it seemed like a “finished” reader while the others look like work-in-progress (what is S, T ??). But XDMF Reader is the one that gives the error. Evidently it’s the old reader, Xdmf2. The one we need to use is the Xdmf3 reader.

(No idea what the difference between Xdmf3ReaderS and Xdmf3ReaderT is, both work on my simple test case. The Open File dialog box refers to “Xdmf3 Top Level Partition”, so that must be T).

Ah thanks for sharing your solution. This does indeed work for 2D/3D solutions. But not for 1D fields… here’s a MWE:

from fenics import *

mesh = UnitIntervalMesh(5)
V = FunctionSpace(mesh, 'P', 1)
u = Function(V)

with XDMFFIle("u.xdmf") as f:
    f.write_checkpoint(u, "label", 1, XDMFFIle.Encoding.HDF5, append=False)
    f.write_checkpoint(u, "label", 2, XDMFFIle.Encoding.HDF5, append=True)

In both versions of Paraview I’m using (see above) I can’t visualise the data. Can you ?

The data arrays don’t seem to be accessible, I can’t see the 1D data either from paraview (I was testing a 2D function). Hopefully others can advise.

Could you maybe mark the topic as unsolved ?

Solved for 2D, 3D, unsolved for 1D.

Hi,

Have you by chance managed to solve this issue in 1D ?

cheers

Apparently this is not a Paraview issue according to this post.

I’ve raised an issue at https://bitbucket.org/fenics-project/dolfin/issues/1091/

1 Like