# Question on extending mesh boundaries

**URL:** <https://community.geodynamics.org/t/question-on-extending-mesh-boundaries/3599>\
**Category:** PyLith\
**Tags:** boundary\
**Created:** [August 15, 2024, 8:45pm UTC](https://community.geodynamics.org/t/question-on-extending-mesh-boundaries/3599 "2024-08-15T20:45:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chongjh11](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chongjh11](https://community.geodynamics.org/u/chongjh11)\
**Post date:** [August 15, 2024, 8:45pm UTC](https://community.geodynamics.org/t/question-on-extending-mesh-boundaries/3599/1 "2024-08-15T20:45:05Z")

</div>

Hello,

I’m currently running Pylith 4.1.1 and I’m trying to create a new mesh using Gmsh with wider boundaries. However, there’s an error with generating the mesh when I tried to extend the boundary (x-axis) -2500 km to 2500 km while using DX\_FAULT = 5.0e+3 and DX\_BIAS = 1.09. I can only generate the mesh at this boundary when the DX\_BIAS = 1.099.

I’ve attached the necessary files here (the “generate\_gmsh\_boundary\_error.txt” has to be converted to a “.py”). Thanks!

[generate\_gmsh\_boundary\_error.txt](https://community.geodynamics.org/uploads/short-url/dO2P5ymjjUrtAHZyeK7DjfU7D2d.txt) (12.7 KB)

[slab\_bot\_geom\_linear\_v4.txt](https://community.geodynamics.org/uploads/short-url/nufUOxUnKlRJ8JI3UY0QpqKD98P.txt) (6.8 KB)  
[slab\_top\_geom\_linear\_v4.txt](https://community.geodynamics.org/uploads/short-url/1uOfcRVUsHb4VGt6ujYlRaAQ6hX.txt) (6.8 KB)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 16, 2024, 3:05am UTC](https://community.geodynamics.org/t/question-on-extending-mesh-boundaries/3599/2 "2024-08-16T03:05:47Z")

</div>

In the future, please include the error message you see. That way, we can verify that we are able to reproduce your error.  
I get the following error message when I use your mesh generation script:

```auto
./generate_gmsh.py --generate --gui
Info : Meshing 1D...
Info : [0%] Meshing curve 3 (Nurb)
Info : [10%] Meshing curve 4 (Line)
Info : [20%] Meshing curve 5 (Line)
Info : [30%] Meshing curve 8 (Line)
Info : [30%] Meshing curve 9 (Line)
Info : [40%] Meshing curve 10 (Nurb)
Info : [50%] Meshing curve 11 (Nurb)
Info : [60%] Meshing curve 12 (Nurb)
Info : [60%] Meshing curve 13 (Nurb)
Info : [70%] Meshing curve 14 (Nurb)
Info : [80%] Meshing curve 15 (Line)
Info : [80%] Meshing curve 16 (Line)
Info : [90%] Meshing curve 17 (Line)
Info : [100%] Meshing curve 18 (Line)
Info : Done meshing 1D (Wall 0.0577142s, CPU 0.119331s)
Info : Meshing 2D...
Info : [0%] Meshing surface 1 (Plane, Frontal-Delaunay)
Warning : Impossible to recover edge 605 605 (error tag -1)
Warning : Impossible to recover edge 607 607 (error tag -1)
Error : Unable to recover the edge 611 (15/55) on curve 10 (on surface 1)
Traceback (most recent call last):
  File "Downloads/tmp/./generate_gmsh.py", line 307, in <module>
    App().main()
  File "software/unix/py3.12-venv/pylith-debug/lib/python3.12/site-packages/pylith/meshio/gmsh_utils.py", line 110, in main
    self.generate_mesh(args.cell)
  File "Downloads/tmp/./generate_gmsh.py", line 302, in generate_mesh
    gmsh.model.mesh.generate(2)
  File "software/unix/py3.12-venv/pylith-debug/lib/python3.12/site-packages/gmsh.py", line 2060, in generate
    raise Exception(logger.getLastError())
Exception: Unable to recover the edge 611 (15/55) on curve 10 (on surface 1)

```

The error goes away when I change curve 10 (top of the model) from a spline (`add_spline`) to a polyline (`add_polyline`). I think there is a problem with creating the spline for your points as they are almost colinear.

---

<div class="post-metadata">

**Author:** ![chongjh11](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chongjh11](https://community.geodynamics.org/u/chongjh11)\
**Post date:** [August 20, 2024, 1:40am UTC](https://community.geodynamics.org/t/question-on-extending-mesh-boundaries/3599/3 "2024-08-20T01:40:52Z")

</div>

Hi Brad,

Thank you for your help and I will make sure to include it next time, thanks!
