barbagroup/PetIBM

Xdmf output files crash Paraview

jedbrown opened this issue · 10 comments

I've been able to visualize using VisIt, but not Paraview. Additionally, the files fail to validate with Xdmf.dtd.

xmllint --noout --valid --dtdvalid Xdmf.dtd u.xmf

This may be a deficiency of Xdmf.dtd because many examples from the Xdmf documentation also fail to validate, but could also be the reason for crashes with Paraview. I'm using Paraview-5.4.1 on Linux.

Neither 'Type' nor 'TopologyType' found in itemProperties in XdmfTopologyType::New
terminate called after throwing an instance of 'XdmfError'
  what():  Neither 'Type' nor 'TopologyType' found in itemProperties in XdmfTopologyType::New
Aborted (core dumped)

Thank you, @jedbrown.

The DTD file does not have all elements and attributes mentioned in either XDMF2 or XDMF3 format. So maybe this DTD file is not complete. For example, in the documentation, it says

Any element in XDMF can have a Name attribute or have a Reference attribute.

But in the DTD file, Topology element doesn't have Name attribute, and only DataItem element can have attribute Reference.

However, we did manage to follow the DTD file with some workarounds. The XDMF files now should pass the validation. And this indeed makes ParaView able to read the XDMF files. The followings are the main changes:

1. Use 3DRectMesh and VXVYVZ for both 2D and 3D cases

There is no VXVY geometry type in the DTD file. This probably means ParaView doesn't handle 2DRectMesh well because it doesn't know how to handle VXVY. So we use 3DRectMesh and VXVYVZ for all cases regardless 2D or 3D. In 2D, therefore, we add dummy z-axis.

2. Use ENTITY definition instead of Reference for topologies and geometries

We use entity definitions to handle repeating Topology and Geometry in each XDMF file. We used to use Reference skill. But according to the DTD file, Topology and Geometry elements don't have attribute Reference, so we now use entity definitions as the trick to avoid DTD validation failure.

The modification can be found in the commit c6fcfef.

We also added information about ParaView to documentation in doc/markdowns/runpetibm.md.

That's great. I'll test in the morning. What do you think about filing a bug report (or PR) with Xdmf to fix their Xdmf.dtd? (I know this is outside the scope of the JOSS review, but it evidently needs to be done.)

When I tried to create an issue in XDMF's GitLab repo, I found there is already an issue for that from two months ago: https://gitlab.kitware.com/xdmf/xdmf/issues/12 And this issue is now on the top of the issue list, so I think currently we don't have to create a new one for the same problem.

Hi, guys,

I met the same problem when trying to open u.xmf file created by petibm-createxdmf using ParaView-5.6.0. I also have OpenFOAM 7 installed, so this ParaView version is installed automatically as a third-party package.

When I opened the u.xmf file and clicked the Apply button, the ParaView gave loads of errors.

BTW, I used the last case of the 2D examples: unsteady flow past a cylinder at Re=550.

Can you guys help to have a look what the problem is?

Thanks a lot.

Kind regards;

Guangyu

Hi, guys,

Here are the errors reported by ParaView-5.6.0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6ae39680)
Debug: Off
Modified Time: 261734
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6ae39680)
Debug: Off
Modified Time: 263369
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6ae39680)
Debug: Off
Modified Time: 263427
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6ba60390)
Debug: Off
Modified Time: 361641
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkCompositeDataPipeline (0x564b6ba78910): Algorithm vtkPVGeometryFilter(0x564b6ba611a0) returned failure for request: vtkInformation (0x564b6ba7ab70)
Debug: Off
Modified Time: 361673
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6bd65e70)
Debug: Off
Modified Time: 361969
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkCompositeDataPipeline (0x564b6bd77760): Algorithm vtkPVGeometryFilter(0x564b6bd664a0) returned failure for request: vtkInformation (0x564b6bd79ae0)
Debug: Off
Modified Time: 362002
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6b8d8b60)
Debug: Off
Modified Time: 362118
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6ba60390)
Debug: Off
Modified Time: 362390
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkCompositeDataPipeline (0x564b6ba78910): Algorithm vtkPVGeometryFilter(0x564b6ba611a0) returned failure for request: vtkInformation (0x564b6ba7ab70)
Debug: Off
Modified Time: 361673
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6bd65e70)
Debug: Off
Modified Time: 362475
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkCompositeDataPipeline (0x564b6bd77760): Algorithm vtkPVGeometryFilter(0x564b6bd664a0) returned failure for request: vtkInformation (0x564b6bd79ae0)
Debug: Off
Modified Time: 362002
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/IO/Xdmf2/vtkXdmfReader.cxx, line 421
vtkXdmfReader (0x564b6af583d0): Failed to read data.

ERROR: In /home/ubuntu/OpenFOAM/ThirdParty-dev/ParaView-5.6.0/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 782
vtkPVCompositeDataPipeline (0x564b6af0c160): Algorithm vtkFileSeriesReader(0x564b6a782e00) returned failure for request: vtkInformation (0x564b6b8d8b60)
Debug: Off
Modified Time: 362537
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

Many thanks!

Hi, guys,

I think I got the solution. I tried to use VisIt but failed to import the data, which was unexpected. Then I found it was because the generated .xmf files provide wrong directory for the .h5 files.

In the original .xmf files, the CaseDir ".//output", which led to a wrong directory for hte .h5 files.

After changing it to CaseDir "./", I could open the files without problem. This not only solved my problem for VisIt, but also for ParaView.

However, I don't think it is a bug in PetIBM program, because it should be detected very easily. So it may be something associated with how I opened the file.

Any comments on this?

Thanks a lot.

Kind regards;

Guangyu

Hi @shi-guangyu, thank you for reporting. I also encountered a crash, but my error messages are different from yours. I opened an issue in #151 and describe a workaround. But my error messages are different from yours, so I'm not sure if that workaround can resolve your crash. Please let us know, thanks!

Great! Thanks again for catching the bug!

I think it's probably a bug in petibm-createxdmf. But we'll have to check that. We now often create visualizations and plots with Python scripts directly, instead of relying on post-processing software. Maybe that's why we didn't see it.

As the original issue has been stale for a long time, we are not sure if it still exists in ParaView or not. So I'll close the issue and, if we encounter the problem again, create a new one.

That's fine. Xdmf seems to be abandoned (no commits and no maintainer replies in a year), though it's still used by various projects. Perhaps a community effort should create Xdmf4 as a pure HDF5 format (no silly XML).