# Problem with xdmf.read\_mesh

**URL:** <https://fenicsproject.discourse.group/t/problem-with-xdmf-read-mesh/12189>\
**Category:** General\
**Created:** [September 11, 2023, 12:51pm UTC](https://fenicsproject.discourse.group/t/problem-with-xdmf-read-mesh/12189 "2023-09-11T12:51:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [September 11, 2023, 3:19pm UTC](https://fenicsproject.discourse.group/t/problem-with-xdmf-read-mesh/12189/10 "2023-09-11T15:19:12Z")

</div>

> [@emiel\_brinkhuis1](#):
>
> ```auto
> Traceback (most recent call last):
> File "/home3/s3234266/nsx/examples/scripts/readmsh.py", line 4, in <module>
> mesh, cell_markers, facet_markers = gmshio.read_from_msh("../meshes/patient9cgs.msh", MPI.COMM_WORLD, gdim=3)
> File "/home3/s3234266/spack/var/spack/environments/fenicsx/.spack-env/view/lib/python3.10/site-packages/dolfinx/io/gmshio.py", line 311, in read_from_msh
> msh = model_to_mesh(gmsh.model, comm, rank, gdim=gdim, partitioner=partitioner)
> File "/home3/s3234266/spack/var/spack/environments/fenicsx/.spack-env/view/lib/python3.10/site-packages/dolfinx/io/gmshio.py", line 221, in model_to_mesh
> cell_id = cell_information[perm_sort[-1]]["id"]
> IndexError: index -1 is out of bounds for axis 0 with size 0
> 
> ```

So this error message means that you are not using `phyiscal entity` grouping in Gmsh, Which is adviced to avoid Getting duplicate nodes and cells in your mesh.

---

_[View the full topic](https://fenicsproject.discourse.group/t/problem-with-xdmf-read-mesh/12189)._
