[Paraview] HDF5 and Paraview

Tim Gallagher tim.gallagher at gatech.edu
Thu Jan 3 22:31:42 EST 2013


If you look on the Xdmf Model and Format website (http://www.xdmf.org/index.php/XDMF_Model_and_Format) you can see that there is a 2DCoRectMesh and 3DCoRectMesh topology which can be used to make 2/3D constant spacing meshes with axis aligned to X,Y,Z. 

And example of how to write this is on the API portion (http://www.xdmf.org/index.php/XDMF_API). The relevant section is:

# Domain
dm = XdmfDomain()
root.Insert(dm)
# Grid
g = XdmfGrid()
g.SetName("Structured Grid")
# Topology
t = g.GetTopology()
t.SetTopologyType(XDMF_3DCORECTMESH)
t.GetShapeDesc().SetShapeFromString('10 20 30')
# Geometry
geo = g.GetGeometry()
geo.SetGeometryType(XDMF_GEOMETRY_ORIGIN_DXDYDZ)
geo.SetOrigin(1, 2, 3)
geo.SetDxDyDz(0.1, 0.2, 0.3)

Which is using the python bindings, but you can easily determine what the resulting xml file looks at by looking at the Model and Format page to see what the resulting tags would be. Or you can use the Python or C++ bindings to write your file. Basically you tell it that your grid is constant and rectilinear, and then you give it the origin and the spacing.  

Tim

----- Original Message -----
From: "Pradeep Jha" <pradeep.kumar.jha at gmail.com>
To: "Jens Kleimann" <jk at tp4.rub.de>
Cc: paraview at paraview.org
Sent: Thursday, January 3, 2013 10:19:42 PM
Subject: Re: [Paraview] HDF5 and Paraview

Hello Jens,

thanks for the response. It explained a lot. 

I have been reading up about XDMF and am trying to implement it. My filename.h5 file just contains a scalar value for 512*512*512 grid points in a structured uniform cube. I don't store any grid coordinates information in any files. But all the material I have been reading for XDMF mention that I have to give grid information. Is there a simple way of conveying my uniform grid structure to XDMF or should I create a file with grid coordinates and make XDMF read it?

Thank you,
Pradeep


On 2 janv. 2013, at 05:50, Jens Kleimann <jk at tp4.rub.de> wrote:

> Am 21.12.2012 03:28, schrieb Pradeep Jha:
>> Thanks for the response everyone and thanks for the detailed response
>> Ken. It made things a bit more clearer.
>> 
>> But still I dont understand that once I create a Hdf5 data, and even I
>> create a XDMF file, how can I be sure which reader to use for the data?
>> So every time I switch to a new data, chances are I might have to try
>> out all the readers one by one, till one of them plots it fine?
>> Is there something I am missing?
> 
> Once you have created the corresponding filename.xmf that belongs to your filename.h5, you just open filename.xmf in PV. It contains the location and structural info on the HDF5 and thus knows how to open and interpret it. You will no longer be prompted to pick a reader.
> 
> Cheers, Jens.
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
> 
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list