VTKHDF file with empty CellData

Hello, I’m currently working on the VTKHDF output routine for my simulation code.
It works well when the CellData exists, but Paraview cannot open the VTKHDF file when the dataset is empty (in situations like the code crashes during run).
Suppose I have VTKHDF file as below,

...
GROUP "CellData" {
   DATASET "J" {
      DATATYPE  H5T_IEEE_F64LE
      DATASPACE  SIMPLE { ( 0, 3 ) / ( H5S_UNLIMITED, 3 ) }
      DATA {
      }
   }
}
...
GROUP "Steps" {
   ATTRIBUTE "NSteps" {
      DATATYPE  H5T_STD_I32LE
      DATASPACE  SCALAR
      DATA {
      (0): 0
      }
   }
   GROUP "CellDataOffsets" {
      DATASET "J" {
         DATATYPE  H5T_STD_I32LE
         DATASPACE  SIMPLE { ( 0 ) / ( H5S_UNLIMITED ) }
         DATA {
         }
      }
   }
...

I think it is reasonble to have CellData ‘J’ but not having any data on that dataset.
But Paraview complains with the empty CellData as below.

ERROR: In vtkHDFReaderImplementation.cxx, line 1025
vtkHDFReader (0000023EA12463A0): Error H5Dread start: 0, 0, 2468010975312 count: 1592, 3, 138252272434913

ERROR: In vtkHDFReader.cxx, line 160
(nullptr): Cannot read the J_0 array from file

ERROR: In vtkHDFReader.cxx, line 891
vtkHDFReader (0000023EA12463A0): Cannot read the J array

ERROR: In vtkExecutive.cxx, line 730
vtkPVCompositeDataPipeline (0000023EA1747640): Algorithm vtkFileSeriesReader (0000023EA10FA290) returned failure for request: vtkInformation (0000023EA19FC6A0)
  Debug: Off
  Modified Time: 434210
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  FORWARD_DIRECTION: 0
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0

The problem can be corrected by simply erasing the “J” dataset from the “CellData” group.
If it is reasonable to have empty CellData dataset, can it be applied on the future Paraview releases?

Thank you

@Louis_Gombert @Lucas_Givord

Hello, this looks like a problem with the VTKHDF reader. Could you please open an issue along with the problematic .vtkhdf file on our tracker? Thanks for the report.

don’t hesitate to share your data if its possible.

In your case, I believe also that the reader should warn the user about this cell array named “J”, skip it and try to read other cell data.

Currently its not supported so as Louis mention it, don’t hesitate to open an issue

Thank you for your replies!
I opened the issue [https://gitlab.kitware.com/vtk/vtk/-/issues/19366] with the HDF file attached.

2 Likes