[Paraview] pvtr file format

Felix Wolfheimer wolfheimer at temf.tu-darmstadt.de
Wed Mar 30 02:05:35 EST 2005


Thank you for your suggestion. Unfortunately ParaView doesn't display 
the dataset correct even when I change the files as you suggested. Apart 
from that I don't understand, how this should work. When I specify two 
pieces one with the extend "1 2 1 2 1 2" and the other with extend "2 3 
1 2 1 2" it seems to me as if the point with index 2 in x-direction is 
duplicated. In which datafile should the point data for this point be or 
should both datafiles contain the data for this point? It would be 
great, if you would have any additional suggestion how to make ParaView 
read and display the data correctly (or even better: a working pvtr 
example file to learn how to create such a data file correctly). I 
append the modified small example files to this text. By the way: 
ParaView doesn't show a error message, when it reads the files (with and 
without the changes)

Thanks in advance

Felix

PS: I'm using ParaView 2.0.0.
==================================================================================
This is the pvtr file:
----------------------------------------------------------------------------------------------------------------------------
<VTKFile type="PRectilinearGrid">
<PRectilinearGrid WholeExtent="1 3 1 2 1 2" GhostLevel="0">
<PPointData>
  <PDataArray type="Float32" Name="Field" NumberOfComponents="3"/>
</PPointData>
<PCellData></PCellData>
<PCoordinates>
  <PDataArray type="Float32" Name="X_COORDINATES" NumberOfComponents="1"/>
  <PDataArray type="Float32" Name="Y_COORDINATES" NumberOfComponents="1"/>
  <PDataArray type="Float32" Name="Z_COORDINATES" NumberOfComponents="1"/>
</PCoordinates>
<Piece Extent="1 2 1 2 1 2" Source="test0.vtr"/>
<Piece Extent="2 3 1 2 1 2" Source="test1.vtr"/>
</PRectilinearGrid>
</VTKFile>
===================================================================================
This is the first datafile:(test0.vtr)
-----------------------------------------------------------------------------------------------------------------------------
<VTKFile type="RectilinearGrid" version="0.1">
<RectilinearGrid WholeExtent="1 3 1 2 1 2">
<Piece Extent="1 2 1 2 1 2">
<PointData Vectors="Field">
<DataArray type="Float32" Name="Field" NumberOfComponents="3" 
format="ascii">
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
  1.000000E+000 0.000000E+000 0.000000E+000
</DataArray>
</PointData>
<CellData></CellData>
<Coordinates>
<DataArray type="Float32" Name="X_COORDINATES" NumberOfComponents="1" 
format="ascii">
  1.000000E+000
  2.000000E+000
</DataArray>
<DataArray type="Float32" Name="Y_COORDINATES" NumberOfComponents="1" 
format="ascii">
  1.000000E+000
  2.000000E+000
</DataArray>
<DataArray type="Float32" Name="Z_COORDINATES" NumberOfComponents="1" 
format="ascii">
  1.000000E+000
  2.000000E+000
</DataArray>
</Coordinates>
</Piece>
</RectilinearGrid>
</VTKFile>
===================================================================================
This is the second datafile (test1.vtr)
------------------------------------------------------------------------------------------------------------------------------
<VTKFile type="RectilinearGrid">
<RectilinearGrid WholeExtent="1 3 1 2 1 2">
<Piece Extent="2 3 1 2 1 2">
<PointData>
<DataArray type="Float32" Name="Field" NumberOfComponents="3" 
format="ascii">
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
  0.000000E+000 1.000000E+000 0.000000E+000
</DataArray>
</PointData>
<CellData></CellData>
<Coordinates>
<DataArray type="Float32" Name="X_COORDINATES" NumberOfComponents="1" 
format="ascii">
  3.000000E+000
  4.000000E+000
</DataArray>
<DataArray type="Float32" Name="Y_COORDINATES" NumberOfComponents="1" 
format="ascii">
  1.000000E+000
  2.000000E+000
</DataArray>
<DataArray type="Float32" Name="Z_COORDINATES" NumberOfComponents="1" 
format="ascii">
  1.000000E+000
  2.000000E+000
</DataArray>
</Coordinates>
</Piece>
</RectilinearGrid>
</VTKFile>
======================================================================================


Brad King schrieb:

> Felix Wolfheimer wrote:
>
>> I'm trying to use the .pvtr file format to visualize a vector field 
>> associated to a rectilinear grid. Unfortunately I get not the 
>> expected result. I have two .vtr files which are connected via a 
>> .pvtr file. I'm trying to visualize the datasets using only one 
>> instance of ParaView. Maybe this is a problem? It seems to me, that 
>> the data from the second vtr file is read and displayed incorrect. I 
>> will provide you a short example to reproduce the problem. The 
>> dataset consists of  a vectorfield distributed on two vtr files. The 
>> values in the first file contains a field pointing only in 
>> x-direction and the second file contains field values pointing only 
>> in y-direction.
>
> [snip]
>
>> <VTKFile type="PRectilinearGrid">
>> <PRectilinearGrid WholeExtent="1 4 1 2 1 2" GhostLevel="0">
>> <PPointData>
>>  <PDataArray type="Float32" Name="Field" NumberOfComponents="3"/>
>> </PPointData>
>> <PCellData></PCellData>
>> <PCoordinates>
>>  <PDataArray type="Float32" Name="X_COORDINATES" 
>> NumberOfComponents="1"/>
>>  <PDataArray type="Float32" Name="Y_COORDINATES" 
>> NumberOfComponents="1"/>
>>  <PDataArray type="Float32" Name="Z_COORDINATES" 
>> NumberOfComponents="1"/>
>> </PCoordinates>
>> <Piece Extent="1 2 1 2 1 2" Source="test0.vtr"/>
>> <Piece Extent="3 4 1 2 1 2" Source="test1.vtr"/>
>
>
> When using multiple pieces like this they must have well-defined 
> boundaries.  The X extent "1 2" means there are two points with a cell 
> between them.  The X extent "3 4" means this also, but shifted over 2 
> units.  Defining the two pieces this way leaves a missing cell between 
> points 2 and 3.  The reader should produce an error message to 
> indicate this.  You need the extents to overlap by one point such as 
> "1 2" and "2 3".
>
> -Brad
>

-- 
================================================================================
Dipl.-Ing. Felix Wolfheimer
Institut für Theorie Elektromagnetischer Felder
Schlossgartenstr.8
64289 Darmstadt
Germany

Tel.: +49 06151/16-2561




More information about the ParaView mailing list