[Paraview] problems with Xdmf-file
Natalie Happenhofer
nataliehapp at hotmail.com
Fri Oct 24 06:13:27 EDT 2008
Hi!
Well, Paraview still crashes when I try to read an .xmf file. That´s what it looks like now:
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf>
<Domain>
<Grid Name="Curvilinear" GridType="Uniform">
<Topology TopologyType="2DSMesh" Dimensions =" 140 350" >
</Topology>
<Geometry GeometryType="XY">
<DataStructure Name="Coordinates" DataType="Float" Precision="4" Dimensions="49000 2" Format="HDF">
C:\\Dokumente und Einstellungen\\Natalie Happenhofer\\Eigene Dateien\\xdmf_files\\c1d-T132-30SEPT-deep_00000.h5:/Curvilinear /Coordinates
</DataStructure>
</Geometry>
<Attribute Name="Density" Active="1" Type="Scalar" Center="Node">
<DataItem DataType="Float" Precision="4" Dimensions="140 350" Format="HDF">
C:\\Dokumente und Einstellungen\\Natalie Happenhofer\\Eigene Dateien\\xdmf_files\\c1d-T132-30SEPT-deep_00000.h5:/Curvilinear/dg
</DataItem>
</Attribute>
</Grid>
</Domain>
</Xdmf>
Well, Paraview obviously reads my .xmf file as I see my Grid and the associated attribute data in the object inspector in paraview.
When I click the "Apply" button, I get and output message from paraview which says that there has been caught an exception of a qt-eventhandler.?!
Debugging, I get the error "Access violation".
Concerning my .h5 file, it looks ok, i.e I have my group "Curvilinear" which is my grid and then two datasets associated with it, "Coordinates" and "dg".
Coordinates is a 2D-array with dimensions 49000x2, i.e. in the first column is the xCoordinate, in the second the yCoordinate.
dg is a 350x140 array with the densitiy values associated with each node.
I believe that I set the dimensions wrong in my .xmf file, but I don´t know how to set it right! I have a 2D-mesh, specifying every point with coordinates and I have attribute data associated with each node.
thx for help,
NH
From: dtlussier at gmail.com
Subject: Re: [Paraview] problems with Xdmf-file
Date: Tue, 14 Oct 2008 15:27:22 +0100
To: nataliehapp at hotmail.com
Hi Natalie.
I too had some difficulties when I was getting started with xmdf. I had similar problems of paraview crashing a lot when I was first migrating my data over to the format. I found this crashing behaviour was due to any problem with the formation of my h5 or xmf file. Therefore although you suspect the h5 file it could easily be your xml too.
In reading your email I have a few ideas you might want to try out:
1 - I couldn't get the xmdf API to work either so I had to resort to writing the xmf files by hand. However, rather than using the hdf5 api directly I made use of a python module called PyTables which wraps the hdf5 api and works seamlessly with Numpy. For me it worked well well because I was dealing with Numpy information already.
2 - Another piece of handy software is an hdf5 viewer. There is one available from the hdf people directly called hdfview I think, but I have used another one called vitables which is by the same people as pytables. The niece thing here is that you can open up the hdf5 file and actually look at how the array came into the file. If for example there is something wrong with the hdf file it should either be visible as an anomaly in the data or the file simply won't open if the problem is serious.
3 - For the geometry you should check that your array is the shape you think it is. You are specifying XYZ which means that it needs to be in a Nx3 array like like:
2 3 51 2 47.1 5.12 4.....
If your xyz data is in a different format you could should use another format like X_Y_Z where each coordinate is in its own vector. I think you have this ok in your example but it would be worth checking that your coordinate information is in fact the right shape.
4 - In the xml you might want to check how to handle spaces in window's paths when specifying the heavy data. I don't use windows much so I'm not sure if this matters but under Linux this would be bad. Small errors like this (or misspelled words in the path) can cause hard crashes like this.
5 - In the xml the dimensions should be specified with the slowest varying dimension first (i.e. KJI order). In your xml you have the reverse. This was taken right from the xdmf website but I had some difficulty in figuring out exactly what they meant by it. It looked to me that there were contradictory examples on the xdmf website so you might have to play around with the permutations of the order here to get it right if this is the problem.
Oh - and in reference to your other email regarding a crash that happens after you've gone through a few timesteps. One guess could be that you are running out of memory. I had this problem when I was using very large datasets (5 million unstructured points) with an older version of Xdmf and Paraview. They have really increased the time support in both recently (within last couple of months) so if your version of either is older than that I would suggest rebuilding both from a more recent release.
Anyways I hope that helps. If you have more problems there is usually a pretty good amount of xdmf help on the paraview list. One of the developers (Jerry Clarke at Army Research Labs in the US) is around from time to time and is very helpful.
Dan
On 13-Oct-08, at 9:12 AM, 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_______________________________________________ParaView mailing listParaView at paraview.orghttp://www.paraview.org/mailman/listinfo/paraview
_________________________________________________________________
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://www.paraview.org/pipermail/paraview/attachments/20081024/548ae478/attachment-0001.htm>
More information about the ParaView
mailing list