[Gmsh] Quads only mesh

Ganesh Diwan gcdiwan at gmail.com
Sun Sep 27 12:23:45 CEST 2015


Hi Gmsh

I am trying to mesh a 2d domain that has several circular holes and the
outer boundary is a spline/B-spline. I need the gridsize to be close to 2
and all elements must be quadrilaterals. With the following .geo file, I
get some elements as triangles. How to avoid this? If I set in
Tools->Options->Mesh->Subdivision Algorithm->All Quads, them my mesh size
reduces which I don't want. Any help is much appreciated. Thank you.


Here is my geo file:

rscat = 0.9;
Rext = 8;
gridsize = 2;
rc = 3;
x0 = 0;
y0 = 0;
Point(999) = {x0, y0, 0, gridsize};
x1 = -1;
y1 = 0;
x2 = 0;
y2 = 3;
x3 = 0;
y3 = -3;
x4 = 2;
y4 = -5;
// 4 circles
Point(1) = {x1, y1, 0, gridsize};
Point(2) = {x2, y2, 0, gridsize};
Point(3) = {x3, y3, 0, gridsize};
Point(4) = {x4, y4, 0, gridsize};

Point(11) = {x1+rscat, y1, 0, gridsize};
Point(12) = {x1, y1+rscat, 0, gridsize};
Point(13) = {x1-rscat, y1, 0, gridsize};
Point(14) = {x1, y1-rscat, 0, gridsize};
Point(21) = {x2+rscat, y2, 0, gridsize};
Point(22) = {x2, y2+rscat, 0, gridsize};
Point(23) = {x2-rscat, y2, 0, gridsize};
Point(24) = {x2, y2-rscat, 0, gridsize};
Point(31) = {x3+rscat, y3, 0, gridsize};
Point(32) = {x3, y3+rscat, 0, gridsize};
Point(33) = {x3-rscat, y3, 0, gridsize};
Point(34) = {x3, y3-rscat, 0, gridsize};
Point(35) = {x4+rscat, y4, 0, gridsize};
Point(36) = {x4, y4+rscat, 0, gridsize};
Point(37) = {x4-rscat, y4, 0, gridsize};
Point(38) = {x4, y4-rscat, 0, gridsize};

Circle(1) = {11, 1, 12};
Circle(2) = {12, 1, 13};
Circle(3) = {13, 1, 14};
Circle(4) = {14, 1, 11};
Circle(5) = {21, 2, 22};
Circle(6) = {22, 2, 23};
Circle(7) = {23, 2, 24};
Circle(8) = {24, 2, 21};
Circle(9) = {31, 3, 32};
Circle(10) = {32, 3, 33};
Circle(11) = {33, 3, 34};
Circle(12) = {34, 3, 31};
Circle(13) = {35,4,36};
Circle(14) = {36,4,37};
Circle(15) = {37,4,38};
Circle(16) = {38,4,35};

Point(101) = {0, 0, 0, gridsize};
Point(102) = {3, 3, 0, gridsize};
Point(103) = {0, 6, 0, gridsize};
Point(104) = {-3, 3, 0, gridsize};
Point(105) = {-6, 0, 0, gridsize};
Point(106) = {-3, -3, 0, gridsize};
Point(107) = {-1, -6, 0, gridsize};
Point(108) = {1,-7,0,gridsize};
Point(109) = {5, -7, 0, gridsize};
Point(110) = {4, -3, 0, gridsize};

Line Loop(18) = {2, 3, 4, 1};
Line Loop(19) = {5, 6, 7, 8};
Line Loop(20) = {10, 11, 12, 9};
Line Loop(21) = {13, 14, 15, 16};

n1 = 1;
n2 = 1;

Transfinite Line{1,2,3,4} = n1 ;
Transfinite Line{5, 6, 7, 8} = n1 ;
Transfinite Line{10, 11, 12, 9} = n1 ;
Transfinite Line{13, 14, 15, 16} = n1 ;

BSpline(101) = {101, 102, 103, 104, 106, 107, 108,109,110,101};
Line Loop(1001) = {1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,101};
Plane Surface(2001) = {1001};
//Transfinite Surface{2001} = {};
Recombine Surface {2001} ;
Physical Line(10) = {1, 2, 3, 4,5, 6, 7, 8,9, 10, 11, 12,13,14,15,16};
Physical Line(11) = {101};
Physical Surface(301) = {2001};
Mesh.Smoothing = 2;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20150927/4fd25cda/attachment.html>