I'm trying to use a xdmf file for Paraview to get data from a hdf5 file. I have one of the variable in an array that contains 2 values and I need to use the first one. For that I have tried to use a Function but can't figure out how to use it. So if I do that :
<Attribute Name="rho" Center="Cell" AttributeType="Scalar">
<DataItem Format="HDF" Precision="8" Dimensions="2">
test.h5:/variables/rho_cell
</DataItem>
</Attribute>
Paraview gives a warning that I have an array with 2 values while I have only one cell (this warning was expected). So I have added a Function like that :
<Attribute Name="rho" Center="Cell" AttributeType="Scalar">
<DataItem ItemType="Function" Function="$0[1:2]" Dimensions="1">
<DataItem Format="HDF" Precision="8" Dimensions="2">
test.h5:/variables/rho_cell
</DataItem>
</DataItem>
</Attribute>
And with that Paraview crashes (no error message). To be honest I'm not even sure if the array indexing is like in python (start at 0 and 0:1 means only the first element)... and I can't find any help on that. I have tried almost any combination of parameters but nothing seem to work.
To be sure that my function syntax is not completely wrong I have tried that :
<Attribute Name="rho" Center="Cell" AttributeType="Scalar">
<DataItem ItemType="Function" Function="$0 + 1.5" Dimensions="2">
<DataItem Format="HDF" Precision="8" Dimensions="2">
test.h5:/variables/rho_cell
</DataItem>
</DataItem>
</Attribute>
And it works, but obviously still give the warning about the number of cells.