# Issue with Mesh (msh to pyfrm)

**URL:** <https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232>\
**Category:** Errors\
**Tags:** mesh\
**Created:** [17 March 2025 12:31 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232 "2025-03-17T12:31:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.alonsoa](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@c.alonsoa](https://pyfr.discourse.group/u/c.alonsoa)\
**Post date:** [17 March 2025 12:31 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232/1 "2025-03-17T12:31:38Z")

</div>

I aim to perform simulations of an airfoil profile. When creating the mesh in ‘Gmsh’, I try to refine it as much as possible and properly define the physical groups. To ensure accuracy, I use the example meshes published in ‘PyFr test cases’ as a reference. However, despite this, I encounter an error when performing the conversion from ‘msh’ to ‘pyfrm’, and I am unsure of the cause. I am attaching the mesh files as well as screenshots of the error. [NACA\_0018\_error](https://urjc-my.sharepoint.com/:f:/g/personal/c_alonsoa_2020_alumnos_urjc_es/EmlFCKp1Uf1GkfVo9y7HqPEBm2tfqy8vprSDK9ZFoOgmKw?e=QTygnp)

Thanks!

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [17 March 2025 17:08 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232/2 "2025-03-17T17:08:50Z")

</div>

When I attempt to import your mesh I get errors regarding unpaired faces. Can you please share your .geo file?

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![c.alonsoa](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@c.alonsoa](https://pyfr.discourse.group/u/c.alonsoa)\
**Post date:** [18 March 2025 12:49 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232/3 "2025-03-18T12:49:36Z")

</div>

Hello,  
I don’t have the `.geo` file because, as I was finding it difficult to create the geometry correctly in ‘Gmsh’, I imported it already made from ‘SALOME’ and only generated the mesh and defined the physical groups using ‘Gmsh’.  
I am attaching the geometry.  
Thanks!!

Carla

(Attachment Partition\_1.step is missing)

---

<div class="post-metadata">

**Author:** ![c.alonsoa](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@c.alonsoa](https://pyfr.discourse.group/u/c.alonsoa)\
**Post date:** [24 March 2025 12:21 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232/4 "2025-03-24T12:21:23Z")

</div>

Hello,

I have been trying to define a mesh and convert it to a ‘pyfrm’ file. At first, I attempted to create them from scratch, but I kept encountering errors, so I decided to try using a pre-made mesh that I created with this tool:

> **[GitHub - cfsengineering/GMSH-Airfoil-2D: Python tool to genreate 2D meshes around airfoils](https://github.com/cfsengineering/GMSH-Airfoil-2D?tab=readme-ov-file)**
>
> Python tool to genreate 2D meshes around airfoils

Once I generated the mesh, I tried to convert it, but I got the same error as with the meshes I attempted to create myself.

I am attaching the error message as well as the generated mesh file (ejemplo\_a.msh).

Thank you in advance.

```auto
(venv) carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ gmshairfoil2d --airfoil e211 --aoa 8 --box 12x4 --format vtk --ui --no_bl
Info : Meshing 1D...
Info : [0%] Meshing curve 1 (Nurb)
Info : [20%] Meshing curve 2 (Nurb)
Info : [30%] Meshing curve 3 (Nurb)
Info : [50%] Meshing curve 4 (Line)
Info : [60%] Meshing curve 5 (Line)
Info : [80%] Meshing curve 6 (Line)
Info : [90%] Meshing curve 7 (Line)
Info : Done meshing 1D (Wall 0.0239403s, CPU 0.018961s)
Info : Meshing 2D...
Info : Meshing surface 1 (Plane, Frontal-Delaunay)
Info : Done meshing 2D (Wall 0.161331s, CPU 0.154535s)
Info : 4524 nodes 8998 elements
Info : Optimizing mesh (Laplace2D)...
Info : Done optimizing mesh (Wall 0.071636s, CPU 0.071606s)
-------------------------------------------------------
Version : 4.11.1
License : GNU General Public License
Build OS : Linux64-sdk
Build date : 20221221
Build host : gmsh.info
Build options : 64Bit ALGLIB[contrib] ANN[contrib] Bamg Blas[petsc] Blossom Cgns DIntegration Dlopen DomHex Eigen[contrib] Fltk Gmm[contrib] Hxt Jpeg Kbipack Lapack[petsc] LinuxJoystick MathEx[contrib] Med Mesh Metis[contrib] Mmg Mpeg Netgen ONELAB ONELABMetamodel OpenCASCADE OpenCASCADE-CAF OpenGL OpenMP OptHom PETSc Parser Plugins Png Post QuadMeshingTools QuadTri Solver TetGen/BR Voro++[contrib] WinslowUntangler Zlib
FLTK version : 1.4.0
PETSc version : 3.14.4 (real arithmtic)
OCC version : 7.6.1
MED version : 4.1.0
Packaged by : geuzaine
Web site : https://gmsh.info
Issue tracker : https://gitlab.onelab.info/gmsh/gmsh/issues
-------------------------------------------------------
Info : Writing '.msh'...
Error : Unknown output file format
Info : Done writing '.msh'
Info : Writing '/home/carla/Escritorio/TFG/GMSH-Airfoil-2D/ejemplo_a.msh'...
Info : Done writing '/home/carla/Escritorio/TFG/GMSH-Airfoil-2D/ejemplo_a.msh'
Info : Writing 'mesh_airfoil_e211.vtk'...
Info : Done writing 'mesh_airfoil_e211.vtk'
(venv) carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ gmsh ejemplo_a.msh 
(venv) carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ deactivate
carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ activar_pyfr
(pyfr-venv) carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ ls
database gmshairfoil2d.egg-info mesh_airfoil_e211.vtk tests
ejemplo_a.msh images README.md venv
example LICENSE requirement.txt
gmshairfoil2d mesh_airfoil_0012.su2 setup.py
(pyfr-venv) carla@CARLAALONSO:~/Escritorio/TFG/GMSH-Airfoil-2D$ pyfr import ejemplo_a.msh ejemplo_a.pyfrm
Traceback (most recent call last):
  File "/home/carla/pyfr-venv/bin/pyfr", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/carla/pyfr-venv/lib/python3.12/site-packages/pyfr/ __main__.py", line 124, in main
    args.process(args)
  File "/home/carla/pyfr-venv/lib/python3.12/site-packages/pyfr/ __main__.py", line 138, in process_import
    mesh = reader.to_pyfrm(args.lintol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carla/pyfr-venv/lib/python3.12/site-packages/pyfr/readers/base.py", line 22, in to_pyfrm
    mesh = self._to_raw_pyfrm(lintol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carla/pyfr-venv/lib/python3.12/site-packages/pyfr/readers/gmsh.py", line 424, in _to_raw_pyfrm
    pyfrm = mesh.get_connectivity(p)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carla/pyfr-venv/lib/python3.12/site-packages/pyfr/readers/base.py", line 197, in get_connectivity
    raise ValueError('Unpaired faces in mesh')
ValueError: Unpaired faces in mesh

```

 ![Captura desde 2025-03-24 13-08-27](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/cfbfccdcb5148fc8714cd5e9e8358dd197333137.png)  
[GMSH-AIRFOL-2D](https://urjc-my.sharepoint.com/:f:/g/personal/c_alonsoa_2020_alumnos_urjc_es/EiDVV2e5CIdAtpHytxP3xKgBkjmD9sMfJLBQlq6hOnggew?e=3f2pQz)

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [24 March 2025 13:40 UTC](https://pyfr.discourse.group/t/issue-with-mesh-msh-to-pyfrm/1232/5 "2025-03-24T13:40:58Z")

</div>

If you open the mesh with Gmsh and then in the Tools =\> Options =\> Mesh dialogue select to only show 1D elements you’ll see a missing segment at the leading edge of the airfoil. This is the source of your issues.

Regards, Freddie.
