Amazingly, I have discovered a potentially serious bug in the routines
which perform edge collapse in the BDS_Mesh.

Owing to this, it is possible for a point to collapse onto a linear
boundary creating slivers (triangles with collinear points).

The problem is that the sides of the triangle, a and b, are not
recalculated after the point is moved.  Thus, area_final and area_init
are always equal!  So the test for slivers is defeated.

I attach a simple patch to fix this.

That aside, gmsh works great for me. Many thanks for this program!

Peter Wainwright


diff -u -r gmsh-2.3.0-cvs-20090112-old/Mesh/BDS.cpp gmsh-2.3.0-cvs-20090112/Mesh/BDS.cpp
--- gmsh-2.3.0-cvs-20090112-old/Mesh/BDS.cpp	2009-01-15 17:49:29.000000000 +0000
+++ gmsh-2.3.0-cvs-20090112/Mesh/BDS.cpp	2009-01-15 20:12:07.000000000 +0000
@@ -1058,6 +1058,9 @@
   else
     return false;
   
+  a[0] = pb[0] - pa[0]; a[1] = pb[1] - pa[1];
+  b[0] = pc[0] - pa[0]; b[1] = pc[1] - pa[1];
+
   double area_final = fabs(a[0] * b[1] - a[1] * b[0]);
   if(area_final < 0.1 * area_init) return false;
   double ori_final = gmsh::orient2d(pa, pb, pc);
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to