PHyperTreeGrid

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,

<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

<?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

<?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.

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:

FYI @Lucas_Givord @Louis_Gombert

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?