Paraview not reading correctly particles h5 file

I’ve been struggling with an issue on paraview trying to read a h5 file (TRACERS1_1.h5 (31.3 KB)) with positions and velocities of some particles in it using an xdmf file ( XDMF_TRACERS1-LP_reading_instructions.xdmf (997 Bytes))

When reading the h5 file with matlab I don’t have any problem and I can get the correct positions (see .jpeg). Instead, when reading the xdmf with paraview, the positions almost all follow one line as if the h5 was not read along the appropriate dimensions.

Does someone know the issue here by any chance ? I also tried using the VXVYVZ geometry type, thinking it would make sure that dimensions are properly handled but Paraview crashes when reading the xdmf.

                 write(82,'(a)') '                <Geometry GeometryType="VXVYVZ">' 
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                 'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/XP/-X'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                    'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/XP/-Y'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                    'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/XP/-Z'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                </Geometry>'
                 write(82,'(a)') '                <Attribute Name="Particle Velocity" AttributeType="Vector" Center="Node">'
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                    'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/UP/-X'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                    'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/UP/-Y'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                    <DataItem Format="HDF" NumberType="Float" Precision="8" '//                                                                                    'Dimensions="'//trim(np_char)//'">'
                 write(82,'(a)') '                        '//trim(fname)//':/UP/-Z'
                 write(82,'(a)') '                    </DataItem>'
                 write(82,'(a)') '                </Attribute>'

I reproduce the issue but figuring out if the problem comes from the data or the reader VTK side requires probably more investigation, either on your side are using professionnal support.

ha, too bad…thanks anyway. Would you have any idea about what kind of investigation I could conduct either on the data or vtk ? I’m dry here, and don’t have anyone around me who uses vtk…

You would need to know C++ and look into the VTK/IO/Xdmf*/vtkXdmf* stack. Alternatively, contact Kitware for professional support. https://www.kitware.eu/

Thanks for your help Mathieu.

I could finally get the hang of it…Somehow, vtk or paraview (at least the version 5.4 with vtk therein) does not like h5 files with arrays of size (nb_particles,dims), where nb_particles is the number of particles and dims the number of dimensions, even if the xdmf file is written accordingly. The h5 file must therefore contain arrays of size (dims,nb_particles).

Maybe some kind of reshape function that does not work properly…