Skip to content

hdf5 file produced by vtk hdf writer crashes paraview #295

@HuntFeng

Description

@HuntFeng

Hi thanks for the hard work here!

I'm a newbie to this repo, I'm not familiar with the correct usage.

I have the following code to write 2D point field evolving with time to a hdf5 file.

#include <gridformat/gridformat.hpp>

int main() {
      GridFormat::ImageGrid<2, double> grid {
          { 1.0, 1.0 }, // domain size
          { 10, 12 } // number of cells (pixels) in each direction
      };
      GridFormat::VTKHDFTimeSeriesWriter writer {
          grid,
          "hdf5_test"
      };
      for (double t = 0.0; t < 1; t += 0.1) {
          writer.set_point_field(
              "point_field",
              [&](const GridFormat::Point<GridFormat::ImageGrid<2, double>>& point) {
                  return t;
              }
          );
          const auto written_file = writer.write(t);
      }
    return 0;
}

This HDF5 file crashes Paraview when I changes the time in paraview. According to Paraview support, they said

I reproduce your crash, we reach an assert:
vtkStructuredPointBackend.h:103: vtkStructuredTPointBackend
Assertion `this->ArrayX->GetNumberOfTuples() == 2' failed
I believe you miss the PointDataOffsets group in the Steps/, you can check how we do that in the transient_wavelet.hdf (which is the data used to check this feature in the testing suite of VTK) :
transient_wavelet.hdf

I wonder what is this PoinDataOffsets group here and how do I set that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions