<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi!<br>I惴 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. <br>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愒 get the Xdmf-API to work, I writing the .xmf-file "manually" with a program and the .h5-files with the HDF5-API. <br>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)? <br>This is as I have it now:<br><br>The coordinate file, which has (in this case) the dimensions 350 140 1. <br>I write the coordinates in the following array:<br>float* Coordinates;<br>Coordinates = new float [3*xdims];<br>int j=0; //counter<br><br>//write xCoord to array<br>for(i=0;i&lt;xdims;i=i+3) <br>&nbsp;&nbsp;&nbsp; {Coordinates[i] = xPoints[j];<br>&nbsp;&nbsp;&nbsp; &nbsp;j++;<br>&nbsp;&nbsp;&nbsp; }<br>//write yCoord to array<br>j=0;<br>for(i=1;i&lt;xdims;i=i+3) <br>&nbsp;&nbsp;&nbsp; {Coordinates[i] = yPoints[j];<br>&nbsp;&nbsp;&nbsp; &nbsp;j++;<br>&nbsp;&nbsp;&nbsp; }<br>//write zCoord to array<br>for(i=2;i&lt;xdims;i=i+3) <br>&nbsp;&nbsp;&nbsp; {Coordinates[i] = 0.0;<br>&nbsp;&nbsp;&nbsp; }<br><br>This array obviously has rank 1, so I write the .h5 file with the following parameters:<br><br>file = H5Fcreate(H5FileName.c_str(), H5F_ACC_TRUNC , H5P_DEFAULT, H5P_DEFAULT);<br>dataspace = H5Screate_simple(1, dims, NULL);<br>datatype = H5Tcopy(H5T_NATIVE_FLOAT);<br>status = H5Tset_order(datatype,H5T_ORDER_LE);<br>dataset = H5Dcreate2(file,DATASETNAME1,datatype,dataspace,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);<br>status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, Coordinates);<br><br><br>The attribute data files I write analogue. <br><br>My .xmf file looks like this:<br>&lt;?xml version="1.0" ?&gt;<br>&lt;!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []&gt;<br><br>&lt;Xdmf&gt;<br>&lt;Domain&gt;<br>&lt;Grid Name="Curvilinear" GridType="Uniform"&gt;<br>&lt;Topology TopologyType="3DSMesh" Dimensions ="350 140 1"&gt;<br>&lt;/Topology&gt;&lt;Geometry GeometryType="XYZ"&gt;<br>&lt;DataItem DataType="Float" Precision="4" Dimensions="350 140 1"&nbsp; Format="HDF"&gt;<br>C:\Dokumente und Einstellungen\User1\Eigene Dateien\xdmf_files\c1d-T132-30SEPT-deep_coord_00000.h5/Curvilinear/XYZ<br>&lt;/DataItem&gt;<br>&lt;/Geometry&gt;<br>&lt;Attribute Name="Density" Active="1" Type="Scalar" Center="Node"&gt;<br>&lt;DataItem DataType="Float" Precision="4" Dimensions="350 140 1" Format="HDF"&gt;<br>C:\Dokumente und Einstellungen\User1\Eigene Dateien\xdmf_files\c1d-T132-30SEPT-deep.p_00000.h5:/Curvilinear/Density<br>&lt;/DataItem&gt;<br>&lt;/Attribute&gt;<br>&lt;/Grid&gt;<br>&lt;/Domain&gt;<br>&lt;/Xdmf&gt;<br><br>Any help would be appreciated!<br>Thx,<br>NH<br><br><br><br><br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>