[Paraview] Write binary inline vtu file
Burlen Loring
bloring at lbl.gov
Thu Aug 29 12:20:59 EDT 2013
It looks like you're running afoul of VTK specific terminology. the
designers of the VTK XML file formats have done something confusing.
They called the format that uses base64 encoding(
http://en.wikipedia.org/wiki/Base64) "binary". There's an alternate
format that can use raw binary encoding called "appended" where data
arrays are stored at the end of the file. the "appended" format supports
either base64 or raw binary encoding, while the "binary" format only
supports base64.
This is documented in the file formats guide (
http://www.vtk.org/VTK/img/file-formats.pdf).
With your ascii formatted file you can use ParaView to generate examples
of the other formats. Load your ascii formatted file and then use
File->Save Data to save it as vtu in the desired format. I've done this
to help refresh my memory about this, see the attached.
On 08/29/2013 06:01 AM, Matteo Parsani wrote:
> Dear ParaView users,
> I have succesfully written a ParaView writer to output an unstructured
> grid data set. I am using Fortran 95.
> I am trying now to do exactly the same thing but writing Float64
> binary file.
>
> In attachment tow example of output vtu file. The frist one is ascii
> and I can read it with paraview. The second one is binary and I have
> error when I read it.
>
> Any idea what's the problem?
>
> Thank you.
>
> Best Regards
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130829/b3899fb9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solution_appended.vtu
Type: application/octet-stream
Size: 1238 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130829/b3899fb9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solution_appended_encoded.vtu
Type: text/xml
Size: 1319 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130829/b3899fb9/attachment.bin>
-------------- next part --------------
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="4" NumberOfCells="1">
<PointData>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float64" Name="Points" NumberOfComponents="3" format="binary" RangeMin="1.4142135624" RangeMax="1.4142135624">
YAAAAAAAAAAAAPA/AAAAAAAA8L8AAAAAAAAAAAAAAAAAAPC/AAAAAAAA8L8AAAAAAAAAAAAAAAAAAPC/AAAAAAAA8D8AAAAAAAAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAAAA==
</DataArray>
</Points>
<Cells>
<DataArray type="Int64" Name="connectivity" format="binary" RangeMin="0" RangeMax="3">
IAAAAAAAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAMAAAAAAAAA
</DataArray>
<DataArray type="Int64" Name="offsets" format="binary" RangeMin="4" RangeMax="4">
CAAAAAQAAAAAAAAA
</DataArray>
<DataArray type="UInt8" Name="types" format="binary" RangeMin="9" RangeMax="9">
AQAAAAk=
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
More information about the ParaView
mailing list