[Gmsh] meshing circular inclusions with desired element size

Jose Paulo Moitinho de Almeida moitinho at civil.ist.utl.pt
Thu Jul 23 12:15:40 CEST 2015


When  you apply the Min field you get small elements everywhere. So you need a 
Max field that preserves the large element sizes inside the inclusions. 

You can play with DistMin and DistMax in order to change the mesh of the 
interface. 

ZP


On Thursday 23 July 2015 14:18:53 Nguyen Vinh Phu wrote:
> Dear Jose,
> 
> Thank you very much, what you suggested is very close to what I need. Is it
> possible just to have a refined mesh everywhere except in the inclusions?
> What we have now is just refined elements close to the inclusion
> boundaries, if the inclusions are far from each other, then the domain
> between them is meshed by coarse elements.
> 
> Hope that I did describe my problem well enough.
> 
> Best regards,
> Phu
> 
> > On 22 Jul 2015, at 6:08 pm, Jose Paulo Moitinho de Almeida
> > <moitinho at civil.ist.utl.pt> wrote:
> > 
> > 
> > If I understand correctly the goal, you need to define the Attractor
> > relative to the edges.
> > 
> > You also had problems by defining
> > 
> > Field[4].IField=1; (Threshold was relative to the first attractor)
> > 
> > and by not defining the
> > 
> > Field[5].FieldsList = {2, 4};
> > 
> > The attached file is doing what you need?
> > 
> > Regards
> > 
> > ZP
> > 
> > On Wednesday 22 July 2015 15:26:57 Nguyen Vinh Phu wrote:
> >> Dear Johannes,
> >> 
> >> Your help is very much appreciated. And I managed to do that for one
> >> single
> >> inclusion. When I tried to extend the approach to more than one, I
> >> failed.
> >> Could you please help me how to do that for a simple problem with two
> >> inclusions of which the geo file is attached so that you just modify it.
> >> Note that the two inclusions are of different radii. And my target is a
> >> domain with many many inclusions. So any help on how to generalise the
> >> procedure is welcome.
> >> 
> >> Best regards,
> >> Phu
> >> 
> >>> On 21 Jul 2015, at 5:44 pm, Johannes Wimmer <johannes.wimmer at rwth-
> > 
> > aachen.de> wrote:
> >>> Dear Phu,
> >>> are your inclusions intersecting the domain boundary? If not, simple
> >>> attractors will do.
> >> 
> >> inclusions.geo
> >> 
> >>> I have attached a snippet of tutorial 10. It works in 3D analogously.
> >>> Just pay attention that DistMin is not your inner radius of your
> >>> transition zone from coarse to fine, but the outer one, now. Think of it
> >>> as the radius where the minimal lc applies again. DistMax is then your
> >>> radius up to which the maximal lc (i.e. 5*lc) holds.
> >>> 
> >>> 
> >>> 
> >>> Cheers,
> >>> Johannes
> >>> 
> >>> On 20.07.2015 16:47, Nguyen Vinh Phu wrote:
> >>>> Dear all,
> >>>> 
> >>>> 
> >>>> 
> >>>> I have a square domain with a number of circular inclusions. For each
> >>>> inclusion, I normally define 5 points with the same characteristic
> >>>> length. This resulted in a mesh where the inclusions are finely
> >>>> discretised which is not what I need since the inclusions are only
> >>>> elastic in my FE simulations.
> >>>> 
> >>>> 
> >>>> 
> >>>> What I need to achieve is a mesh which is refined around the
> >>>> inclusion boundaries not within them. I heard and read the
> >>>> documentation about  background meshes but I really do not know how
> >>>> to get what I need.
> >>>> 
> >>>> 
> >>>> 
> >>>> Any help would be much appreciated.
> >>>> 
> >>>> 
> >>>> 
> >>>> Best regards, Phu
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>>> _______________________________________________ gmsh mailing list
> >>>> gmsh at geuz.org http://www.geuz.org/mailman/listinfo/gmsh
> >> 
> >> _______________________________________________
> >> gmsh mailing list
> >> gmsh at geuz.org <mailto:gmsh at geuz.org>
> >> http://www.geuz.org/mailman/listinfo/gmsh
> >> <http://www.geuz.org/mailman/listinfo/gmsh>> 
> > <inclusions_new.geo>_______________________________________________
> > gmsh mailing list
> > gmsh at geuz.org <mailto:gmsh at geuz.org>
> > http://www.geuz.org/mailman/listinfo/gmsh
> > <http://www.geuz.org/mailman/listinfo/gmsh>
-------------- next part --------------
a = 1;
r = 0.15;

h  = 0.03;
h2 = 2*h;

// -------------------
// corner points 
// -------------------

Point(1) = {0,0,0,h};
Point(2) = {a,0,0,h};
Point(3) = {a,a,0,h};
Point(4) = {0.,a,0,h};

// -------------------
// inner circle's points
// -------------------

Point(5) = {0.5*a,0.5*a,0,0.06};
Point(6) = {0.5*a+r,0.5*a,0,h};
Point(7) = {0.5*a,0.5*a+r,0,h};
Point(8) = {0.5*a-r,0.5*a,0,h};
Point(9) = {0.5*a,0.5*a-r,0,h};

r2 = 0.1;

Point(10) = {0.8,0.8,0,h2};
Point(11) = {0.8+r2,0.8,0,h};
Point(12) = {0.8,0.8+r2,0,h};
Point(13) = {0.8-r2,0.8,0,h};
Point(14) = {0.8,0.8-r2,0,h};


// -------------------
// outer lines
// -------------------

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

Circle(5) = {6,5,7};
Circle(6) = {7,5,8};
Circle(7) = {8,5,9};
Circle(8) = {9,5,6};

Circle(9)  = {11,10,12};
Circle(10) = {12,10,13};
Circle(11) = {13,10,14};
Circle(12) = {14,10,11};

Line Loop(100) = {1,2,3,4};
Line Loop(200) = {5,6,7,8};
Line Loop(300) = {9,10,11,12};

// -------------------
//  Surfaces
// -------------------

Plane Surface(100) = {100,200,300}; // matrix
Plane Surface(200) = {200};     // aggregate
Plane Surface(300) = {300};     // aggregate


Field[1] = Attractor;
Field[1].NodesList={5}; // node 5, center of the circle is attractor

Field[2] = Threshold;
Field[2].IField=1;
Field[2].LcMin=h2;
Field[2].LcMax=h;
Field[2].DistMin=0.75*r;
Field[2].DistMax=r;

Field[3] = Attractor;
Field[3].NodesList={10}; // node 5, center of the circle is attractor

Field[4] = Threshold;
Field[4].IField=3;
Field[4].LcMin=h2;
Field[4].LcMax=h;
Field[4].DistMin=0.75*r2;
Field[4].DistMax=r2;

Field[5] = Max;
Field[5].FieldsList = {2, 4};
Background Field = 5;

Mesh.CharacteristicLengthExtendFromBoundary = 0;

// ----------------------
// Physcial quantities
// ----------------------

Physical Surface(1) = {100};
Physical Surface(2) = {200,300};

// lower, right, upper, left edges
// opposite edges = same direction

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

// four corner nodes
// left bottom, anti-clockwise

//Physical Point(10) = {36};
//Physical Point(20) = {54};
//Physical Point(30) = {4};
//Physical Point(40) = {18};