[Paraview] File format for reading binary data in parallel

Brad King brad.king at kitware.com
Wed Sep 14 13:39:21 EDT 2005


suzu at kg.candypop.jp wrote:
> At first I think so and tried to read .vts file which contains raw binary data ,
> but I failed to read.
> Should I specify some special options for AppendedData tag or VTKFile tag ? 
[snip]
>       <PointData Scalars="pressure">
>         <DataArray type="Float32" Name="pressure" format="appended" offset="0"         />
>       </PointData>
[snip]
>   <AppendedData>
> _.............(this is raw binary data: 96bytes )...............................
>   </AppendedData>

You should add the attribute

  byte_order="LittleEndian"

to the VTKData at the top.  If your binary data is in big endian order
then instead add

  byte_order="BigEndian"

The format for raw appended binary data should be

<AppendedData encoding="raw">
  _NNNN...........................
</AppendedData>

Where the underscore is literal (as you already have) and the NNNN is a
four-byte block containing an unsigned 32-bit count of the number of
"words" in the array.  A word is one value of the type of the array, so
in your case the NNNN would have the number of float values.  Then the
number of bytes of binary data to follow should be NNNN*sizeof(float).

If you have another appended data array in the same file then start it
immediately after the end of the first array (with no newline or any
other character.  Then specify in the offset="..." attribute for the
corresponding DataArray the number of bytes beyond the underscore where
the second array begins.

-Brad


More information about the ParaView mailing list