[Gmsh] gmsh1.65.0 Irix-patch, bug

Philip Kelleners P.H.Kelleners at ctw.utwente.nl
Fri May 19 22:53:40 CEST 2006


Dear Christophe, Jean-Francois, David,

  again my compliments for gmsh, and thanks for the continuing steady updates
and further development.

  Over the past year I have followed and compiled the steady stream of
releases. For these last releases I had continuously had to apply the same
fixes for the code to compile on IRIX 6.5, with the native MIPSpro compiler,
time to send in a patch I think.

SGI
MIPSpro Compilers: Version 7.3.1.3m
Actually two source-files give rise to errors:

- Common/AdaptiveViews.cpp
  Common/AdaptiveViews.h - compiler issues an error, for min,max being
ambiguous.

- contrib/Netgen/libsrc/include/mystdlib.h - the file contains <cr> - carriage
returns, (Dos format lf+cr) not a real bug, but a preprocessor can choke on
this.

(changes included in the attached patch file.)

next to that, the configure.in, contains an assumption regarding the name of
the C++ compiler under IRIX. When this is named differently in the environment
variables, (e.g. setenv CXX /bin/CC  instead of setenv CXX CC) configure does
not setup the right environment for the C++ pre-linker under IRIX. I don't
really have a ready solution for this.


Next to that, I propose to introduce the 'Y' argument in the call to the
Tetgen mesher, as with this argument the present version of Tetgen (1.4.0),
does not remesh apparently doubly curved surfaces bounding 3D meshes. The
result looks so much better then. (included in the patch)

B.T.W. using the Tetgen mesher as a 3D algorithm together with option
'optimize quality of tetrahedral elements' selected inevitable leads to a
program crash. (with and without the 'Y' option in the Tetgen-call)


And finally I have part of larger .geo (bzrs.geo) attached. This surface is
built entirely of bezier-curves and highlights a weakness in the 2D surface
meshing algorithm I think. The triangles in the vicinity of point 6 are
stretched unfavourable I feel. Please give your opinion on this one.

Some of the real work I could produce with it:
http://www.ts.ctw.utwente.nl/philip/example3D-nf5a.html
(sorry for this commmercial :)
Thanks for your time, I think gmsh is solid work.

Cheers

Philip



|>gmsh65 -info
Version        : 1.65.0
GUI toolkit    : FLTK 1.1.6
License        : GNU General Public License
Build OS       : IRIX
Build options  : GSL TRIANGLE NETGEN TETGEN JPEG PNG ZLIB MATHEVAL METIS ANN 
Build date     : Wed May 17 13:56:14 MEST 2006
Build host     : removed
Packager       : philip
Web site       : http://www.geuz.org/gmsh/
Mailing list   : gmsh at geuz.org
-------------- next part --------------
diff -r -u2 -b ./Common/AdaptiveViews.cpp ../gmsh-1.65.0dvl/Common/AdaptiveViews.cpp
--- ./Common/AdaptiveViews.cpp	Fri Mar 10 22:47:52 2006
+++ ../gmsh-1.65.0dvl/Common/AdaptiveViews.cpp	Wed May 17 13:21:38 2006
@@ -753,6 +753,6 @@
     p->Y = XYZ(kk, 1);
     p->Z = XYZ(kk, 2);
-    if (min > p->val) min = p->val;
-    if (max < p->val) max = p->val;
+    if (avpmin > p->val) avpmin = p->val;
+    if (avpmax < p->val) avpmax = p->val;
     kk++;
   }
@@ -767,5 +767,5 @@
 
   if(!plug || tol != 0.0) {
-    ELEM::Error(max - min, tol);
+    ELEM::Error(avpmax - avpmin, tol);
   }
 
@@ -1043,6 +1043,6 @@
   else return;
 
-  min = VAL_INF;
-  max = -VAL_INF;
+  avpmin = VAL_INF;
+  avpmax = -VAL_INF;
 
   int nb = List_Nbr(myList) / (nbelm);
diff -r -u2 -b ./Common/AdaptiveViews.h ../gmsh-1.65.0dvl/Common/AdaptiveViews.h
--- ./Common/AdaptiveViews.h	Sun Feb 26 02:20:24 2006
+++ ../gmsh-1.65.0dvl/Common/AdaptiveViews.h	Wed May 17 13:22:20 2006
@@ -267,5 +267,5 @@
 {
   double tol;
-  double min,max;
+  double avpmin,avpmax;
   int presentZoomLevel;
   double presentTol;
diff -r -u2 -b ./Mesh/3D_Mesh_Tetgen.cpp ../gmsh-1.65.0dvl/Mesh/3D_Mesh_Tetgen.cpp
--- ./Mesh/3D_Mesh_Tetgen.cpp	Mon Jan 30 05:47:54 2006
+++ ../gmsh-1.65.0dvl/Mesh/3D_Mesh_Tetgen.cpp	Wed May 17 13:23:53 2006
@@ -130,5 +130,5 @@
   }
  
-  sprintf(opts, "pqa%f%c", (float)CTX.mesh.quality, 
+  sprintf(opts, "pq1.4Ya%f%c", (float)CTX.mesh.quality, 
 	  (CTX.verbosity < 3)? 'Q': (CTX.verbosity > 6)? 'V': '\0');
   Msg(STATUS3, "Meshing with volume constraint %f", (float)CTX.mesh.quality);
diff -r -u2 -b ./contrib/Netgen/Makefile ../gmsh-1.65.0dvl/contrib/Netgen/Makefile
--- ./contrib/Netgen/Makefile	Fri Mar 10 22:47:53 2006
+++ ../gmsh-1.65.0dvl/contrib/Netgen/Makefile	Wed May 17 13:28:58 2006
@@ -23,6 +23,6 @@
 
 LIB     = ../../lib/libGmshNetgen.a
-INCLUDE = -I../../Common -Ilibsrc/include -Ilibsrc/interface
-CFLAGS  = ${OPTIM} ${FLAGS} ${INCLUDE} -DNO_PARALLEL_THREADS -UWIN32
+INCLUDE = -I../../Common -Ilibsrc/include -Ilibsrc/interface -I/usr/freeware/include
+CFLAGS  = ${OPTIM} ${FLAGS} ${INCLUDE} -DNO_PARALLEL_THREADS -DOLDCINCLUDE -UWIN32 -woff 1681,1682,1174,1552
 
 SRC = libsrc/opti/linopt.cpp \
diff -r -u2 -b ./contrib/Netgen/libsrc/include/mystdlib.h ../gmsh-1.65.0dvl/contrib/Netgen/libsrc/include/mystdlib.h
--- ./contrib/Netgen/libsrc/include/mystdlib.h	Wed Sep 21 19:29:38 2005
+++ ../gmsh-1.65.0dvl/contrib/Netgen/libsrc/include/mystdlib.h	Wed May 17 13:25:10 2006
@@ -1,69 +1,69 @@
-#ifndef FILE_MYSTDLIB
-#define FILE_MYSTDLIB
-
-
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <sstream>
-
-#ifdef OLDCINCLUDE
-
-// e.g., CC compiler on SGI
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <malloc.h>
-#include <ctype.h>
-#include <time.h>
-
-#else
- 
-// new standard
-#include <cstdlib>
-#include <cstdio>
-#include <cmath>
-#include <cctype>
-#include <ctime>
-#endif
-
-
-
-#include <new>
-#include <string>
-#include <typeinfo>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-
-/*** Windows headers ***/
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <afxwin.h>
-#include <afxmt.h>
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#include <winnt.h>
-#endif /* WIN32 */
-
-
-/*
-extern void* operator new(std::size_t) throw (std::bad_alloc);
-extern void* operator new[](std::size_t) throw (std::bad_alloc);
-extern void operator delete(void*) throw();
-extern void operator delete[](void*) throw();
-*/
-
-
-extern int mem_alloc;
-extern int mem_total_alloc;
-extern int mem_max_alloc;
-extern int mem_total_alloc_array;
-extern int mem_total_alloc_table;
-
-
-using namespace std;
-
-#endif
+#ifndef FILE_MYSTDLIB
+#define FILE_MYSTDLIB
+
+
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <sstream>
+
+#ifdef OLDCINCLUDE
+
+// e.g., CC compiler on SGI
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <malloc.h>
+#include <ctype.h>
+#include <time.h>
+
+#else
+ 
+// new standard
+#include <cstdlib>
+#include <cstdio>
+#include <cmath>
+#include <cctype>
+#include <ctime>
+#endif
+
+
+
+#include <new>
+#include <string>
+#include <typeinfo>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+
+/*** Windows headers ***/
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <afxwin.h>
+#include <afxmt.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <winnt.h>
+#endif /* WIN32 */
+
+
+/*
+extern void* operator new(std::size_t) throw (std::bad_alloc);
+extern void* operator new[](std::size_t) throw (std::bad_alloc);
+extern void operator delete(void*) throw();
+extern void operator delete[](void*) throw();
+*/
+
+
+extern int mem_alloc;
+extern int mem_total_alloc;
+extern int mem_max_alloc;
+extern int mem_total_alloc_array;
+extern int mem_total_alloc_table;
+
+
+using namespace std;
+
+#endif
Only in ../gmsh-1.65.0dvl/contrib/Tetgen: predicates.cxx
Only in ../gmsh-1.65.0dvl/contrib/Tetgen: tetgen.cxx
Only in ../gmsh-1.65.0dvl/contrib/Tetgen: tetgen.h
Only in ../gmsh-1.65.0dvl/contrib/Triangle: triangle.c
Only in ../gmsh-1.65.0dvl/contrib/Triangle: triangle.h
-------------- next part --------------
Point(1) = {4.3611102104187, -0.7888889908790599, 0.69444400072098, 0.05};
Point(2) = {4.3611102104187, -0.54188899087906, 0.69444400072098, 0.06};
Point(3) = {4.3611102104187, -0.63611102104187, 0.4, 0.07};
Point(4) = {4.3611102104187, -0.63611102104187, 0, 0.1};
Point(6) = {5.9027800559998, -0.91666698455811, 0.75833302736282, 0.03};
Point(7) = {5.9027800559998, -0.73816698455811, 0.8348330273628201, 0.04};
Point(8) = {5.9027800559998, -0.63611099720001, 0.75000001192093, 0.04};
Point(9) = {5.9027800559998, -0.53611099720001, 0.55000001192093, 0.05};
Point(101) = {4.8611102104187, -0.7888889908790599, 0.74444400072098, 0.06};
Point(102) = {5.4027800559998, -0.86666698455811, 0.7683330273628201, 0.06};
Point(103) = {4.8611102104187, -0.62611102104187, 0.08, 0.1};
Point(104) = {5.4027800559998, -0.56611099720001, 0.31000001192093, 0.1};
Bezier (1) = {1, 2, 3, 4};
Bezier (2) = {6, 7, 8, 9};
Bezier (3) = {1, 101, 102, 6};
Bezier (4) = {4, 103, 104, 9};
Line Loop (1000002) = {-1, 3, 2, -4};
Ruled Surface (2) = {1000002};