# PHyperTreeGrid

**URL:** https://discourse.paraview.org/t/phypertreegrid/16605
**Category:** ParaView Support
**Created:** [May 10, 2025, 3:00am UTC](https://discourse.paraview.org/t/phypertreegrid/16605 "2025-05-10T03:00:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![colive](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/d07c76/32.png) [@colive](https://discourse.paraview.org/u/colive)
#### Post date: [May 10, 2025, 3:00am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/1 "2025-05-10T03:00:05Z")

</div>

Hi,

I would consider myself familiar with the XML file format for HyperTreeGrids at this point. I also started looking into PHTG format which seems to work quite well, except when I include any fields.

For example,

```auto
<VTKFile type="PHyperTreeGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <PHyperTreeGrid>
    <Piece Source="1.htg"/>
    <Piece Source="2.htg"/>
  </PHyperTreeGrid>
</VTKFile>

```

with 1.htg as

```auto
<?xml version="1.0"?>
<VTKFile type="HyperTreeGrid" version="2.0" byte_order="LittleEndian" header_type="UInt32">
  <HyperTreeGrid BranchFactor="2" TransposedRootIndexing="0" Dimensions="2 2 1">
    <Grid>
      <DataArray type="Float64" Name="XCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="1.0">
        0 1
      </DataArray>
      <DataArray type="Float64" Name="YCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="1.0">
        0 1
      </DataArray>
      <DataArray type="Float64" Name="ZCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="0">
        0
      </DataArray>
    </Grid>
    <Trees>
      <DataArray type="Bit" Name="Descriptors" NumberOfTuples="21" format="ascii" RangeMin="0" RangeMax="1">
        1 
        0 0 1 1 
        0 0 0 0 0 0 1 1 
        0 0 0 0 0 0 0 0 
      </DataArray>
      <DataArray type="Int64" Name="NumberOfVerticesPerDepth" NumberOfTuples="4" format="ascii" RangeMin="1" RangeMax="8">
        1 4 8 8
      </DataArray>
      <DataArray type="Int64" Name="TreeIds" NumberOfTuples="1" format="ascii" RangeMin="0" RangeMax="0">
        0
      </DataArray>
      <DataArray type="UInt32" Name="DepthPerTree" NumberOfTuples="1" format="ascii" RangeMin="4" RangeMax="4">
        4
      </DataArray>
    </Trees>
    <CellData>
      <DataArray type="Float32" Name="s" NumberOfTuples="21" format="ascii" RangeMin="0" RangeMax="1">
        1 
        0 0 1 1 
        0 0 0 0 0 0 1 1 
        0 0 0 0 0 0 0 0 
      </DataArray>
    </CellData>
  </HyperTreeGrid>
</VTKFile>

```

and 2.htg as

```auto
<?xml version="1.0"?>
<VTKFile type="HyperTreeGrid" version="2.0" byte_order="LittleEndian" header_type="UInt32">
  <HyperTreeGrid BranchFactor="2" TransposedRootIndexing="0" Dimensions="2 2 1">
    <Grid>
      <DataArray type="Float64" Name="XCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="1.0">
        0 1
      </DataArray>
      <DataArray type="Float64" Name="YCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="1.0">
        0 1
      </DataArray>
      <DataArray type="Float64" Name="ZCoordinates" NumberOfTuples="2" format="ascii" RangeMin="0" RangeMax="0">
        0
      </DataArray>
    </Grid>
    <Trees>
      <DataArray type="Bit" Name="Descriptors" NumberOfTuples="13" format="ascii" RangeMin="0" RangeMax="1">
        1 
        1 1 0 0 
        0 0 0 0 0 0 0 0
      </DataArray>
      <DataArray type="Int64" Name="NumberOfVerticesPerDepth" NumberOfTuples="3" format="ascii" RangeMin="1" RangeMax="8">
        1 4 8
      </DataArray>
      <DataArray type="Int64" Name="TreeIds" NumberOfTuples="1" format="ascii" RangeMin="0" RangeMax="0">
        0
      </DataArray>
      <DataArray type="UInt32" Name="DepthPerTree" NumberOfTuples="1" format="ascii" RangeMin="3" RangeMax="3">
        3
      </DataArray>
    </Trees>
    <CellData>
      <DataArray type="Float32" Name="s" NumberOfTuples="21" format="ascii" RangeMin="0" RangeMax="1">
        1 
        0 0 1 1 
        0 0 0 0 0 0 1 1 
        0 0 0 0 0 0 0 0 
      </DataArray>
    </CellData>
  </HyperTreeGrid>
</VTKFile>

```

If the `CellData` data arrays are omitted, the .phtg file opens and renders just fine. Both individual pieces also seem to open just fine if not opened as pieces but as separate files. However, it seems that something about having `CellData` in more than one piece causes Paraview to segfault without meaningful data. I’m not sure if I am simply doing something wrong with these XML files or if this is not my fault, since .htg is one of the lesser documented formats, much less the partitioned form.

Anyway, if anyone would happen to have some guidance here, it would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 12, 2025, 8:48am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/2 "2025-05-12T08:48:19Z")

</div>

Hi @colive

I’m afraid the .phtg format is currently non-fonctionnal.

We have been working on improving that situation by adding support for HTG and distributed HTG in the VTKHDF format.

That support was recently merged into VTK!

All info here:

- [HyperTreeGrid support in VTKHDF - #17 by Louis\_Gombert - Development - VTK](https://discourse.vtk.org/t/hypertreegrid-support-in-vtkhdf/15150/17)
- [VTK File Formats - VTK documentation](https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#vtkhdf-file-format)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 12, 2025, 8:48am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/3 "2025-05-12T08:48:31Z")

</div>

FYI @Lucas_Givord @Louis_Gombert

---

<div class="post-metadata">

### Author: ![colive](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/d07c76/32.png) [@colive](https://discourse.paraview.org/u/colive)
#### Post date: [May 12, 2025, 9:00am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/4 "2025-05-12T09:00:17Z")

</div>

Thanks for the links. Good to know it is not working and it’s not just me doing something wrong. I guess I will have to try making a nightly build and test out the HDF reader at some point!

I don’t suppose by the time that it is included in 6.0 that sample files demonstrating the format will be made available in TestingDataFiles?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 12, 2025, 9:28am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/5 "2025-05-12T09:28:33Z")

</div>

> [@colive](#):
>
> that sample files demonstrating the format will be made available in TestingDataFiles?

Testing files are already available in VTK.

---

<div class="post-metadata">

### Author: ![colive](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/d07c76/32.png) [@colive](https://discourse.paraview.org/u/colive)
#### Post date: [May 12, 2025, 10:37am UTC](https://discourse.paraview.org/t/phypertreegrid/16605/6 "2025-05-12T10:37:37Z")

</div>

Ah, I was looking at the version Testing files from the downloads page, but just realized the “nightly” testing files are downloaded when you enable testing in the CMake build.

Thanks again!
