# [Gmsh] Structured mesh for a 5-vertices polygon

Christophe Geuzaine cgeuzaine at uliege.be
Wed Jan 8 15:59:07 CET 2020

```
> On 8 Jan 2020, at 14:46, Pollyana Rosa <pollyana.rosa at techcon.eng.br> wrote:
>
> Hi everyone,
>
> I want to generate a structured mesh for a 5 vertices polygon as the attached picture.
> <image.png>
>
>
> I used the code below to specify the points, lines and generate the surface, but I need a structured mesh.
> I know that I can reach this dividing the polygon in two polygons with 4 vertices each. However, I'm looking for other solutions.

You can specify the corners of the transfinite surface by hand:

Point(1) = {0, 0, 0, 1.0};
Point(2) = {0, 200, 0, 1.0};
Point(3) = {100, 200, 0, 1.0};
Point(4) = {100, 100, 0, 1.0};
Point(5) = {50, 0, 0, 1.0};
Point(6) = {100, 0, 0, 1.0};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 1};

N1 = 10; // horizontal
N2 = 20; // vertical - should be even

Transfinite Curve {2, 5} = N1;
Transfinite Curve {1} = N2 - 1;
Transfinite Curve {3,4} = N2 / 2;

Curve Loop(1) = {1, 2, 3, 4, 5};
Surface(1) = {1};
Transfinite Surface {1} = {1, 5, 3, 2};
Recombine Surface {1};

// to smooth the resulting mesh:
Smoother Surface {1} = 100;

Christophe

>
>
> //+
> Point(1) = {0, 0, 0, 1.0};
> //+
> Point(2) = {0, 200, 0, 1.0};
> //+
> Point(3) = {100, 200, 0, 1.0};
> //+
> Point(4) = {100, 100, 0, 1.0};
> //+
> Point(5) = {50, 0, 0, 1.0};
>
> Point(6) = {100, 0, 0, 1.0};
>
>
> Line(1) = {1, 2};
> //+
> Line(2) = {2, 3};
> //+
> Line(3) = {3, 4};
> //+
>
> Line(4) = {4, 5};
> //+
> Line(5) = {5, 1};
>
> //+
>
> //+
> Transfinite Curve {1, 2} =5;
> Transfinite Curve {3 : 5} = 3;
>
> //+
> Curve Loop(1) = {1, 2, 3, 4, 5};
> //+
> Surface(1) = {1};
> //+
> Transfinite Surface {1} = {1,2,3,6};
> //+
> Recombine Surface {1};
>
> Thanks,
>
> Pollyana.
>
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

—
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

```