RES: [Paraview] VTK formats and Fortran (again...)
Kent Eschenberg
eschenbe at psc.edu
Fri Apr 13 11:17:38 EDT 2007
Renato N. Elias wrote:
> However, there is no further information regarding such form of writing raw
> binary data in "XML files" for VTK and PV. I'll try to write a file with raw
> binary data in the AppendedData section to see what happen.
I worked with one of our users to modify their C program to directly write VTK
XML-style files without using any VTK libraries. Its really not that hard and
the format is well documented except for a detail or two. A single run of that
application could generate over 100,000 of these VTK files, organized using a
ParaView pvd file.
The "raw" binary format means just the machine's natural binary (that's what we
used). The upside is that its as fast and compact as is possible. The downside
is that the file will be unreadable on a machine that uses a different binary
format. The XMl file supports a flag to indicate little-endian vs big-endian
but you might be out of luck if there are other binary differences.
One of the details missing from the documentation (hello Kitware) is that the
raw binary section must start with "length", a binary 32-bit integer that is
the size of the following array of binary data:
length = N * sizeof(type)
where N is the number of elements in the array and type is the type of data
(int, short, float, double, ...).
Kent
Pittsburgh Supercomputing Center
More information about the ParaView
mailing list