How can I get a more regular surface quadmesh using gmsh?

1.5k Views Asked by At

I want to be able to generate a quadrilateral surface mesh that is highly regular (each face has, as far as possible, the same area) and aligned with the surface boundary.

The following test .geo file simplifies the type of intended use case:

lc = 0.1; 

// vertices.
Point(1) = {0, 0, 0, lc};
Point(2) = {0.5, 0, 0, lc};
Point(3) = {1.0, 0, 0, lc};
Point(4) = {1.0, 0.5, 0.5, lc};
Point(5) = {1.0, 1.0, 1.0, lc};
Point(6) = {1.0, 1.5, 0.5, lc};
Point(7) = {1.0, 2.0, 0.0, lc};
Point(8) = {0.5, 2.0, 0.0, lc};
Point(9) = {0.0, 2.0, 0.0, lc};
Point(10) = {0.0, 1.5, 0.5, lc};
Point(11) = {0.0, 1.0, 1.0, lc};
Point(12) = {0.0, 0.5, 0.5, lc};

// curves.
Spline(1) = {1,2,3};
Spline(2) = {3,4,5,6,7};
Spline(3) = {7,8,9};
Spline(4) = {9,10,11,12,1};
Physical Line("bottom") = {1};
Physical Line("top") = {3};
Curve Loop(1) = {2, 3, 4, 1};

//surface.
Transfinite Curve{1} = 20
Transfinite Surface(1) = {2,3,4,1};
Physical Surface("mysurface") = {1};

When I load this .geo file into gmsh gui (v 4.3.0) and run mesh 1D then 2D (Frontal-Delaunay option) and finally 2D recombination (Blossom option) commands the resulting surface mesh is not that regular:

enter image description here

The console log shows:

Info    : Meshing 1D...
Info    : Meshing curve 1 (Nurb)
Info    : Meshing curve 2 (Nurb)
Info    : Meshing curve 3 (Nurb)
Info    : Meshing curve 4 (Nurb)
Info    : Done meshing 1D (0.008326 s)
Info    : 70 vertices 74 elements
Info    : Meshing 2D...
Info    : Meshing surface 1 (Surface, Frontal)
Info    : Done meshing 2D (0.013711 s)
Info    : 272 vertices 538 elements
Info    : Recombining 2D mesh...
Info    : Blossom: 665 internal 62 closed
Info    : Blossom recombination completed (0.012128 s): 230 quads, 0 triangles, 0 invalid quads, 0 quads with Q < 0.1, avg Q = 0.799983, min Q = 0.502415
Info    : Done recombining 2D mesh (0.012205 s)

I suspect this maybe due to my relative inexperience with geo/gmsh. Advice appreciated.

1

There are 1 best solutions below

0
On

For this example, I would highly recommend the new (experimental) meshing option in GMSH: 9 – packing for parallelograms.

According to the release notes, this option appeared in GMSH at least in 4.1.1:

4.1.2 (January 21, 2019): fixed full-quad subdivision if Mesh.SecondOrderLinear is set; fixed packing of parallelograms regression in 4.1.1.

With this code:

Mesh.Algorithm = 9; // Packing for Parallelograms


lc = 0.1; 

// vertices.
Point(1) = {0, 0, 0, lc};
Point(2) = {0.5, 0, 0, lc};
Point(3) = {1.0, 0, 0, lc};
Point(4) = {1.0, 0.5, 0.5, lc};
Point(5) = {1.0, 1.0, 1.0, lc};
Point(6) = {1.0, 1.5, 0.5, lc};
Point(7) = {1.0, 2.0, 0.0, lc};
Point(8) = {0.5, 2.0, 0.0, lc};
Point(9) = {0.0, 2.0, 0.0, lc};
Point(10) = {0.0, 1.5, 0.5, lc};
Point(11) = {0.0, 1.0, 1.0, lc};
Point(12) = {0.0, 0.5, 0.5, lc};

// curves.
Spline(1) = {1,2,3};
Spline(2) = {3,4,5,6,7};
Spline(3) = {7,8,9};
Spline(4) = {9,10,11,12,1};
Physical Line("bottom") = {1};
Physical Line("top") = {3};
Curve Loop(1) = {2, 3, 4, 1};
Surface(1) = {1};
Recombine Surface{1};

Physical Surface("mysurface") = {1};

I am able to generate the following mesh:

Notice slight modifications to your GEO file:

  • I removed Transfinite Surfaces
  • I explicitly setup the meshing algorithm and recombination inside the GEO

which I had to do to make this model work on my version of GMSH.