[hdf-forum] problems writing the correct .h5-file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[hdf-forum] problems writing the correct .h5-file

Natalie Happenhofer

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! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/attachments/20081013/8c6123c5/attachment.html>

Reply | Threaded
Open this post in threaded view
|

[hdf-forum] XDMF

Andrew Cunningham-2
HDF-users,
Just out of interest , is there much adoption of XDMF in products  
apart from ParaView?
The approach of XML for light-weight data and HDF for heavy-weight  
data is quite an attractive approach.

On Oct 13, 2008, at 1:14 AM, Natalie Happenhofer wrote:

> I?m trying to write my data in the xdmf-format and read it in  
> paraview.

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/attachments/20081013/ecb9c088/attachment.html>

Reply | Threaded
Open this post in threaded view
|

[hdf-forum] XDMF

Ruth Aydt
Administrator
Hi Andrew --

Not a direct answer to your question, but somewhat related.

You may be interested in taking a look at the HDF4 Mapping Prototype  
project we did in conjunction with NASA and National Snow and Ice Data  
Center.

In this project, XML "mapping files" hold the metadata and pointers/
maps to "data values" stored in binary HDF4 files.  While a prototype,  
and with HDF4 (not HDF5), the ideas still apply.

See http://www.hdfgroup.org/projects/hdf4mapping  More details  
available in the HDF4 Mapping Prototype Design paper available from  
the page http://www.hdfgroup.org/projects/hdf4mapping/hdf4mapping_schema.html

XML + HDF seem like a natural fit & there has bee quite a bit of  
interest in this area.  We're hoping to do more as funding for  
projects becomes available.

-Ruth


On Oct 13, 2008, at 11:42 AM, Andrew Cunningham wrote:

> HDF-users,
> Just out of interest , is there much adoption of XDMF in products  
> apart from ParaView?
> The approach of XML for light-weight data and HDF for heavy-weight  
> data is quite an attractive approach.
>
> On Oct 13, 2008, at 1:14 AM, Natalie Happenhofer wrote:
>
>> I?m trying to write my data in the xdmf-format and read it in  
>> paraview.
>
> Andrew
>

------------------------------------------------------------
Ruth Aydt
The HDF Group
1901 South First Street,  Suite C-2
Champaign, IL 61820

aydt at hdfgroup.org      (217)265-7837
------------------------------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/attachments/20081013/ae913a01/attachment.html>