[Gmsh] problem to generate a coarse mesh between two fine meshed regions

Nicolas Beudez nicolas.beudez at avignon.inra.fr
Wed Dec 19 19:02:21 CET 2012


Hi,

I'm a french user of Gmsh and I write you to help me to solve a meshing 
problem.

I have a square domain (10 cm x 10 cm) and inside two circles (diameter 
= 0.1 cm). I want to generate a mesh so that :

1) each quarter circle arc of the two circles as 8 points
2) the mesh is fine in the vicinity of each of the two circles
3) the mesh is coarse (with a characteristic length of 1 cm) near the 
outer edges of the domain *AND* between the two circles.

I've tried firstly to use only the transfinite line technique to 
discretize each of the circle arcs with 8 points. It works perfectly but 
the mesh between the two circles is too fine.

So I've tried to use the fields (attractor and threshold) to generate a 
coarse mesh betwwen the two circles but it seems not to work : the 
region between the two circles is still too fine meshed (see 
"attractor_circle.geo").

For information I have no problem when I use the attractor and threshold 
fields in the case of two points instead of the two circles (see 
"attractor_point.geo") : the mesh between the two points has a 
characteristic length equal to 1 cm.

How can I do ? Do I make a mistake ?

I thank you for your help.

Sincerely yours.

N. BEUDEZ


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20121219/2c6c6930/attachment.html>
-------------- next part --------------
lc = 1.0;

// racine 1
x1 = 1.5;
y1 = -5.0;
d1 = 0.1;
Point(1) = {x1, y1, 0.0, lc};
Point(2) = {x1+d1/2, y1, 0.0, lc};
Point(3) = {x1, y1+d1/2, 0.0, lc};
Point(4) = {x1-d1/2, y1, 0.0, lc};
Point(5) = {x1, y1-d1/2, 0.0, lc};

// racine 2
x2 = 8.5;
y2 = -5.0;
d2 = 0.1;
Point(6) = {x2, y2, 0.0, lc};
Point(7) = {x2+d2/2, y2, 0.0, lc};
Point(8) = {x2, y2+d2/2, 0.0, lc};
Point(9) = {x2-d2/2, y2, 0.0, lc};
Point(10) = {x2, y2-d2/2, 0.0, lc};

// sol
Point(11) = {0.0, 0.0, 0.0, lc};
Point(12) = {10.0, 0.0, 0.0, lc};
Point(13) = {10.0, -10.0, 0.0, lc};
Point(14) = {0.0, -10.0, 0.0, lc};

Circle(1) = {2, 1, 3};
Circle(2) = {3, 1, 4};
Circle(3) = {4, 1, 5};
Circle(4) = {5, 1, 2};
Circle(5) = {7, 6, 8};
Circle(6) = {8, 6, 9};
Circle(7) = {9, 6, 10};
Circle(8) = {10, 6, 7};
Line(9) = {12, 11};
Line(10) = {11, 14};
Line(11) = {14, 13};
Line(12) = {13, 12};

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

// maillage
Transfinite Line {1, 2, 3, 4, 5, 6, 7, 8} = 8 Using Progression 1;

Field[1] = Attractor;
Field[1].EdgesList = {1,2,3,4,5,6,7,8}; // les racines

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc/5;
Field[2].LcMax = lc;
Field[2].DistMin = 1.0;
Field[2].DistMax = 2.0;

Background Field = 2;


-------------- next part --------------
lc = 1.0;

Point(1) = {0.0, 0.0, 0.0, lc};
Point(2) = {10.0, 0.0, 0.0, lc};
Point(3) = {10.0, -10.0, 0.0, lc};
Point(4) = {0.0, -10.0, 0.0, lc};

Line(1) = {2, 1};
Line(2) = {1, 4};
Line(3) = {4, 3};
Line(4) = {3, 2};

Line Loop(5) = {1, 2, 3, 4};
Plane Surface(6) = {5};

Point(5) = {2.0, -5.0, 0.0, lc};
Point(6) = {8.0, -5.0, 0.0, lc};

Field[1] = Attractor;
Field[1].NodesList = {5,6};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc/5;
Field[2].LcMax = lc;
Field[2].DistMin = 1.0;
Field[2].DistMax = 2.0;

Background Field = 2;