Discussion:
[Gmsh] Characteristic length
Jö Fahlke
2011-02-14 14:17:38 UTC
Permalink
Hi!

What exactly is the characteristic length? If I set

Mesh.CharacteristicLengthMax = 0.05;

I get edge lengthes up to 0.104493. Or is there a better way to limit edge
lengthes?

Thanks,
Jö.
--
This is the first age that's paid much attention to the future, which
is a little ironic since we may not have one.
-- Arthur C Clarke
David Colignon
2011-02-14 14:49:58 UTC
Permalink
Hi,

do a search with the keyword "characteristic" on this page: https://geuz.org/gmsh/doc/texinfo/gmsh.html

and/or see http://geuz.org/gmsh/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes

Regards,

Dave
--
David Colignon, Ph.D.
Collaborateur Logistique du F.R.S.-FNRS
CÉCI - Consortium des Équipements de Calcul Intensif
ACE - Applied & Computational Electromagnetics
Sart-Tilman 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://hpc.montefiore.ulg.ac.be/
Agenda: http://www.google.com/calendar/embed?src=david.colignon%40gmail.com
Post by Jö Fahlke
Hi!
What exactly is the characteristic length? If I set
Mesh.CharacteristicLengthMax = 0.05;
I get edge lengthes up to 0.104493. Or is there a better way to limit edge
lengthes?
Thanks,
Jö.
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
Jö Fahlke
2011-02-14 15:31:08 UTC
Permalink
I can think of several meanings for "characteristic length" (or "elements
size" for that matter):

* The length of the mesh elements' edges,
* the cubic root of the mesh elements' volume,
* the diameter of the circumscribed sphere of the mesh elements, or
* the radius of the circumscribed sphere of the mesh elements.

There are probably more possibilities. What I want to know is whether gmsh
follows a one consistent meaning for the characteristic length, and if yes,
which one.

(More accurately, I want to limit the edge sizes in the grid, an I suspect the
characteristic length can be used for that, but I can't figure out how
exactly. The obvious approach of "max characteristic length" == "max edge
size" did not work, see my first mail.)
Post by David Colignon
do a search with the keyword "characteristic" on this page: https://geuz.org/gmsh/doc/texinfo/gmsh.html
and/or see http://geuz.org/gmsh/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes
I did, but I could not find an answer to the above question. The closest to
an explanation of the meaning of the characteristic length was

| Every meshing step is constrained by a “size field” (sometimes called
| “characteristic length field”), which prescribes the desired size of the
| elements in the mesh.

(from section 1.2 "Mesh: finite element mesh generation"), which links the
characteristic length to the mesh element size, but does not explain how the
mesh element size is measured or how exactly it is linked to the
characteristic length.

Thanks,
Jö.
--
If God had intended Man to Smoke, He would have set him on Fire.
-- fortune
Andres Gonzalez Estrada
2012-08-20 15:50:15 UTC
Permalink
Does anyone have a clue about how gmsh interpret the characteristic lenght?. The problem has been described before in several post with no successful reply, e.g.:

*Jö Fahlke*
jorrit at jorrit.de <mailto:gmsh%40geuz.org?Subject=Re%3A%20%5BGmsh%5D%20Characteristic%20length&In-Reply-To=%3C20110214153108.GZ1523%40paranoia%3E>

/Mon Feb 14 16:31:08 CET 2011/

I can think of several meanings for "characteristic length" (or "elements
size" for that matter):

* The length of the mesh elements' edges,
* the cubic root of the mesh elements' volume,
* the diameter of the circumscribed sphere of the mesh elements, or
* the radius of the circumscribed sphere of the mesh elements.

There are probably more possibilities. What I want to know is whether gmsh
follows a one consistent meaning for the characteristic length, and if yes,
which one.

(More accurately, I want to limit the edge sizes in the grid, an I suspect the
characteristic length can be used for that, but I can't figure out how
exactly. The obvious approach of "max characteristic length" == "max edge
size" did not work, see my first mail.)
/ do a search with the keyword "characteristic" on this page:https://geuz.org/gmsh/doc/texinfo/gmsh.html
/>/
/>/ and/or seehttp://geuz.org/gmsh/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes
/
I did, but I could not find an answer to the above question. The closest to
an explanation of the meaning of the characteristic length was

|/ Every meshing step is constrained by a "size field" (sometimes called
/|/ "characteristic length field"), which prescribes the desired size of the
/|/ elements in the mesh.
/
(from section 1.2 "Mesh: finite element mesh generation"), which links the
characteristic length to the mesh element size, but does not explain how the
mesh element size is measured or how exactly it is linked to the
characteristic length.

Thanks,
Jö.
--
--
Octavio Andrés González Estrada
Research Associate
Institute of Mechanics and Advanced Materials
Cardiff School of Engineering
Cardiff University
The Parade
Cardiff CF24 3AA, Wales, UK

Email: ***@gmail.com
***@cardiff.ac.uk
Christophe Geuzaine
2012-08-20 18:53:23 UTC
Permalink
Hi Jo - it's the length of mesh edges.

Christophe
Post by Andres Gonzalez Estrada
Jö Fahlke
jorrit at jorrit.de
Mon Feb 14 16:31:08 CET 2011
I can think of several meanings for "characteristic length" (or "elements
* The length of the mesh elements' edges,
* the cubic root of the mesh elements' volume,
* the diameter of the circumscribed sphere of the mesh elements, or
* the radius of the circumscribed sphere of the mesh elements.
There are probably more possibilities. What I want to know is whether gmsh
follows a one consistent meaning for the characteristic length, and if yes,
which one.
(More accurately, I want to limit the edge sizes in the grid, an I suspect the
characteristic length can be used for that, but I can't figure out how
exactly. The obvious approach of "max characteristic length" == "max edge
size" did not work, see my first mail.)
do a search with the keyword "characteristic" on this page: https://geuz.org/gmsh/doc/texinfo/gmsh.html
Post by David Colignon
and/or see http://geuz.org/gmsh/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes
I did, but I could not find an answer to the above question. The closest to
an explanation of the meaning of the characteristic length was
|
Every meshing step is constrained by a “size field” (sometimes called
|
“characteristic length field”), which prescribes the desired size of the
|
elements in the mesh.
(from section 1.2 "Mesh: finite element mesh generation"), which links the
characteristic length to the mesh element size, but does not explain how the
mesh element size is measured or how exactly it is linked to the
characteristic length.
Thanks,
Jö.
--
--
Octavio Andrés González Estrada
Research Associate
Institute of Mechanics and Advanced Materials
Cardiff School of Engineering
Cardiff University
The Parade
Cardiff CF24 3AA, Wales, UK
_______________________________________________
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
Christophe Geuzaine
2012-08-21 00:25:29 UTC
Permalink
Post by Christophe Geuzaine
Hi Jo - it's the length of mesh edges.
It wasn't me who asked the question this time -- but I'll join the discussion
anyway.
I'm assuming you mean the characteristic length is an upper limit for the edge
length. But that can't be true, or at least there is something missing. In
3D, if I remember correctly, the maximum edge length is usually something like
twice the characteristic length.
To illustrate, please find attached the simple example
unit-square.{geo,msh,pdf}. The mesh was generated with gmsh 2.6.1.dfsg-3 from
Debian. The unit square has a side length of 1, and I used a characteristic
length of 0.1 (by setting the characteristic length at the Points). As you
can see, each side of the unit square is devided into 9 segments, which means
the size of at least one of the segments must be larger than the
characteristic length.
It's just a small numerical integration error (computing the mesh spacing in the 1D meshing algorithm is obtained through integration--see the Gmsh paper for more info). Thus try e.g.

Point(1) = {0, 0, 0, 0.09999};
Extrude {1, 0, 0} {
Point{1};
}
Extrude {0, 1, 0} {
Line{1};
}

and you will indeed get 10 elements on each side. You could also add

Mesh.Algorithm=6;//frontal-delaunay

top get a more regular surface mesh, made of quasi-equilateral triangles.

Note that in all cases, the final surface or volume mesh will never have edges that are all *exactly* equal to the prescribed size. The efficiency index of a typical mesh will be around 0.8 (see the Gmsh paper for the definition).

Also note that in 3D only the Delaunay algorithm will respect the prescribed mesh size field. The frontal algorithm based on Netgen does not: it will only do its best to propagate the mesh size information from the boundaries.

Hope this helps,

Christophe
Regards,
Jö.
--
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884
[Zum Thema GNOME 3]
(15:11:22) marina: linus ist auf meiner seite
<unit-square.geo><unit-square.msh><unit-square.pdf>
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Andres Gonzalez Estrada
2012-08-21 08:30:22 UTC
Permalink
Thanks for your reply Christophe.

My concern arises from the fact that I'm using gmsh with an adaptive
routine, I give the size of the element and get the new desired size.
Of course the definition of what is the element size should be
consistent with the approach used by gmsh. So far I'm using
h=(Volume/2)^(1/2) as an approximation to the size but I'm not sure this
is fair enough.

Best,

--
Octavio Andrés González Estrada
Research Associate
Institute of Mechanics and Advanced Materials
Cardiff School of Engineering
Cardiff University
The Parade
Cardiff CF24 3AA, Wales, UK
Post by Christophe Geuzaine
Post by Christophe Geuzaine
Hi Jo - it's the length of mesh edges.
It wasn't me who asked the question this time -- but I'll join the discussion
anyway.
I'm assuming you mean the characteristic length is an upper limit for the edge
length. But that can't be true, or at least there is something missing. In
3D, if I remember correctly, the maximum edge length is usually something like
twice the characteristic length.
To illustrate, please find attached the simple example
unit-square.{geo,msh,pdf}. The mesh was generated with gmsh 2.6.1.dfsg-3 from
Debian. The unit square has a side length of 1, and I used a characteristic
length of 0.1 (by setting the characteristic length at the Points). As you
can see, each side of the unit square is devided into 9 segments, which means
the size of at least one of the segments must be larger than the
characteristic length.
It's just a small numerical integration error (computing the mesh spacing in the 1D meshing algorithm is obtained through integration--see the Gmsh paper for more info). Thus try e.g.
Point(1) = {0, 0, 0, 0.09999};
Extrude {1, 0, 0} {
Point{1};
}
Extrude {0, 1, 0} {
Line{1};
}
and you will indeed get 10 elements on each side. You could also add
Mesh.Algorithm=6;//frontal-delaunay
top get a more regular surface mesh, made of quasi-equilateral triangles.
Note that in all cases, the final surface or volume mesh will never have edges that are all *exactly* equal to the prescribed size. The efficiency index of a typical mesh will be around 0.8 (see the Gmsh paper for the definition).
Also note that in 3D only the Delaunay algorithm will respect the prescribed mesh size field. The frontal algorithm based on Netgen does not: it will only do its best to propagate the mesh size information from the boundaries.
Hope this helps,
Christophe
Regards,
Jö.
--
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884
[Zum Thema GNOME 3]
(15:11:22) marina: linus ist auf meiner seite
<unit-square.geo><unit-square.msh><unit-square.pdf>
Jö Fahlke
2012-08-26 12:31:32 UTC
Permalink
Hi Christophe,

thanks for your answer, I think it finally help clearing up my biggest
misunderstanding about the characteristic length :)
Post by Christophe Geuzaine
I'm assuming you mean the characteristic length is an upper limit for the edge
length. But that can't be true, or at least there is something missing. In
3D, if I remember correctly, the maximum edge length is usually something like
twice the characteristic length.
Alright, that assumption is wrong (see below), ...
Post by Christophe Geuzaine
To illustrate, please find attached the simple example
[...]
Post by Christophe Geuzaine
It's just a small numerical integration error (computing the mesh spacing in the 1D meshing algorithm is obtained through integration--see the Gmsh paper for more info). Thus try e.g.
Point(1) = {0, 0, 0, 0.09999};
Extrude {1, 0, 0} {
Point{1};
}
Extrude {0, 1, 0} {
Line{1};
}
...which, together with rounding down, explains how a numerical error can
cause 9 segments, where I would have expected all it can cause is 11 segments.
Post by Christophe Geuzaine
and you will indeed get 10 elements on each side. You could also add
Mesh.Algorithm=6;//frontal-delaunay
top get a more regular surface mesh, made of quasi-equilateral triangles.
Note that in all cases, the final surface or volume mesh will never have edges that are all *exactly* equal to the prescribed size. The efficiency index of a typical mesh will be around 0.8 (see the Gmsh paper for the definition).
I was more interested in and upper limit on the size of the edges, i.e. edges
are guaranteed to be smaller than that limit. Although I have to say that for
me this feature was more a nice-to-have and isn't a current issue anymore.
Post by Christophe Geuzaine
Also note that in 3D only the Delaunay algorithm will respect the prescribed mesh size field. The frontal algorithm based on Netgen does not: it will only do its best to propagate the mesh size information from the boundaries.
Considering a homogeneous mesh size field, does that mean the mesh size
information for both Delaunay and Netgen will be same?



Having looked a bit closer at the paper, it is my understanding that:

1. The characteristic length in itself is not an upper limit of the edge
length, rather, it is considered the optimal edge length. Both longer and
shorter edges are allowed, but penalized and lead to a lower efficiency
index (equation (2)).

2. For *2D* using MeshAdapt (as described in the paper): the algorithm tries
hard to keep the edge length within a range of 0.7 to 1.4 times the
characteristic length.

Even considering the paper, the 9-mesh-edges-per-model-edge phenomenon still
required some guessing to explain. Consider equation (3), which is used to
calculate the number of mesh edges per model edge. In the case of
unit-square.geo it *should* yield N=10, but due to numerical errors it *may*
yield something like N=0.9999 or N=10.0001. I suppose the actual integral N
is obtained by using truncate() or similar (like simply assigning a double to
an integer); that would explain the observed behaviour.

But it seems strange to me that truncate() is used here -- in ~50% of cases it
will lead to a larger deviation from the characteristic length than necessary.
Rather, I would have expected something like round(), or even something a
little more elaborate.

Am I totally off-track, or is there a reason for using truncation rather than
rounding, or was it just not considered an issue? After all, it doesn't make
much of a difference for large N...

Regards,
Jö.
--
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884

Interpunktion, Orthographie und Grammatik der Email ist frei erfunden.
Eine Übereinstimmung mit aktuellen oder ehemaligen Regeln wäre rein
zufällig und ist nicht beabsichtigt.
Jö Fahlke
2012-08-20 20:58:32 UTC
Permalink
Post by Christophe Geuzaine
Hi Jo - it's the length of mesh edges.
It wasn't me who asked the question this time -- but I'll join the discussion
anyway.

I'm assuming you mean the characteristic length is an upper limit for the edge
length. But that can't be true, or at least there is something missing. In
3D, if I remember correctly, the maximum edge length is usually something like
twice the characteristic length.

To illustrate, please find attached the simple example
unit-square.{geo,msh,pdf}. The mesh was generated with gmsh 2.6.1.dfsg-3 from
Debian. The unit square has a side length of 1, and I used a characteristic
length of 0.1 (by setting the characteristic length at the Points). As you
can see, each side of the unit square is devided into 9 segments, which means
the size of at least one of the segments must be larger than the
characteristic length.

Regards,
Jö.
--
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884

[Zum Thema GNOME 3]
(15:11:22) marina: linus ist auf meiner seite
Loading...