[Paraview] XDMF writing problem

samer at icp.uni-stuttgart.de samer at icp.uni-stuttgart.de
Wed Jun 30 13:05:05 EDT 2010


Hello Eric,

Man... I'm really unable to express my gratitude for your help! you just
gave me what I exactly needed, the first step into XDMF. I'm really
grateful! now I can learn more by manipulating that file :-) .

Thank you again, and wish you the best.

Sincerest regards,
Samer

> Hey Samer,
>
> You had the right idea, looking at the HDF5 file with hdfview, but since
> the file doesn't contain any coordinate information, you will want to use
> one of the regular grid meshes where you set the origin and spacing of the
> mesh in each direction and then the positions of the nodes are implicitly
> defined. I can't tell if the grid spacing is buried somewhere in the
> metadata for your file, but there's a lot of into there, so it might be.
>
> Besides the model and format page
> (http://xdmf.org/index.php/XDMF_Model_and_Format), if you download the
> Xdmf source code there are a lot of examples of .xmf files in
> [xdmf_src]/Examples/Data.
>
> Following is a .xmf file that works for me and a screenshot from ParaView.
>
> Talk to you later,
> -Eric
>
>
> <Xdmf>
> 	<Domain Name="TEST">
> 		<Grid Name="Pressure_Grid" GridType="Uniform">
> 			<Topology TopologyType="3DCoRectMesh" Dimensions="320 304 304">
> 			</Topology>
> 			<Geometry GeometryType="Origin_DxDyDz">
> 				<DataItem Name="Origin" DataType="Float" Dimensions="3" Format="XML">
> 					0.000 0.000 0.000
> 				</DataItem>
> 				<DataItem Name="Spacing" DataType="Float" Dimensions="3" Format="XML">
> 					1.000 1.000 1.000
> 				</DataItem>
> 			</Geometry>
> 			<Attribute AttributeType="Scalar" Center="Node" Name="Pressure">
> 				<DataItem NumberType="Float" Precision="8" Dimensions="320 304 304"
> Format="HDF">
> 					data.h5:OutArray
> 				</DataItem>
> 			</Attribute>
> 		</Grid>
> 	</Domain>
> </Xdmf>
>
>
>
> On Jun 30, 2010, at 5:53 AM, samer at icp.uni-stuttgart.de wrote:
>
>> Hello Eric,
>>
>> Thank you for your answer. Actually what I mean with not pleasing, is
>> that
>> the program is crashing a lot, giving this message in the terminal.
>>
>> XDMF Error in
>> /build/buildd/paraview-3.4.0/Utilities/Xdmf2/libsrc/XdmfValuesHDF.cxx
>> line
>> 77 (Can't Open Dataset data.h5:/X)
>> XDMF Error in
>> /build/buildd/paraview-3.4.0/Utilities/Xdmf2/libsrc/XdmfDataItem.cxx
>> line
>> 498 (Reading Values Failed)
>> XDMF Error in
>> /build/buildd/paraview-3.4.0/Utilities/Xdmf2/libsrc/XdmfGrid.cxx line
>> 607
>> (Error in Update() of Geometry)
>> Segmentation fault
>>
>> I'm aware that my data does not contain XYZ information, it only
>> contains
>> pressure data, but when I remove the XYZ information from my XDMF I get
>> a
>> null shape in paraview (of course, because there won't be a geometry
>> then), and the "volume" preview is wouldn't be available, only surface
>> and
>> some other useless choices, and they all give empty views. Therefore I'm
>> not sure how I can tell the program that those pressures correspond to a
>> grid.
>>
>> Starting from the very beginning, I got this file "data.h5" from someone
>> telling me that it's the output of some analysis for pressure. I need to
>> visualise this file to understand the type before I do the analysis on
>> my
>> sample. I used the program hdfview to view its contents, and I found
>> that
>> it's a 3D matrix of 8-byte doubles, every double contains a pressure,
>> and
>> the dimensions of this matrix is 320x304x304, and this is the only
>> information I have.
>>
>> The size of the file is 225 MB, which is equal to: 8*304*304*320 bytes.
>> In
>> other words the data file does not contain any other information about
>> the
>> coordinates.
>>
>> I wrote this XDMF file while I don't really understand what I'm doing,
>> it's just the first step, so I don't know anything like different
>> mesh(s)
>> and so on.
>>
>> I expected to get a 3D view for my samples with different colours per
>> pressure, isn't this what I should get?
>>
>> Now the question, does it suffice to state only the pressure information
>> in the XDMF file without coordinates? and what should paraview show me
>> for
>> such data? is it colour per voxel as I expected? is what I'm doing the
>> right way to visualise this data?
>>
>> For convenience, I uploaded the data file to Megaupload, please find it
>> at
>>
>> http://www.megaupload.com/?d=F8M6XU4D
>>
>> Thank you, I really appreciate the time you're using for this.
>>
>> Best regards,
>> Samer
>>
>>
>>
>>> Hello Samer,
>>>
>>> You may need to explain a bit more what you mean by "the final result I
>>> got was not pleasing".
>>>
>>> It looks like there may be a problem in that you are defining
>>> 320x304x304
>>> points for your grid, but you also are stating that the same number of
>>> Pressure attributes exist, centered on the cells. If you really have
>>> that
>>> many pressure values, you should probably put them as Center="Node",
>>> otherwise there should be one less value in each direction, as the
>>> cells
>>> will be implicitly defined between the points.
>>>
>>> (Also, you probably already know this, but if your grid has a constant
>>> spacing in each direction you can either use 3DRectMesh or 3DCoRectMesh
>>> topology and not have to specify the XYZ positions of the points.)
>>>
>>> If changing cell centered to point centered doesn't help, just explain
>>> a
>>> little more about what's not working and we'll try to help more. There
>>> is
>>> also an Xdmf mailing list, but this is an okay place to post for now if
>>> you're trying to load your data into ParaView.
>>>
>>> Talk to you later,
>>> -Eric
>>>
>>> ------------------------------------------------------
>>> Eric E Monson
>>> Duke Visualization Technology Group
>>>
>>>
>>> On Jun 29, 2010, at 11:19 AM, Samer Afach wrote:
>>>
>>>> Hello programmers,
>>>>
>>>> I'm new to this list, I'm not sure I'm asking in the right place, but
>>>> I'll try to ask and I hope I'll get the answer I'm looking for :) .
>>>>
>>>> I have an HDF5 file which is an array of 8-bit double 3D array of
>>>> pressure values for a sample I have, the size of this array is
>>>> 320x304x304. I'm trying to read this file to (visualise it in)
>>>> Paraview,
>>>> and I heard that I have to write an XDMF file for that. So I started
>>>> reading about it, but the final result I got was not pleasing. I
>>>> attached with this e-mail the XDMF file I wrote for this purpose
>>>> (reading my data.h5 file).
>>>>
>>>> Could someone please tell me what's wrong in my XDMF?
>>>>
>>>> Thank you, any efforts are highly appreciated.
>>>>
>>>> Regards,
>>>> Samer Afach
>>>> Institute for Computational physics, University of Stuttgart
>>>> <?xml version="1.0" ?>
>>>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>>>> <Xdmf Version="2.0">
>>>>   <domain>
>>>>  <Grid Name="mesh1" GridType="Uniform">
>>>>  <Topology TopologyType="3DSMesh" NumberOfElements="304 304 320"/>
>>>>    <Geometry GeometryType="X_Y_Z">
>>>>      <DataItem Dimensions="304 304 320" NumberType="Float"
>>>> Precision="8" Format="HDF">
>>>>       data.h5:/X
>>>>      </DataItem>
>>>>      <DataItem Dimensions="304 304 320" NumberType="Float"
>>>> Precision="8" Format="HDF">
>>>>       data.h5:/Y
>>>>      </DataItem>
>>>>      <DataItem Dimensions="304 304 320" NumberType="Float"
>>>> Precision="8" Format="HDF">
>>>>       data.h5:/Z
>>>>      </DataItem>
>>>>    </Geometry>
>>>>    <Attribute Name="Pressure" AttributeType="Scalar" Center="Cell">
>>>>      <DataItem Dimensions="304 304 320" NumberType="Float"
>>>> Precision="8" Format="HDF">
>>>>       data.h5:/Pressure
>>>>      </DataItem>
>>>>    </Attribute>
>>>>  </Grid>
>>>>   </domain>
>>>> </Xdmf>
>>>> _______________________________________________
>>>> 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