# Paraview not reading correctly particles h5 file

**URL:** https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141
**Category:** ParaView Support
**Created:** [May 4, 2021, 2:37pm UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141 "2021-05-04T14:37:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rw31415](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rw31415/32/6431_2.png) [@rw31415](https://discourse.paraview.org/u/rw31415)
#### Post date: [May 4, 2021, 2:37pm UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/1 "2021-05-04T14:37:22Z")

</div>

I’ve been struggling with an issue on paraview trying to read a h5 file ([TRACERS1\_1.h5](https://discourse.paraview.org/uploads/short-url/1EWIMLq9j1aFD9G5ovXsXcw4AKV.h5) (31.3 KB)) with positions and velocities of some particles in it using an xdmf file ( [XDMF\_TRACERS1-LP\_reading\_instructions.xdmf](https://discourse.paraview.org/uploads/short-url/9HurASqFkUwuj1ffyGwrEh35Dyc.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.

 ![particles_matalb](https://discourse.paraview.org/uploads/default/original/2X/e/e080757182963658808624498cb785dd0b8c83b2.jpeg) ![particles_paraview](https://discourse.paraview.org/uploads/default/original/2X/f/f357a636acc2f5a7f43b8a3794f80852e499589a.png)

---

<div class="post-metadata">

### Author: ![rw31415](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rw31415/32/6431_2.png) [@rw31415](https://discourse.paraview.org/u/rw31415)
#### Post date: [May 11, 2021, 7:50am UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/2 "2021-05-11T07:50:11Z")

</div>

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>'
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 11, 2021, 7:57am UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/3 "2021-05-11T07:57:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![rw31415](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rw31415/32/6431_2.png) [@rw31415](https://discourse.paraview.org/u/rw31415)
#### Post date: [May 11, 2021, 8:50am UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/4 "2021-05-11T08:50:49Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 11, 2021, 8:53am UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/5 "2021-05-11T08:53:20Z")

</div>

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/](https://www.kitware.eu/)

---

<div class="post-metadata">

### Author: ![rw31415](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rw31415/32/6431_2.png) [@rw31415](https://discourse.paraview.org/u/rw31415)
#### Post date: [May 11, 2021, 8:58am UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/6 "2021-05-11T08:58:17Z")

</div>

Thanks for your help Mathieu.

---

<div class="post-metadata">

### Author: ![rw31415](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rw31415/32/6431_2.png) [@rw31415](https://discourse.paraview.org/u/rw31415)
#### Post date: [May 11, 2021, 1:32pm UTC](https://discourse.paraview.org/t/paraview-not-reading-correctly-particles-h5-file/7141/7 "2021-05-11T13:32:35Z")

</div>

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…
