# vtkMultiBlockDataSet equivalent for VTKHDF files

**URL:** https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369
**Category:** Support
**Tags:** file-formats
**Created:** [August 8, 2024, 11:05am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369 "2024-08-08T11:05:16Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 8, 2024, 11:05am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/1 "2024-08-08T11:05:16Z")

</div>

I’m using .`vtm` files to handle results from simulations where singe timestep output comes in several file formats (`.vtp`, `.vtu` and sometimes `.vti`). Gathering all of the data in a `.vtm` file makes loading into Paraview very easy, particularly with the `MultiBlockInspector` and if you have multiple meshes in various groups, like the simplified example below.

```auto
<VTKFile type="vtkMultiBlockDataSet" version="1.0" byte_order="LittleEndian">
  <vtkMultiBlockDataSet>
    <Block index="0" name="Base">
      <Piece index="0">
        <DataSet index="0" file="cube_base.vtp"/>
      </Piece>
    </Block>
    <Block index="1" name="Sides">
      <Piece index="0">
        <DataSet index="0" file="cube_back.vtp"/>
      </Piece>
      <Piece index="1">
        <DataSet index="1" file="cube_left.vtp"/>
      </Piece>
      <Piece index="2">
        <DataSet index="2" file="cube_right.vtp"/>
      </Piece>
      <Piece index="3">
        <DataSet index="3" file="cube_front.vtp"/>
      </Piece>
    </Block>
    <Block index="2" name="Top">
      <Piece index="0">
        <DataSet index="0" file="cube_top.vtp"/>
      </Piece>
    </Block>
  </vtkMultiBlockDataSet>
</VTKFile>

```

I’ve been trying to switch to **VTKHDF** recently but I haven’t quite figured out how to replicate this functionality in the `VTKHDF` format. It doesn’t seem possible to be able to add multiple blocks to a single `VTKHDF` file, which I thought would have been the easiest way. There also doesn’t seem to be support for a multiblock index file like the `vtm` file.

I’m aware there is some discussion on supporting [multiple files for transient data](https://discourse.vtk.org/t/vtkhdf-proposal-support-splitting-datasets-in-multiple-files/13797/15) which I would really like to see as all my temporal data files are large and it doesn’t make sense to have HDF5 files that are tens or hundreds of GB in size when the could easily be split - would the ability to do multiple blocks / meshes for a single datasets be possible this way?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 8, 2024, 11:34am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/2 "2024-08-08T11:34:24Z")

</div>

> [@jpmorr](#):
>
> It doesn’t seem possible to be able to add multiple blocks to a single `VTKHDF` file, which I thought would have been the easiest way. There also doesn’t seem to be support for a multiblock index file like the `vtm` file.

It is supported.

[https://docs.vtk.org/en/latest/design\_documents/VTKFileFormats.html#partitioneddatasetcollection-and-multiblockdataset](https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#partitioneddatasetcollection-and-multiblockdataset)

FYI @lgivord @Louis_Gombert

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 8, 2024, 11:43am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/3 "2024-08-08T11:43:13Z")

</div>

Thanks. I completely missed that section.

Quick question - it says each block should describe a valid VTKHDF root - does that mean that each block for `PolyData` would follow the layout described here:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/b/b7157cb25b28bf44ab655e86f22875406f49901f.png)

Also is there an example file for vtkPartitionedDataSetCollection (PDC) and vtkMultiBlockDataSet (MB) that can be downloaded so that i can better understand?

---

<div class="post-metadata">

### Author: ![lgivord](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lgivord/32/3543_2.png) [@lgivord](https://discourse.vtk.org/u/lgivord)
#### Post date: [August 9, 2024, 8:43am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/4 "2024-08-09T08:43:10Z")

</div>

hello @jpmorr,

> Quick question - it says each block should describe a valid VTKHDF root - does that mean that each block for `PolyData` would follow the layout described here:

yes

> Also is there an example file for vtkPartitionedDataSetCollection (PDC) and vtkMultiBlockDataSet (MB) that can be downloaded so that i can better understand?

you can check the data used for testing it in VTK

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 9, 2024, 3:44pm UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/5 "2024-08-09T15:44:01Z")

</div>

@lgivord Thanks. I had a look at downloading some example files that I found [here](https://gitlab.kitware.com/vtk/vtk/-/tree/master/Testing/Data/vtkHDF?ref_type=heads) but it’s just a load of `sha` files.

Where are the actual `VTKHDF` files stored?

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 11, 2024, 4:12pm UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/6 "2024-08-11T16:12:00Z")

</div>

I’ve still not figured out how to download the test data files from gitlab but i@ve tried to write a`vtkPartitionedDataSetCollection` without being able to check against an example. While I think I’ve got the format correct, paraview is not able to load it with an error saying no valid files found.

Here’s my file (which is just 4 random polydata blocks): [hdf\_multiblock\_test.vtkhdf](https://discourse.vtk.org/uploads/short-url/vZvm3wpEnadaPiORqNQMyKN64K8.vtkhdf) (2.4 MB)

Maybe someone could have a look at it and point out what I’ve got wrong - I assume it’s the assembly part.

---

<div class="post-metadata">

### Author: ![lgivord](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lgivord/32/3543_2.png) [@lgivord](https://discourse.vtk.org/u/lgivord)
#### Post date: [August 12, 2024, 6:16am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/7 "2024-08-12T06:16:28Z")

</div>

> I’ve still not figured out how to download the test data files from gitlab

From the website we can download the .sha512 indeed, if we want directly the data it should be somewhere here I believe: [https://www.paraview.org/files/](https://www.paraview.org/files/), @mwestphal any inputs?

In your case, I attach the data here :  
[test\_composite.hdf](https://discourse.vtk.org/uploads/short-url/nYXOSl4dALeKJq2iRQRxJSHdKw1.hdf) (27.1 KB)

> paraview is not able to load it with an error saying no valid files found.

that’s not the error that I have, which version of paraview do you use? On master, I have this issue:

```auto
ERROR: In vtkHDFUtilities.txx, line 162
(nullptr): Index attribute not found

```

The overall structure of your file is correct however you miss the `Index` attribute for the assembly, you can refer to the second paragraph for more details : [VTK File Formats - VTK documentation](https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#partitioneddatasetcollection-and-multiblockdataset)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 12, 2024, 8:47am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/8 "2024-08-12T08:47:45Z")

</div>

> [@lgivord](#):
>
> From the website we can download the .sha512 indeed, if we want directly the data it should be somewhere here I believe: [https://www.paraview.org/files/](https://www.paraview.org/files/), @mwestphal any inputs?

```auto
sha=`cat VTK/path/to/file.ext.sha512`
wget https://www.vtk.org/files/ExternalData/SHA512/$sha -O file.ext

```

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 12, 2024, 2:24pm UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/9 "2024-08-12T14:24:05Z")

</div>

Thanks. I completely missed that index attribute when I was reading.

Can I ask why the `index` attributes is required, since the assembly data is linked to the block data in hdf5 file?

Also, is the `index` somewhat arbitrary? Does it matter if the assembly order of the blocks does not match the block index?

---

<div class="post-metadata">

### Author: ![lgivord](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lgivord/32/3543_2.png) [@lgivord](https://discourse.vtk.org/u/lgivord)
#### Post date: [August 12, 2024, 2:44pm UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/10 "2024-08-12T14:44:31Z")

</div>

> Can I ask why the `index` attributes is required, since the assembly data is linked to the block data in hdf5 file?

It’s link to how the vtkPartitionedDataSetCollection works in VTK, as multiple leafs can point to the same dataset, PDC needs a flat structure and this is the purpose of this Index.

> Also, is the `index` somewhat arbitrary?

each index should be unique, I don’t think there is another limitation

> Does it matter if the assembly order of the blocks does not match the block index?

It doesn’t matter 🙂

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jpmorr/32/8944_2.png) [@jpmorr](https://discourse.vtk.org/u/jpmorr)
#### Post date: [August 12, 2024, 5:28pm UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/11 "2024-08-12T17:28:59Z")

</div>

Thanks!!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [August 13, 2024, 1:01am UTC](https://discourse.vtk.org/t/vtkmultiblockdataset-equivalent-for-vtkhdf-files/14369/12 "2024-08-13T01:01:14Z")

</div>

You can also grab all data files from [https://www.vtk.org/files/release/9.3/VTKDataFiles-9.3.1.tar.gz](https://www.vtk.org/files/release/9.3/VTKDataFiles-9.3.1.tar.gz). It’s organized into the same directory structure as VTK, so finding data in it should be easy.
