Example of vtkhdf with PartitionedDataSetCollection and Asembly

Hello,
can anyone provide simple vtkhdf input file that illustrates how to encode properly model using PartitionedDataSetCollection and Asemblies?

Thank you,
Borek

Hello, here is the file we use for testing purposes in VTK: test_composite.hdf (27.1 KB)

It is a simple assembly where you have 2 partitioned datasets, one PolyData (Block0) and one unstructured grid (Block1).

In the hierarchy, you have blockName0 which is linked to the dataset Block0, blockName2 which is linked to dataset Block1, and a subgroup groupName0 which contains blockName1, linked again to Block1. PartitionedDataSetCollection is made so that one dataset can be referenced multiple times. Also note that datasets have an Index attribute, and the link creation order in the hierarchy should be tracked.

Let me know if you have any questions.

Similar issue - the composite file is not recognized by ParaView on import (A reader … could not be found):
multitest.vtkhdf (297.3 KB)

Common issues which have been checked:

  • Link creation order is tracked for Assembly group
  • “Type” attribute has ASCII charset
  • Dataset groups have “Index” attribute set

I have checked the structure and datatypes versus the test_composite.hdf posted above and it seems to be consistent. However, the test_composite.hdf file opens without issues.

I cannot see any other sources of the problem now. Can someone else have a look at it, please? Also, is there any option how to track/debug the loading process (and pinpoint the source of failure)?

Thanks!

Hello @habakuk , we currently only handle fixed-length strings for the “Type” attribute.

You can easily fix it from a h5py script:

import h5py as h5

f = h5.File('multitest.vtkhdf', 'r+')

ascii_type = 'PartitionedDataSetCollection'.encode('ascii')
f["VTKHDF"].attrs.pop('Type')
f["VTKHDF"].attrs.create('Type', ascii_type, dtype=h5.string_dtype('ascii', len(ascii_type))) 

f.close()

now the file opens correctly in ParaView.

That’s something we should fix in the reader…

Thanks, that fixed the issue.

I did not thought of it (although I was aware of this difference), since it matters only for the composite datasets. The Type of individual block can have variable length, and same for the single-dataset file (i.e. no Assembly and VTKHDF[“Type”] = “UnstructuredGrid”), which I have successfully tested before.

This was indeed a bug in ParaView, which I’m fixing here: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12158

The fix will be available in ParaView 6.0.