Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate XDMF to allow ParaView to read HDF5 file (instead of having to generate separate PVD/VTR files) #89

Open
mlp6 opened this issue Oct 1, 2020 · 0 comments
Assignees

Comments

@mlp6
Copy link
Owner

mlp6 commented Oct 1, 2020

The XML schema

The XML schema produced by the program indicates that data should be read from the xdmf2d.h5 file. The mesh is 2DSmesh indicating that the mesh is 2D and structured. The mesh coordinates use the X_Y syntax, which indicates that each coordinate field is stored in a different HDF5 array. The Attribute tags in the XML specify both of the fields that are defined on the mesh. Note that the order of the coordinates when using HDF5 and the XML file is: Z, Y, X (with Z being optional).

Another important point is that you should take care to specify the number of nodes for most dimensions of the mesh. The number of cells only seems important for specifying the dimensions of cell-centered variables. The (NX+1) in the above source code example program means the number of nodes in X since NX is the number of cells in X. Thus (NX+1) is used to write any node-sized value (with respect to X) to the XML file.

<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
 <Domain>
   <Grid Name="mesh1" GridType="Uniform">
     <Topology TopologyType="2DSMesh" NumberOfElements="21 31"/>
     <Geometry GeometryType="X_Y">
       <DataItem Dimensions="21 31" NumberType="Float" Precision="4" Format="HDF">
        xdmf2d.h5:/X
       </DataItem>
       <DataItem Dimensions="21 31" NumberType="Float" Precision="4" Format="HDF">
        xdmf2d.h5:/Y
       </DataItem>
     </Geometry>
     <Attribute Name="Pressure" AttributeType="Scalar" Center="Cell">
       <DataItem Dimensions="20 30" NumberType="Float" Precision="4" Format="HDF">
        xdmf2d.h5:/Pressure
       </DataItem>
     </Attribute>
     <Attribute Name="VelocityX" AttributeType="Scalar" Center="Node">
       <DataItem Dimensions="21 31" NumberType="Float" Precision="4" Format="HDF">
        xdmf2d.h5:/VelocityX
       </DataItem>
     </Attribute>
   </Grid>
 </Domain>
</Xdmf>

Source: http://visitusers.org/index.php?title=Using_XDMF_to_read_HDF5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant