Support for RectilinearGrids and StructuredGrids in VTKHDF file format

Hi,

I’m interested in using RectilinearGrids and StructuredGrids in the VTKHDF format. Since these formats are not currently supported or on the roadmap, I’ve taken a few minutes to translate some simple .vtr and .vts files from XML into what could be a VTKHDF version. The files are quite similar in structure to both the existing ImageData and UnstructuredGrid formats.

Here is the RectilinearGrid example:
rect_example.vtkhdf (20.2 KB)

rect_example.vtr (27.7 KB)

And here is a simple StructuredGrid example:
cylinder_segment.vts (441.6 KB)

cylinder_segment.vtkhdf (172.7 KB)

Hope this helps get the discussion started and a possible definition in place.

2 Likes

Thanks for writing this proposal!

For convenience, here is the hierarchy obtained in the rect_example.vtkhdf:

image

the original issue regarding this in VTK is here: https://gitlab.kitware.com/vtk/vtk/-/issues/19379

Basically, for RectilinearGrid, it follows the structure of the ImageData and adds 3 new datasets X/Y/ZCoordinates to represent the spacing.

@hakostra @danlipsa @mwestphal @Louis_Gombert @cory.quammen wdyt?

Looks very good.

Looks good :slight_smile:

Thanks @jpmorr, great initiative. I believe these data types are indeed needed for VTKHDF to succeed.

As just mentioned in the GitLab issue already, I believe it would make sense to follow the file structure of the XML format and put the coordinate information into a “Coordinates” group?

From all I can tell, that’s what has been done for the other data types as well.

By that logic, the “Points” dataset should also be put into a “Points” group - this seems redundant but consistent.

@lgivord @Louis_Gombert wdyt ?

@awehrfritz VTKHDF does not follow 1:1 the VTK XML hierarchy all the time, we can have slight differences, but we generally make sure that arrays contain the same information. So I’m fine with both solutions.

In any case, I’m glad that RectiGrid VTKHDF is getting some attention again. This would not be a huge effort to implement support for it, we’re open to funding opportunities.

I’m thinking about it just now, but I would prefer using @lgivord ‘s suggestion of X/Y/ZCoordinates datasets instead of a Coordinates group, because HyperTreeGrid already uses this convention. See VTKHDF format specification - VTK documentation

1 Like