# Error importing .msh to .pyfrm

**URL:** <https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216>\
**Category:** Errors\
**Tags:** mesh\
**Created:** [11 February 2025 14:24 UTC](https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216 "2025-02-11T14:24:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olaf](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@Olaf](https://pyfr.discourse.group/u/Olaf)\
**Post date:** [11 February 2025 14:24 UTC](https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216/1 "2025-02-11T14:24:32Z")

</div>

I am new to PyFR and CFD in general and I am trying to a mesh for my final year project. If anyone knows this error please let me know.

```bash
(pyfr-venv) juanpablo@Z390-AORUS-PRO:~/pyfr-venv/PyFR-Test-Cases-main/intakemodel2d$ py
Traceback (most recent call last):
  File "/home/juanpablo/pyfr-venv/bin/pyfr", line 8, in <module>
    sys.exit(main())
  File "/home/juanpablo/pyfr-venv/lib/python3.10/site-packages/pyfr/ __main__.py", line 84, in main
    args.process(args)
  File "/home/juanpablo/pyfr-venv/lib/python3.10/site-packages/pyfr/ __main__.py", line 61, in process
    mesh = reader.to_pyfrm(args.lintol)
  File "/home/juanpablo/pyfr-venv/lib/python3.10/site-packages/pyfr/readers/gmsh.py", line 86, in to_pyfrm
    mesh = self._to_raw_pyfrm(lintol)
  File "/home/juanpablo/pyfr-venv/lib/python3.10/site-packages/pyfr/readers/gmsh.py", line 138, in _to_raw_pyfrm
    pyfrm = mesh.get_connectivity()
  File "/home/juanpablo/pyfr-venv/lib/python3.10/site-packages/pyfr/readers/base.py", line 160, in get_connectivity
    bfaces[bpent].append(resid.pop(tuple(sorted(fn))))
KeyError: (np.int64(6), np.int64(128))

```

---

<div class="post-metadata">

**Author:** ![yhuang26](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/yhuang26/32/741_2.png) [@yhuang26](https://pyfr.discourse.group/u/yhuang26)\
**Post date:** [10 July 2025 03:09 UTC](https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216/2 "2025-07-10T03:09:27Z")

</div>

Bumping this because I got the exact same error. I’m trying to simulate a flow past cylinder problem at a high Re, and I created a mesh similar to the one in the example (inner quad meshes + outer triangle meshes) but finer. The error seems to occur at the outermost quad mesh layer where it interfaces with the triangular meshes. Did you manage to find a solution?

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [30 July 2025 09:34 UTC](https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216/3 "2025-07-30T09:34:23Z")

</div>

Can you give more details about the issue that you’re having?

---

<div class="post-metadata">

**Author:** ![yhuang26](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/yhuang26/32/741_2.png) [@yhuang26](https://pyfr.discourse.group/u/yhuang26)\
**Post date:** [31 July 2025 15:11 UTC](https://pyfr.discourse.group/t/error-importing-msh-to-pyfrm/1216/4 "2025-07-31T15:11:01Z")

</div>

I was actually able to fix it by changing the direction of meshing the internal quad section from clockwise to anticlockwise
