[Paraview] Writing XML VTK Binary files from C++

Stegmeier, Nicholas Nicholas.Stegmeier at sdstate.edu
Thu Nov 30 12:00:13 EST 2017


Hello,


I am new to Paraview and C++ coming from a mostly mathematics background. I am emailing to get resources or help on writing binary XML VTK files from C++.


I have finally succeeded in using the ASCII XML VTK format for a 2D rectilinear CFD application. My ".pvtr" file is shown below.


How can I write this file and my other XML VTK files in binary from C++? Do I need a special C++ library?


filename: PVTK0000.pvtr


contents:


<?xml version="1.0"?>
<VTKFile type="PRectilinearGrid" version="0.1" byte_order="LittleEndian">
<PRectilinearGrid WholeExtent="1 20 1 20 0 0" GhostLevel="1">
<PPointData Scalars="flow data">
<PDataArray type="Float32" Name="rho" format="ascii"/>
<PDataArray type="Float32" Name="u" format="ascii"/>
<PDataArray type="Float32" Name="v" format="ascii"/>
<PDataArray type="Float32" Name="uxN" format="ascii"/>
<PDataArray type="Float32" Name="vyN" format="ascii"/>
</PPointData>
<PCoordinates>
<PDataArray type="Float32" Name="x" format="ascii"/>
<PDataArray type="Float32" Name="y" format="ascii"/>
<PDataArray type="Float32" Name="z" format="ascii"/>
</PCoordinates>
<Piece Extent="0 21 0 21 0 0" Source="YY0000_0000.vtr"/>
</PRectilinearGrid>
</VTKFile>

Thank you,
Nicholas Stegmeier


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171130/82a2e471/attachment.html>


More information about the ParaView mailing list