Discussion:
[Gmsh] Question about mesh refinement with stating of characteristic lengths
Moritz Nadler
2008-07-09 15:59:48 UTC
Permalink
Hallo ,


while creating my second mesh with gmesh I ran a problem:

I have created a mesh with
gmsh -rand 1.e-8 lightmillPeriodic.geo -2
and this .geo file:

//begin file
highPr = 0.000015;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;

Point(1) = {0,0,0,highPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,highPr};

// dummy point to lower the mesh density in this area (does not work)
Point(22) = {0.25E-2,0.275E-2,0,midPr};

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

Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
// end file

But as it is stated in the gmsh manual
"The size of the mesh elements will
then be computed by linearly interpolating these characteristic lengths on the
initial
mesh (see Section 1.2 [Mesh], page 3). This might sometimes lead to over-refinement
in some areas"

it did lead to some over-refinement in areas where I do not need a high mesh density

so I wanted to:
"so that you may have to add “dummy” geometrical entities in the model
in order to get the desired element sizes."

so I added a first dummy point (the point with the comment in my .geo file) with
a lower ch. length to lower the mesh density in that area but the point is
totally ignored by the meshing routine; it is not even used as a node.


I hope I could explain what I want to do my question then is of course:
what to do to do it right?


Thanks very much and

kind regards


Moritz Nadler
David Colignon
2008-07-09 16:16:52 UTC
Permalink
Hi,

it doesn't work because a dummy point is not enough, the dummy point must be part of a dummy line, which must be part of a dummy surface.

Or you can have a look at:

http://www.geuz.org/pipermail/gmsh/2008/003141.html

Cheers,

Dave
--
David Colignon, Ph.D.
Collaborateur Logistique F.R.S.-FNRS (Equipements de Calcul Intensif)
ACE - Applied & Computational Electromagnetics
Institut Montefiore B28
Université de Liège
4000 Liège - BELGIQUE
Tél: +32 (0)4 366 37 32
Fax: +32 (0)4 366 29 10
WWW: http://www.montefiore.ulg.ac.be/personnel.php?op=detail&id=898
Agenda: http://www.google.com/calendar/embed?src=david.colignon%40gmail.com
Post by Moritz Nadler
Hallo ,
I have created a mesh with
gmsh -rand 1.e-8 lightmillPeriodic.geo -2
//begin file
highPr = 0.000015;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;
Point(1) = {0,0,0,highPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,highPr};
// dummy point to lower the mesh density in this area (does not work)
Point(22) = {0.25E-2,0.275E-2,0,midPr};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(6) = {6,7};
Line(7) = {7,8};
Line(8) = {8,9};
Line(9) = {9,10};
Line(10) = {10,11};
//Line(11) = {11,12};
//Line(12) = {12,13};
Circle(11) = {11,1,13};
Line(13) = {13,14};
Line(14) = {14,15};
Line(15) = {15,16};
Line(16) = {16,17};
Line(17) = {17,18};
Line(18) = {18,19};
Line(19) = {19,20};
Line(20) = {20,21};
Line(21) = {21,1};
Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
// end file
But as it is stated in the gmsh manual
"The size of the mesh elements will
then be computed by linearly interpolating these characteristic lengths on the
initial
mesh (see Section 1.2 [Mesh], page 3). This might sometimes lead to over-refinement
in some areas"
it did lead to some over-refinement in areas where I do not need a high mesh density
"so that you may have to add “dummy” geometrical entities in the model
in order to get the desired element sizes."
so I added a first dummy point (the point with the comment in my .geo file) with
a lower ch. length to lower the mesh density in that area but the point is
totally ignored by the meshing routine; it is not even used as a node.
what to do to do it right?
Thanks very much and
kind regards
Moritz Nadler
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
Moritz Nadler
2008-07-10 12:39:15 UTC
Permalink
Thanks for you fast reply but do not get what I have to do.

I tried to make a dummy surface out of the dummy point but I failed
I would be great if somebody could give me an example of a dummy geometry for
changing the local mesh refinement so I can understand how I have to do it.

kind regards


Moritz


//my current .geo file with a non working dummy geometry
highPr = 0.000015;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;

Point(1) = {0,0,0,highPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,highPr};

// dummy gemetrey to lower the mesh density in this area (does not work)
Point(100) = {0.25E-2,0.275E-2,0,midPr};
Line(100) = {100,100};
Line Loop(101) = {100, 100};
Plane Surface(102) = {101};

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

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

//end file
Post by David Colignon
Hi,
it doesn't work because a dummy point is not enough, the dummy point
must be part of a dummy line, which must be part of a dummy surface.
http://www.geuz.org/pipermail/gmsh/2008/003141.html
Cheers,
Dave
Christophe Geuzaine
2008-07-10 12:54:35 UTC
Permalink
Post by Moritz Nadler
Thanks for you fast reply but do not get what I have to do.
I tried to make a dummy surface out of the dummy point but I failed
I would be great if somebody could give me an example of a dummy geometry for
changing the local mesh refinement so I can understand how I have to do it.
You can use Fields to impose characteristic lengths outside the geometry.

See demos/fields.geo for an example.
Post by Moritz Nadler
kind regards
Moritz
//my current .geo file with a non working dummy geometry
highPr = 0.000015;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;
Point(1) = {0,0,0,highPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,highPr};
// dummy gemetrey to lower the mesh density in this area (does not work)
Point(100) = {0.25E-2,0.275E-2,0,midPr};
Line(100) = {100,100};
Line Loop(101) = {100, 100};
Plane Surface(102) = {101};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(6) = {6,7};
Line(7) = {7,8};
Line(8) = {8,9};
Line(9) = {9,10};
Line(10) = {10,11};
//Line(11) = {11,12};
//Line(12) = {12,13};
Circle(11) = {11,1,13};
Line(13) = {13,14};
Line(14) = {14,15};
Line(15) = {15,16};
Line(16) = {16,17};
Line(17) = {17,18};
Line(18) = {18,19};
Line(19) = {19,20};
Line(20) = {20,21};
Line(21) = {21,1};
Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
//end file
Post by David Colignon
Hi,
it doesn't work because a dummy point is not enough, the dummy point
must be part of a dummy line, which must be part of a dummy surface.
http://www.geuz.org/pipermail/gmsh/2008/003141.html
Cheers,
Dave
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Moritz Nadler
2008-07-10 15:30:26 UTC
Permalink
Hallo,

I tried so somehow use the fields demo file in my geometry without really
understanding it. This did not work, when I compile my .geo I get a mesh with
way to much elements. The large ch. lengths of the "outer" point are being
ignored now.

I tried to read about fields in the manual but I could not really get the
concept why so many different "fields" are needed to just fully define one for
example what the background field is good for...

What I want I if a fine mesh around line 3 and 7 and point 16 19 which I have
now but in the rest of the domain the mesh density should still correspond to
the large ch length defined in the points there which I do not have.


What to do to get this?

kind regards

Moritz Nadler


//my current .geo file with too high element density
highPr = 0.0002;
argPr = 0.00004;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;

Point(1) = {0,0,0,argPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,argPr};

Field[1] = Attractor;
Field[1].NNodesByEdge = 100;
Field[1].NodesList = {16,19};
Field[1].EdgesList = {3,7};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = 0.000015;
Field[2].LcMax = midPr;
Field[2].DistMin = 0.025E-2;
Field[2].DistMax = 0.25E-2;

Field[4] = Min;
Field[4].FieldsList = {2};

Background Field = 4;


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

Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
// end of file
Post by Christophe Geuzaine
You can use Fields to impose characteristic lengths outside the geometry.
See demos/fields.geo for an example.
Christophe Geuzaine
2008-07-10 16:39:16 UTC
Permalink
Post by Moritz Nadler
Hallo,
I tried so somehow use the fields demo file in my geometry without really
understanding it. This did not work, when I compile my .geo I get a mesh with
way to much elements. The large ch. lengths of the "outer" point are being
ignored now.
I tried to read about fields in the manual but I could not really get the
concept why so many different "fields" are needed to just fully define one for
example what the background field is good for...
What I want I if a fine mesh around line 3 and 7 and point 16 19 which I have
now but in the rest of the domain the mesh density should still correspond to
the large ch length defined in the points there which I do not have.
Just set LcMax to the largest char length in the model. The eventual
mesh size os computed as the minimum of all prescribed sizes (at points,
using fields, using a background mesh, using curvatures, etc.).


//my current .geo file with too high element density
highPr = 0.0002;
argPr = 0.00004;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;

Point(1) = {0,0,0,argPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,argPr};

Field[1] = Attractor;
Field[1].NNodesByEdge = 100;
Field[1].NodesList = {16,19};
Field[1].EdgesList = {3,7};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = highPr;
Field[2].LcMax = vLowPr;
Field[2].DistMin = 0.002;
Field[2].DistMax = 0.008;

Background Field = 2;

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

Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
// end of file
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Moritz Nadler
2008-07-21 14:51:13 UTC
Permalink
Hallo,

I played a bit around the field commands which I still do not really understand
(and the manual does not say much about them), but I am not satisfied with my
results.

How can I get soother changes in the element density where the fields are connected.
I thought of something where you can state the length of a gradual change in the
element density between the density of one entity and its neighbour.

I fist thought the .DistMax statement is something like that but it seems to be
ignored in general.
.DistMin determines the size of a Field but DistMax does not do anything.

So my question is:

Is there a way to get gradual changes in the element densities similar to the
ones created by only stating characteristic length at the point definitions
without any fields when using fields.


kind regards


Moritz
Post by Christophe Geuzaine
Post by Moritz Nadler
Hallo,
I tried so somehow use the fields demo file in my geometry without
really understanding it. This did not work, when I compile my .geo I
get a mesh with way to much elements. The large ch. lengths of the
"outer" point are being ignored now.
I tried to read about fields in the manual but I could not really get
the concept why so many different "fields" are needed to just fully
define one for example what the background field is good for...
What I want I if a fine mesh around line 3 and 7 and point 16 19 which
I have now but in the rest of the domain the mesh density should still
correspond to the large ch length defined in the points there which I
do not have.
Just set LcMax to the largest char length in the model. The eventual
mesh size os computed as the minimum of all prescribed sizes (at points,
using fields, using a background mesh, using curvatures, etc.).
//my current .geo file with too high element density
highPr = 0.0002;
argPr = 0.00004;
midPr = 0.0002;
lowPr = 0.0006;
vLowPr = 0.001;
Point(1) = {0,0,0,argPr};
Point(2) = {0.25E-2,0,0,midPr};
Point(3) = {0.5E-2,0,0,highPr};
Point(4) = {0.5E-2,0.025E-2,0,highPr};
Point(5) = {0.75E-2,0.025E-2,0,midPr};
Point(6) = {2.25E-2,0.025E-2,0,midPr};
Point(7) = {2.5E-2,0.025E-2,0,highPr};
Point(8) = {2.5E-2,0,0,highPr};
Point(9) = {2.75E-2,0,0,midPr};
Point(10) = {4E-2,0,0,lowPr};
Point(11) = {9.5E-2,0,0,vLowPr};
Point(13) = {0,9.525E-2,0,vLowPr};
Point(14) = {0,4.025E-2,0,lowPr};
Point(15) = {0,2.775E-2,0,midPr};
Point(16) = {0,2.525E-2,0,highPr};
Point(17) = {0,2.275E-2,0,midPr};
Point(18) = {0,0.775E-2,0,midPr};
Point(19) = {0,0.525E-2,0,highPr};
Point(20) = {0,0.275E-2,0,midPr};
Point(21) = {0,0.025E-2,0,argPr};
Field[1] = Attractor;
Field[1].NNodesByEdge = 100;
Field[1].NodesList = {16,19};
Field[1].EdgesList = {3,7};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = highPr;
Field[2].LcMax = vLowPr;
Field[2].DistMin = 0.002;
Field[2].DistMax = 0.008;
Background Field = 2;
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(6) = {6,7};
Line(7) = {7,8};
Line(8) = {8,9};
Line(9) = {9,10};
Line(10) = {10,11};
Circle(11) = {11,1,13};
Line(13) = {13,14};
Line(14) = {14,15};
Line(15) = {15,16};
Line(16) = {16,17};
Line(17) = {17,18};
Line(18) = {18,19};
Line(19) = {19,20};
Line(20) = {20,21};
Line(21) = {21,1};
Line Loop(22) = {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21};
Plane Surface(23) = {22};
// end of file
Christophe Geuzaine
2008-07-21 18:19:47 UTC
Permalink
Post by Moritz Nadler
Hallo,
I played a bit around the field commands which I still do not really understand
(and the manual does not say much about them), but I am not satisfied with my
results.
How can I get soother changes in the element density where the fields are connected.
I thought of something where you can state the length of a gradual change in the
element density between the density of one entity and its neighbour.
I fist thought the .DistMax statement is something like that but it seems to be
ignored in general.
.DistMin determines the size of a Field but DistMax does not do anything.
It does... The threshold field works like this:

LcMax - /------------------
/
/
/
LcMin -o----------------/
| | |
Attractor DistMin DistMax

At the moment the variation between LcMin and LcMax is always linear. It
might be nice to code other variations (power, log, ...): have a look at
Mesh/Field.cpp if you want to do that.

Here's an example:

// linear grading of charact lengths, from lc1 (near the attractor
// points) to lc2 (at a distance >= r away from the attractor points)

lc1 = 0.001;
lc2 = 0.1;
r = 0.5;

Point(1) = {0,0,0,lc2};
Point(2) = {1,0,0,lc2};
Point(3) = {1,1,0,lc2};
Point(4) = {0,1,0,lc2};
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};

Point(10) = {0.3,0.5,0};
Point(11) = {0.35,0.5,0};

Field[1] = Attractor;
Field[1].NodesList = {10,11};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc1;
Field[2].LcMax = lc2;
Field[2].DistMin = lc1;
Field[2].DistMax = r;

Background Field = 2;
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Moritz Nadler
2008-07-22 13:00:28 UTC
Permalink
Good Day Mr Geuzaine,

I tried to rebuild the example with slightly different values but I failed. I
looked at it a over an hour but I simple cannot find the error.

The example you sent me works fine when compile with the command:
gmsh -rand 1.e-8 example.geo -2

But this example:

//begin "my example"
lowPr = 0.1;

Point(1) = {0,0,0,lowPr};
Point(2) = {1,0,0,lowPr};
Point(3) = {1,1,0,lowPr};
Point(4) = {0,1,0,lowPr};
Point(5) = {0.5,0.5,0,0};

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

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

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

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = 0.0001;
Field[2].LcMax = lowPr;
Field[2].DistMin = 0.005;
Field[2].DistMax = 0.01;

Background Field = 2;

//end "my example"

compiled with the same command does not.
There is no higher mesh dentistry in the middle of the mesh as one would expect
form the code.


kind regards


Moritz Nadler
Post by Christophe Geuzaine
LcMax - /------------------
/
/
/
LcMin -o----------------/
| | |
Attractor DistMin DistMax
At the moment the variation between LcMin and LcMax is always linear. It
might be nice to code other variations (power, log, ...): have a look at
Mesh/Field.cpp if you want to do that.
// linear grading of charact lengths, from lc1 (near the attractor
// points) to lc2 (at a distance >= r away from the attractor points)
lc1 = 0.001;
lc2 = 0.1;
r = 0.5;
Point(1) = {0,0,0,lc2};
Point(2) = {1,0,0,lc2};
Point(3) = {1,1,0,lc2};
Point(4) = {0,1,0,lc2};
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};
Point(10) = {0.3,0.5,0};
Point(11) = {0.35,0.5,0};
Field[1] = Attractor;
Field[1].NodesList = {10,11};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc1;
Field[2].LcMax = lc2;
Field[2].DistMin = lc1;
Field[2].DistMax = r;
Background Field = 2;
Christophe Geuzaine
2008-07-25 15:25:29 UTC
Permalink
Post by Moritz Nadler
Good Day Mr Geuzaine,
I tried to rebuild the example with slightly different values but I
failed. I looked at it a over an hour but I simple cannot find the error.
gmsh -rand 1.e-8 example.geo -2
//begin "my example"
lowPr = 0.1;
Point(1) = {0,0,0,lowPr};
Point(2) = {1,0,0,lowPr};
Point(3) = {1,1,0,lowPr};
Point(4) = {0,1,0,lowPr};
Point(5) = {0.5,0.5,0,0};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5};
Field[1] = Attractor;
Field[1].NodesList = {5};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = 0.0001;
Field[2].LcMax = lowPr;
Field[2].DistMin = 0.005;
Field[2].DistMax = 0.01;
Background Field = 2;
//end "my example"
compiled with the same command does not.
There is no higher mesh dentistry in the middle of the mesh as one would
expect form the code.
Indeed. The problem comes from the fact that DistMax is smaller than
LcMax. During the refinement step the algorithm just (unluckily) never
inserts a point inside the small DistMax-radius disk, and so ignores the
constraint altogether. That's definitely a limitation of our current
implementation.

It should work if you set Field[2].DistMax=lowPr. With the last nightly
build you can also ask to use a sigmoid transition instead of a linear
transition (Field[2].Sigmoid=1;)
Post by Moritz Nadler
kind regards
Moritz Nadler
Post by Christophe Geuzaine
LcMax - /------------------
/
/
/
LcMin -o----------------/
| | |
Attractor DistMin DistMax
At the moment the variation between LcMin and LcMax is always linear.
It might be nice to code other variations (power, log, ...): have a
look at Mesh/Field.cpp if you want to do that.
// linear grading of charact lengths, from lc1 (near the attractor
// points) to lc2 (at a distance >= r away from the attractor points)
lc1 = 0.001;
lc2 = 0.1;
r = 0.5;
Point(1) = {0,0,0,lc2};
Point(2) = {1,0,0,lc2};
Point(3) = {1,1,0,lc2};
Point(4) = {0,1,0,lc2};
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};
Point(10) = {0.3,0.5,0};
Point(11) = {0.35,0.5,0};
Field[1] = Attractor;
Field[1].NodesList = {10,11};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc1;
Field[2].LcMax = lc2;
Field[2].DistMin = lc1;
Field[2].DistMax = r;
Background Field = 2;
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Loading...