[Paraview] problems with Xdmf-file

Jerry Clarke clarke at arl.army.mil
Wed Oct 15 09:03:26 EDT 2008


Natalie,

It might be that :
	1. Your dimensions should be "1 140 350" (KJI) not "350 140 1"
	dimensions are listed with the slowest changing dimension first.
	We will be adding a flag to the XML to allow for this later.

	2. If you are using GeometryType="XYZ" then there are 3
	values for each node. So your DataItem dimensions should
	be "1 140 350 3".

If your first dimension is always going to be "1" then you might want to
use 2DSMesh instead.

Here is an example of a 3DSMesh of a single plane. 3 rows of 4 columns.


<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf xmlns:xi="http://www.w3.org/2003/XInclude" Version="2.0">
   <Domain>
     <Grid Name="Single Plane Structured Grid" GridType="Uniform">
       <Topology TopologyType="3DSMesh" Dimensions="1 3 4"/>
       <Geometry GeometryType="XYZ">
         <DataItem Dimensions="1 3 4 3" NumberType="Float" Precision="4" 
Format="XML">
             0.0 0.0 0.0
             1.0 0.0 0.0
             2.0 0.0 0.0
             3.0 0.0 0.0

             0.0 1.0 0.0
             1.0 1.0 0.0
             2.0 1.0 0.0
             3.0 1.0 0.0

             0.0 2.0 0.0
             1.0 2.0 0.0
             2.0 2.0 0.0
             3.0 2.0 0.0
         </DataItem>
       </Geometry>
       <Attribute Name="Pressure" AttributeType="Scalar" Center="Node">
         <DataItem Dimensions="1 3 4" NumberType="Float" Precision="4" 
Format="XML">
         1 2 3 4 5 6
         6 5 4 3 2 1
         </DataItem>
       </Attribute>
     </Grid>
   </Domain>
</Xdmf>


Jerry


Natalie Happenhofer wrote:
> Hi!
> I´m trying to write my data in the xdmf-format and read it in paraview. 
> I have a 3D - curvilinear grid, i.e. I have to specify every point with 
> its coordinates and then I have scalar attribute data, to be assigned to 
> each node.
> The .xmf meta-data file is recognised by paraview and works fine, but 
> when I click the "Apply"- button, paraview crashes. I believe that I get 
> the .h5 files wrong, when I write them (as I don´t get the Xdmf-API to 
> work, I writing the .xmf-file "manually" with a program and the 
> .h5-files with the HDF5-API.
> Does anyone know how to set the parameters for writing the correct 
> .h5-file (Rank, and the shape of the array which is written to the file)?
> This is as I have it now:
> 
> The coordinate file, which has (in this case) the dimensions 350 140 1.
> I write the coordinates in the following array:
> float* Coordinates;
> Coordinates = new float [3*xdims];
> int j=0; //counter
> 
> //write xCoord to array
> for(i=0;i<xdims;i=i+3)
>     {Coordinates[i] = xPoints[j];
>      j++;
>     }
> //write yCoord to array
> j=0;
> for(i=1;i<xdims;i=i+3)
>     {Coordinates[i] = yPoints[j];
>      j++;
>     }
> //write zCoord to array
> for(i=2;i<xdims;i=i+3)
>     {Coordinates[i] = 0.0;
>     }
> 
> This array obviously has rank 1, so I write the .h5 file with the 
> following parameters:
> 
> file = H5Fcreate(H5FileName.c_str(), H5F_ACC_TRUNC , H5P_DEFAULT, 
> H5P_DEFAULT);
> dataspace = H5Screate_simple(1, dims, NULL);
> datatype = H5Tcopy(H5T_NATIVE_FLOAT);
> status = H5Tset_order(datatype,H5T_ORDER_LE);
> dataset = 
> H5Dcreate2(file,DATASETNAME1,datatype,dataspace,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
> status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, 
> H5P_DEFAULT, Coordinates);
> 
> 
> The attribute data files I write analogue.
> 
> My .xmf file looks like this:
> <?xml version="1.0" ?>
> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
> 
> <Xdmf>
> <Domain>
> <Grid Name="Curvilinear" GridType="Uniform">
> <Topology TopologyType="3DSMesh" Dimensions ="350 140 1">
> </Topology><Geometry GeometryType="XYZ">
> <DataItem DataType="Float" Precision="4" Dimensions="350 140 1"  
> Format="HDF">
> C:\Dokumente und Einstellungen\User1\Eigene 
> Dateien\xdmf_files\c1d-T132-30SEPT-deep_coord_00000.h5/Curvilinear/XYZ
> </DataItem>
> </Geometry>
> <Attribute Name="Density" Active="1" Type="Scalar" Center="Node">
> <DataItem DataType="Float" Precision="4" Dimensions="350 140 1" 
> Format="HDF">
> C:\Dokumente und Einstellungen\User1\Eigene 
> Dateien\xdmf_files\c1d-T132-30SEPT-deep.p_00000.h5:/Curvilinear/Density
> </DataItem>
> </Attribute>
> </Grid>
> </Domain>
> </Xdmf>
> 
> Any help would be appreciated!
> Thx,
> NH
> 
> 
> 
> 
> ------------------------------------------------------------------------
> Express yourself instantly with MSN Messenger! MSN Messenger 
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list