Hello, I am trying to use paraview 5.8.0 to visualize some data sets from a wave model. The models output arrays containing x y z displacements and torsional rotations for each. I save the data within an hdf5 and create an xmf3 descriptor for these files, which I can load into paraview, however some of my arrays are missing.
Indicates that all of my input arrays have been loaded, however when I look at the spread sheet view I expect to see scalars x,y,z,t but I appear to be missing z and t.
This the relevant piece of code that describes the process I use to create the xmf3 file
f = open(paraviewFname.split('.')[0]+".xmf", 'w')
# Header for xml file
f.write('''<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
<Domain>
<Grid Name="Box" GridType="Collection" CollectionType="Temporal">
''')
# loop over the attributes name written using time
t = 0
for t in range(0,timeSteps,dtStep):
# Naming datasets
dataSetName1 = paraviewFname+":/XparaviewSnaps/"+str(t)
dataSetName2 = paraviewFname+":/YparaviewSnaps/"+str(t)
dataSetName3 = paraviewFname+":/ZparaviewSnaps/"+str(t)
dataSetName4 = paraviewFname+":/TorisonalparaviewSnaps/"+str(t)
# at individual time write the time independent Box grid. is it overdoing?
f.write('''
<!-- time step -->
<Grid Name="Box %d" GridType="Uniform">
<Topology TopologyType="3DCoRectMesh" Dimensions="%d %d %d"/>
<Geometry GeometryType="ORIGIN_DXDYDZ">
<DataItem DataType="Float" Dimensions="3" Format="XML">0.0 0.0 0.0</DataItem>
<DataItem DataType="Float" Dimensions="3" Format="XML">%d %d %d</DataItem>
</Geometry>
<Time Value="%d" />
\n'''%(t, Nx, Ny, Nz,h,h,h, t))
# First Attribute
f.write('''\n
<Attribute Name="X" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="%d %d %d" NumberType="Float" Precision="4"
Format="HDF">
%s
</DataItem>
</Attribute>
\n'''%(Nx, Ny, Nz, dataSetName1))
# Second Attribute
f.write('''\n
<Attribute Name="Y" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="%d %d %d " NumberType="Float" Precision="4"
Format="HDF">
%s
</DataItem>
</Attribute>
</Grid>\n'''%(Nx, Ny, Nz, dataSetName2))
# Third Attribute
f.write('''\n
<Attribute Name="Z" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="%d %d %d" NumberType="Float" Precision="4"
Format="HDF">
%s
</DataItem>
</Attribute>
\n'''%(Nx, Ny, Nz, dataSetName3))
# Fourth Attribute
f.write('''\n
<Attribute Name="T" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="%d %d %d" NumberType="Float" Precision="4"
Format="HDF">
%s
</DataItem>
</Attribute>
\n'''%(Nx, Ny, Nz, dataSetName4))
# End the xmf file
f.write('''
</Grid>
</Domain>
</Xdmf>
''')
f.flush()
f.close()
Here is the first time step within the XMF3 File:
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
<Domain>
<Grid Name="Box" GridType="Collection" CollectionType="Temporal">
<!-- time step -->
<Grid Name="Box 0" GridType="Uniform">
<Topology TopologyType="3DCoRectMesh" Dimensions="189 189 2"/>
<Geometry GeometryType="ORIGIN_DXDYDZ">
<DataItem DataType="Float" Dimensions="3" Format="XML">0.0 0.0 0.0</DataItem>
<DataItem DataType="Float" Dimensions="3" Format="XML">8 8 8</DataItem>
</Geometry>
<Time Value="0" />
<Attribute Name="X" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="189 189 2" NumberType="Float" Precision="4"
Format="HDF">
location54LargeDISP_PARAVIEW.hdf5:/XparaviewSnaps/0
</DataItem>
</Attribute>
<Attribute Name="Y" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="189 189 2 " NumberType="Float" Precision="4"
Format="HDF">
location54LargeDISP_PARAVIEW.hdf5:/YparaviewSnaps/0
</DataItem>
</Attribute>
</Grid>
<Attribute Name="Z" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="189 189 2" NumberType="Float" Precision="4"
Format="HDF">
location54LargeDISP_PARAVIEW.hdf5:/ZparaviewSnaps/0
</DataItem>
</Attribute>
<Attribute Name="T" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="189 189 2" NumberType="Float" Precision="4"
Format="HDF">
location54LargeDISP_PARAVIEW.hdf5:/TorisonalparaviewSnaps/0
</DataItem>
</Attribute>
I would greatly appreciate any assistance in correcting this problem. Just to clarify I want to to have my scalar arrays for x,y,z displacement and torsional motion associated with there corresponding points in the 3d mesh.