[Gmsh] Meshing is slow because Netgen is too verbose

Serban Georgescu serbange at 09.alumni.u-tokyo.ac.jp
Wed Aug 1 14:39:31 CEST 2012


Hi guys,
 
I am have been using Gmsh for an year or so with very good results (and I am very grateful to the developers for the wonderful work).
Recently, I switched to version 2.6 (from 2.5) and I found that for some of the models the meshing time is much increased.
 
The main reason for this is the large amount of output that Netgen generates.
Basically, Netgen outputs loads of the following Info:
 
…
Info    : Freezone:
Info    : (0, 0, 0)
Info    : (1.2, -5.5e-17, -3.1e-17)
Info    : (-0.45, 1, 2.9e-18)
Info    : (-2.3, 1.2, -0.31)
Info    : (-0.54, 0.74, -0.1)
Info    : (-0.96, 0.74, -0.1)
Info    : (-0.38, 0.38, -0.1)
Info    : Mapping found!!: Rule Tetrahedron Vis a Vis Point with 3 edges (1)
Info    : 3 1 2 7
Info    : 3 = 3
…
 
Here are some results for one of the models:
Gmsh 2.5 -> ~ 6 sec
Gmsh 2.6 with output redirected to file à ~ 11 sec
Gmsh 2.6 with output redirected to /dev/nullà ~ 8 sec
Gmsh 2.6 with manually editingcontrib/Netgen/nglib_gmsh.cpp  by commenting line 75 (//testout = new ostream(new mystreambuf());) and un-commenting  line 66 (testout = new ofstream ("test.out");) à ~ 5 sec
 
So basically, in this case, the extra verbosity from netgen makes the mesher take twice as much.
I have other cases where the increase is much larger.
 
My question (and wish) is:  would it be possible to connect this output to the Gmsh verbosity argument (-v)?
I would be quite happy to (at least try to) add this functionality myself should somebody tell me how could I get access the verbosity value from contrib/Netgen/nglib_gmsh.cpp .
 
Thanks in advance,
Serban