Confusion with the indexation of Hyperslab - No change in the indexation possible
Hello everyone !
I encountered a problem writting my XDMF file with Hyperslab: My HDF5 is as follow : /geom/x : scalar x axis [12] /geom/y : scalar y axis [35] /geom/z : scalar z axis [12] /data/u : scalar dataset of shape [3, 12, 35, 12], it represent the 3 components [U, V, W] of the scalar velocity u.
My goal is to read this file with Paraview, and being able to separately see the x-component of u [0, :, :, :] for example (or [1, :, :, :] / y- component or [2, :, :, :] / z- component).
However, the indexing does not work correctly and :
- each component U, V, W is tranpose: the U component is plotted along the z-axis (the W along the x-axis). The V is well plotted along the y-axis.
- the component are shifted, by that I mean that when I want to plot W, I get the values of U, and when I want U, I get the values W...
I think the problem comes from the indexing, it does not read my data in the right order... I dont know how to change that. I tried many different shape like [12, 35, 12, 3], [12, 12, 35, 3] or whatever, and it sometimes returns the same result despite the change... I exchange the name "U" and "W", but it still returns the same thing.. ???
I do not not understand where the problem comes from. Perhaps it is my understanding of the function, my code, my data or a misfunction of Hyperslab ?
I attached my data file eq1_12x35x12.h5 eq1_32x35x32.h5, a picture of what it should looks like projected, and my XDMF file below.
Here is my XMF file :
<Topology TopologyType="3DRectMesh" NumberOfElements="12 35 12"/>
<Geometry GeometryType="VXVYVZ">
<DataItem Dimensions="12" NumberType="Float" Precision="4" Format="HDF"> eq1_12x35x12.h5:geom/x
</DataItem>
<DataItem Dimensions="35" NumberType="Float" Precision="4" Format="HDF"> eq1_12x35x12.h5:geom/y
</DataItem>
<DataItem Dimensions="12" NumberType="Float" Precision="4" Format="HDF"> eq1_12x35x12.h5:geom/z
</DataItem>
</Geometry>
<Attribute Name="U" Center="Node">
<DataItem ItemType="HyperSlab" Dimensions="12 35 12" Type="HyperSlab">
<!-- Start at 0 0 0 0, with a stride of 1 1 1 1 and finish at 1 12 35 12, so it takes U = /data/u[0, :, :, :] -->
<DataItem Dimensions="3 4" Format="XML">
0 0 0 0
1 1 1 1
1 12 35 12
</DataItem>
<DataItem Name="Velocity" Dimensions="3 12 35 12" Format="HDF">
eq1_12x35x12.h5:/data/u
</DataItem>
</DataItem>
</Attribute>
<Attribute Name="V" Center="Node">
<DataItem ItemType="HyperSlab" Dimensions="12 35 12" Type="HyperSlab">
<!-- Start at 1 0 0 0, with a stride of 1 1 1 1 and finish at 2 12 35 12, so it takes V = /data/u[1, :, :, :] -->
<DataItem Dimensions="3 4" Format="XML">
1 0 0 0
1 1 1 1
2 12 35 12
</DataItem>
<DataItem Name="Velocity" Dimensions="3 12 35 12" Format="HDF">
eq1_12x35x12.h5:/data/u
</DataItem>
</DataItem>
</Attribute>
<Attribute Name="W" Center="Node">
<DataItem ItemType="HyperSlab" Dimensions="12 35 12" Type="HyperSlab">
<!-- Start at 2 0 0 0, with a stride of 1 1 1 1 and finish at 3 12 35 12, so it takes W = /data/u[2, :, :, :] -->
<DataItem Dimensions="3 4" Format="XML">
2 0 0 0
1 1 1 1
3 12 35 12
</DataItem>
<DataItem Name="Velocity" Dimensions="3 12 35 12" Format="HDF">
eq1_12x35x12.h5:/data/u
</DataItem>
</DataItem>
</Attribute>
</Grid>
</Domain>