I’m trying to create a VTKHDF file that has multiple blocks in it but I’ve not managed to do so yet. My initial question was here where I was pointed towards the documentation and given a working example file. Rather than re-opening that discussion I’m creating this as a new troubleshooting thread.
I’ve been testing things this morning but despite following the structure in the provided example from that thread, I cannot get my version to load in Paraview.
When I try to open my version Paraview just immediately crashes without displaying any warnings, just closes. I can’t see anything immediately wrong like the missing Index that I previously had so I guess I must be doing something else incorrect.
I’m using Paraview 5.13 which I just installed last week and seems to be ok for everything else. I’m writing my files from a python code using h5py. Normal VTKHDF files written with h5py are displayed without issue.
The Assembly group and its children need to track creation order to be able to keep subtrees ordered. For this, you need to set H5G properties H5P_CRT_ORDER_TRACKED and H5P_CRT_ORDER_INDEXED on each group when writing the Assembly.
if you check your data you’ll see that you miss for VTKHDF, Assembly and Assembly’s subgroups this tag:
With h5py, when creating a new group you can enforce this tag like this:
import h5py as h5
f = h5.File('your_data.vtkhdf', 'w')
# VTKHDF, Assembly need to be tagged with the track_order
root = f.create_group('VTKHDF', track_order=True)
assembly = root.create_group('Assembly', track_order=True)
@lgivord Thanks for checking this. I thought it might be something like that but I’m now a little confused. In the test file that works, the creation order is not tracked, as you can see from the screenshot below.
I’m going to try re-writing my files with the creation order tracked (will report back shortly). In this case, I presume the Index needs to match the creation order?
My main problem was that I was not tracking the order for the root as in your code: root = f.create_group('VTKHDF', track_order=True) but I was also attempting to track creation order for the block data which may have been the cause.
I also see the difference between Attribute creation order and Link creation order now.