# VTKHDF file with empty CellData

**URL:** https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816
**Category:** Development
**Created:** [June 10, 2024, 9:56am UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816 "2024-06-10T09:56:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![leecyid](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leecyid/32/14575_2.png) [@leecyid](https://discourse.paraview.org/u/leecyid)
#### Post date: [June 10, 2024, 9:56am UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816/1 "2024-06-10T09:56:45Z")

</div>

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,

```auto
...
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.

```auto
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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 10, 2024, 9:57am UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816/2 "2024-06-10T09:57:31Z")

</div>

@Louis_Gombert @Lucas_Givord

---

<div class="post-metadata">

### Author: ![Louis\_Gombert](https://discourse.paraview.org/user_avatar/discourse.paraview.org/louis_gombert/32/14576_2.png) [@Louis\_Gombert](https://discourse.paraview.org/u/Louis_Gombert)
#### Post date: [June 10, 2024, 10:05am UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816/3 "2024-06-10T10:05:05Z")

</div>

Hello, this looks like a problem with the VTKHDF reader. Could you please [open an issue](https://gitlab.kitware.com/vtk/vtk/-/issues) along with the problematic .vtkhdf file on our tracker? Thanks for the report.

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [June 10, 2024, 10:16am UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816/4 "2024-06-10T10:16:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![leecyid](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leecyid/32/14575_2.png) [@leecyid](https://discourse.paraview.org/u/leecyid)
#### Post date: [June 10, 2024, 1:25pm UTC](https://discourse.paraview.org/t/vtkhdf-file-with-empty-celldata/14816/5 "2024-06-10T13:25:22Z")

</div>

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