[Paraview] Including multiple XML files for a single piece

Lukas van de Wiel lukas.drinkt.thee at gmail.com
Thu Mar 27 06:55:32 EDT 2014


Dear more experienced user,

to split up very large piece files, we try to split them into various
smaller files. One for each property. Then I try to include them using
xinclude. However, that does not work and the documentation I have found
about similar cases only include specific issues with parallel data.

As such, I wonder whether anybody has ever stumbled across this before. Let
me try the concept on a very simple example of a cube from the VTK-file
formats standard documentation, containing two files:


cube.vtk:

<?xml version="1.0"?>
<VTKFile type="PPolyData" version="0.1" byte_order="LittleEndian">
    <PPolyData GhostLevel="0">
        <PPointData Scalars="my_scalars">
            <PDataArray type="Float32" Name="my_scalars"/>
        </PPointData>
        <PCellData Scalars="cell_scalars" Normals="cell_normals">
            <PDataArray type="Int32" Name="cell_scalars"/>
            <PDataArray type="Float32" Name="cell_normals"
NumberOfComponents="3"/>
        </PCellData>
        <PPoints>
            <PDataArray type="Float32" NumberOfComponents="3"/>
        </PPoints>
        <Piece Source="polyEx0.vtp"/>
    </PPolyData>
</VTKFile>

and the piece file, polyEx0.vtp:


<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian">
    <PolyData>
        <Piece NumberOfPoints="8" NumberOfVerts="0" NumberOfLines="0"
NumberOfStrips="0" NumberOfPolys="6">
            <Points>
                <DataArray type="Float32" NumberOfComponents="3"
format="ascii">
                    0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1
                </DataArray>
            </Points>
            <PointData Scalars="my_scalars">
                <DataArray type="Float32" Name="my_scalars" format="ascii">
                    0 1 2 3 4 5 6 7
                </DataArray>
            </PointData>
            <CellData Scalars="cell_scalars" Normals="cell_normals">
                <DataArray type="Int32" Name="cell_scalars" format="ascii">
                    0 1 2 3 4 5
                </DataArray>
                <DataArray type="Float32" Name="cell_normals"
NumberOfComponents="3" format="ascii">
                    0 0 1 0 0 1 0 -1 0 0 1 0 -1 0 0 1 0 0
                </DataArray>
            </CellData>
            <Polys>
                <DataArray type="Int32" Name="connectivity" format="ascii">
                    0 1 2 3 4 5 6 7 0 1 5 4 2 3 7 6 0 4 7 3 1 2 6 5
                </DataArray>
                <DataArray type="Int32" Name="offsets" format="ascii">
                    4 8 12 16 20 24
                </DataArray>
            </Polys>
        </Piece>
    </PolyData>
</VTKFile>



So now I want to get the coordinates of the vertices out in a separate file:

coordinates.xml:

<DataArray type="Float32" NumberOfComponents="3" format="ascii">
     0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1
</DataArray>


leaving the <points> tag in the piece main file, to indicate what the
included file contains. To the best of my knowledge, the header polyEx0.vtp
would now gain a term to tell that there are included files:

<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian"
xmlns:xi="http:www.w3.org/2001/XInclude">

and a line to include the xml file containing the coordinates, in stead of
the actual coordinates, to get:


<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian"
xmlns:xi="http:www.w3.org/2001/XInclude">
    <PolyData>
        <Piece NumberOfPoints="8" NumberOfVerts="0" NumberOfLines="0"
NumberOfStrips="0" NumberOfPolys="6">
            <Points>
               <xi:include href="coordinates.xml"/>
            </Points>
            <PointData Scalars="my_scalars">
                <DataArray type="Float32" Name="my_scalars" format="ascii">
                    0 1 2 3 4 5 6 7
                </DataArray>
            </PointData>
            <CellData Scalars="cell_scalars" Normals="cell_normals">
                <DataArray type="Int32" Name="cell_scalars" format="ascii">
                    0 1 2 3 4 5
                </DataArray>
                <DataArray type="Float32" Name="cell_normals"
NumberOfComponents="3" format="ascii">
                    0 0 1 0 0 1 0 -1 0 0 1 0 -1 0 0 1 0 0
                </DataArray>
            </CellData>
            <Polys>
                <DataArray type="Int32" Name="connectivity" format="ascii">
                    0 1 2 3 4 5 6 7 0 1 5 4 2 3 7 6 0 4 7 3 1 2 6 5
                </DataArray>
                <DataArray type="Int32" Name="offsets" format="ascii">
                    4 8 12 16 20 24
                </DataArray>
            </Polys>
        </Piece>
    </PolyData>
</VTKFile>

However, if I open this in ParaView, I get the error:

  ERROR: In
/home/utkarsh/Kitware/superbuild/paraview/src/paraview/VTK/Common/vtkXMLDataElement.cxx,
line 791

vtkXMLDataElement (0x171fab0): Missing word type attribute "type".

Because 'type' is now in the included XML file, it is apparently not
correctly included (of it would not be missing).

Could anybody point out what I have been doing wrong?

Thank you very much for you time and expertise!

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140327/b8ddf754/attachment.html>


More information about the ParaView mailing list