[Gmsh] meshing circular inclusions with desired element size

Johannes Wimmer johannes.wimmer at rwth-aachen.de
Tue Jul 21 10:14:23 CEST 2015


Dear Phu,
are your inclusions intersecting the domain boundary? If not, simple
attractors will do.

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
>

-- 
Dipl.-Ing. Johannes Wimmer
RWTH Aachen
Institut für Angewandte Mechanik
Mies-van-der-Rohe-Str.1
D-52074 Aachen

Tel.: +49 (0)241 80 25013
Fax : +49 (0)241 80 22001
www.ifam.rwth-aachen.de
-------------- next part --------------
/********************************************************************* 
 *
 *  Gmsh tutorial 10
 * 
 *  General mesh size fields
 *
 *********************************************************************/

// In addition to specifying target mesh sizes at the points of the
// geometry (see t1) or using a background mesh (see t7), you can use
// general mesh size "Fields". 

// Let's create a simple rectangular geometry
lc = .01;
Point(1) = {0.0,0.0,0,lc}; Point(2) = {1,0.0,0,lc}; 
Point(3) = {1,1,0,lc};     Point(4) = {0,1,0,lc}; 
Point(5) = {0.2,.5,0,lc};

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

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

// Say we would like to obtain mesh elements with size lc/30 near line
// 1 and point 5, and size lc elsewhere. To achieve this, we can use
// two fields: "Attractor", and "Threshold". We first define an
// Attractor field (Field[1]) on points 5 and on line 1. This field
// returns the distance to point 5 and to (100 equidistant points on)
// line 1.
Field[1] = Attractor;
Field[1].NodesList = {5};

// We then define a Threshold field, which uses the return value of
// the Attractor Field[1] in order to define a simple change in
// element size around the attractors (i.e., around point 5
//
// LcMax -                         /------------------
//                               /
//                             /
//                           /
// LcMin -o----------------/
//        |                |       |
//     Attractor       DistMin   DistMax
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc;
Field[2].LcMax = 5*lc;
Field[2].DistMin = 0.3;
Field[2].DistMax = 0.1;

Background Field = 2;

// Don't extend the elements sizes from the boundary inside the domain
Mesh.CharacteristicLengthExtendFromBoundary = 0;