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.