[Gmsh] maybe a bug

Christophe Geuzaine cag32 at case.edu
Tue Sep 27 03:14:07 CEST 2005


Giuseppe Borzi wrote:
> Dear Dr. Geuzaine,
> I think I may have found a bug in gmsh. The gmsh binary compiled with 
> gcc 3.4.3 under Mandrake Linux 10.2, with optimization level 2 (-O2), is 
> unable to build the 3D mesh for the rect.geo file in attach. It starts 
> the meshing, allocate more and more memory until it crashes with the 
> following error message:
> 
> [gborzi at localhost gmsh-1.60.1]$ terminate called after throwing an instance of 'std::bad_alloc'
> 
>   what():  St9bad_alloc
> 
> When compiled with optimization turned off (-O0), gmsh is able to do the 
> meshing, but again allocates a lot of memory (1GB RAM + ~2GB swap). When 
> the lc parameter is set to 0.15 or 0.5 both the optimized and 
> non-optimazed versions work OK.

Yes, I've also had some strange things happening with optimization
turned on with recent versions of gcc.

> I understand that I may annoy you, 

never ;-)

> but I have some other questions:
> 
>    1. When I tried to compile gmsh without optimization I tried
>       /OPTIM=-O0 ./configure/ and also /./configure OPTIM=-O0/, but in
>       each case it uses -O2. I had to change the value in the variables
>       file. How should I give the command to get the right optimization ?

CXXFLAGS=-O0 ./configure


>    2. I'm developing a finite element code (it's still at version 2.0e-4
>       !) with gmsh as the pre and postpocessor. In order to check if a
>       2nd order simplex (triangle or tetrahedra) is curved or not my
>       program checks that the points /pm/ in the middle of the edges are
>       close to the midpoint of the extremes of the edges /p1, p2/, i.e.
>       /norm(pm-0.5*(p1+p2))/norm(p1-p2) < epsnl/, where norm is the
>       1-norm. Is this an overshoot, i.e. there is some better way to do
>       the check ? For example by checking that the average of the points
>       at the vertices is close to the average of the midpoints ? Also I
>       guessed /epsnl = 1.0e-3/, but I'm not sure that this a correct
>       value. May you suggest me a criterion to check the curved elements ?

You should check if the middle-edge points are aligned with the edge
extremities (for all edges).


>    3. When I make a 3D view of the results I do not see a solid figure,
>       but isosurfaces of the solution. Is this the standard behaviour of
>       gmsh or I did something wrong ?

The default is iso-surfaces because if you draw a solid figure you don't 
see anything inside. You can obtain a solid figure by

- either drawing the solution on the faces of the elements
(Options->View->Visibility->Boundary=Dimension-1)

- or extracting the boundary of the volume with Plugin(Skin) (which
will create a new view that contains only the boundary)

Best,

Christophe



> 
> Thank you in advance for your answers, and thanks also for developing gmsh.
> 
> Regards.
> 
> -- 
> Giuseppe Borzi'
> 
> e-mail: gborzi at ieee.org
> http://www.webalice.it/gborzi1/
> Assistant Professor at the Univ. of Messina - Italia
> ----------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> lc = 0.1;
> Point(1) = {0,0,0,lc};
> Point(2) = {1,0,0,lc};
> Point(3) = {1,1,0,lc};
> Point(4) = {0,1,0,lc};
> Line(1) = {1,2};
> Line(2) = {2,3};
> Line(3) = {3,4};
> Line(4) = {4,1};
> Line Loop(5) = {3,4,1,2};
> Plane Surface(6) = {5};
> Extrude Line {3, {0.0,0.0,0.5}};
> Extrude Line {2, {0.0,0.0,0.5}};
> Extrude Line {1, {0.0,0.0,0.5}};
> Extrude Line {4, {0.0,0.0,0.5}};
> Point(9) = {0.5,0.5,0.5,lc};
> Point(10) = {0.75,0.5,0.5,lc};
> Point(11) = {0.5,0.75,0.5,lc};
> Circle(25) = {10,9,11};
> Symmetry { 1.0,0.0,0.0,-0.5 } {
>   Duplicata { Line{25}; }
> }
> Extrude Line {25, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {26, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {30, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {25, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {25, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {27, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {36, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {33, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {39, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {42, {1,0,0.0}, {0.0,0.5,0.5}, Pi/2};
> Extrude Line {19, {0.0,0.0,0.5}};
> Extrude Line {7, {0.0,0.0,0.5}};
> Extrude Line {11, {0.0,0.0,0.5}};
> Extrude Line {15, {0.0,0.0,0.5}};
> Line Loop(67) = {51,63,59,55};
> Plane Surface(68) = {67};
> Line Loop(69) = {15,11,7,19};
> Line Loop(70) = {33,-36,25,-26};
> Plane Surface(71) = {69,70};
> Surface Loop(72) = {22,-6,10,71,18,14,50,44,-41,-47};
> Volume(73) = {72};
> Surface Loop(74) = {35,32,50,44,-41,-38,-29,-47};
> Volume(75) = {74};
> Surface Loop(76) = {54,-71,66,62,58,68,-50,-44,41,47};
> Surface Loop(77) = {38,29,71,-66,-62,-58,-54,-68,-32,-35};
> Volume(78) = {77};
> Physical Surface(1) = {22,54};
> Physical Surface(2) = {14,62};
> Physical Surface(3) = {18,66};
> Physical Surface(4) = {58,10};
> Physical Surface(5) = {6};
> Physical Surface(6) = {68};
> Physical Surface(7) = {35,32,44,50,47,29,38,41};
> Physical Volume(1) = {73,78};
> Physical Volume(2) = {75};
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh


-- 
Christophe Geuzaine
Assistant Professor, Case University, Mathematics
http://www.case.edu/artsci/math/geuzaine