[Gmsh] GModel->mesh() from API

Cosmin Deaconu cozzyd at MIT.EDU
Fri Nov 22 19:04:54 CET 2013


Hello experts, 

I'm using the C++ API to generate the geometry for a model and I have
come across a problem with the GModel->mesh() method. If I generate my
model, save it as a .geo file and then run

gmsh -3 test.geo 

it works fine. However, if inside my c++ program I call 

m->mesh(3) 


I get lots of output like

Info    : Reparameterizing point 3 on face 3
Info    : point -2 -2 0.5 : Relaxation factor = 0.75
Info    : point -2 -2 0.5 : Relaxation factor = 0.5625
Info    : point -2 -2 0.5 : Relaxation factor = 0.421875
Info    : point -2 -2 0.5 : Relaxation factor = 0.316406
Info    : point -2 -2 0.5 : Relaxation factor = 0.237305
Info    : point -2 -2 0.5 : Relaxation factor = 0.177979
Info    : point -2 -2 0.5 : Relaxation factor = 0.133484
Info    : point -2 -2 0.5 : Relaxation factor = 0.100113
Info    : point -2 -2 0.5 : Relaxation factor = 0.0750847
Info    : point -2 -2 0.5 : Relaxation factor = 0.0563135
Info    : point -2 -2 0.5 : Relaxation factor = 0.0422351
Info    : point -2 -2 0.5 : Relaxation factor = 0.0316764
Info    : point -2 -2 0.5 : Relaxation factor = 0.0237573
Info    : point -2 -2 0.5 : Relaxation factor = 0.0178179
Info    : point -2 -2 0.5 : Relaxation factor = 0.0133635
Info    : point -2 -2 0.5 : Relaxation factor = 0.0100226
Info    : point -2 -2 0.5 : Relaxation factor = 0.00751695
Info    : point -2 -2 0.5 : Relaxation factor = 0.00563771
Info    : point -2 -2 0.5 : Relaxation factor = 0.00422828
Info    : point -2 -2 0.5 : Relaxation factor = 0.00317121
Info    : point -2 -2 0.5 : Relaxation factor = 0.00237841
Info    : point -2 -2 0.5 : Relaxation factor = 0.00178381
Info    : point -2 -2 0.5 : Relaxation factor = 0.00133786
Info    : point -2 -2 0.5 : Relaxation factor = 0.00100339
Info    : point -2 -2 0.5 : Relaxation factor = 0.000752543
Info    : point -2 -2 0.5 : Relaxation factor = 0.000564408
Warning : Converged for i=8 j=2 (err=1.71294e-08 iter=2) BUT xyz error =
1.76838 in point (-2.000000e+00,-2.000000e+00,5.000000e-01) on surface 3


and in the end (after it takes forever), I get no mesh:

Error   : Self intersecting surface mesh, computing intersections (this
could take a while)
  Initializing memorypools.
  Size of a point: 128 bytes.
  Size of a tetrahedron: 96 (96) bytes.
  Size of a shellface: 192 (192) bytes.
Error:  The point set is trivial.
Error   : Surface mesh is wrong, cannot do the 3D mesh
Info    : Done meshing 3D (0.001 s)
Info    : 678 vertices 702 elements
Error   : ------------------------------
Error   : Mesh generation error summary
Error   :  1340 warnings
Error   :    12 errors
Error   : Check the full log for details
Error   : --------



This occurs only for ruled faces (geometries that only use planar faces
give the same output with both methods).  This issue occurs with both
the latest source release on the web site as well as the svn version
from last night.

To compile my c++ program, I'm just linking with -lGmsh (I configured
the gmsh install to create the shared library). 


Thanks,


-- 
---
Cosmin Deaconu
PhD Candidate in Experimental Particle Physics 
Massachusetts Institute of Technology / Laboratory for Nuclear Science
77 Massachusetts Ave, #26-456, Cambridge, MA 02139 
(617) 253-1593 (office)
(775) 846-9105 (cell)