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 paraview/paraview#21711).
The original file as well as the modified file are appended.
* [randomHTG-pv511_unmodified.htg](/uploads/9b545319fc63d006f3f54bf6558c5b54/randomHTG-pv511_unmodified.htg)
* [randomHTG-pv511_modified.htg](/uploads/08dd2e9d7acf0eb9738b5549aa73274f/randomHTG-pv511_modified.htg)
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 formula `Depth*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 of `Depth`)
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 the `Depth` 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.
issue