HyperTreeGrid HTG Writer produces broken htg in appended mode after calculator
The HyperTreeGrid writer produces broken files with more than one array. The files are fixable but the HyperTreeGrid reader has another issue when reading files of HTG version 2.0 files (see this issue #21711).
The original file as well as the modified file are appended.
Steps to reproduce a broken HTG (using Paraview v5.11.0)
- Create random HyperTreeGrid Source (
Source -> Alphabetical -> HyperTreeGrid (Random)
) - Add a new vector array using the
Calculator
and formulaDepth*iHat
) - Save the calculator with
CTRL+S
to a*.htg
file in appended mode without compression - Try open this file (it will fail)
Inspecting the file with VIM reveals three errors
- The header of the file is partially overwritten (
RangeMax="5"02"yperTreeGrid" version="2.0" ...
) - The array
Depth
has empty offset - The array
Result
has the wrong offset (in fact the offset ofDepth
)
This errors are fixable by hand
- Reconstruct the file header with
<VTKFile type="HyperTreeGrid" version="2.0" byte_order="LittleEndian" header_type="UInt32">
- Move the offset of the
Result
array to theDepth
array - Calculate
Result
offset by hand (4 Byte (HeaderSize) + 65354*8 Byte (depth array size) + 4166 Byte (depth array offset) = 527002 Byte
)
This file can be opened by Paraview without problems.
Edited by maximilian-tech