[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:54:48 UTC 2009


The following commit has been merged in the upstream branch:
commit 4402512293b1e1562096753a064f54611ae5a606
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Oct 12 08:45:47 2007 +1000

    Improved secant-bisection root-finding for implicit surfaces
    
    darcs-hash:20071011224547-d4795-d63c3ef0f045e7125402587b24b96dde08cc891d.gz

diff --git a/src/surface.c b/src/surface.c
index 591d368..808047a 100644
--- a/src/surface.c
+++ b/src/surface.c
@@ -439,23 +439,28 @@ guint gfs_surface_segment_intersection (GfsSurface * s,
       }
       I->x = (v1*t2 - v2*t1)/(v1 - v2);
       guint n = 0;
+      gint side = 0;
       do {
 	t = I->x;
 	gdouble v = gfs_surface_implicit_value (s, segment_intersection (I));
 	if (v < 0.) {
 	  v1 = v; t1 = I->x;
+	  if (side == -1) v2 /= 2.;
+	  side = -1;
 	}
 	else {
 	  v2 = v; t2 = I->x;
+	  if (side == +1) v1 /= 2.;
+	  side = +1;
 	}
 	if (v2 > v1)
 	  I->x = (v1*t2 - v2*t1)/(v1 - v2);
 	n++;
       }
-      while (fabs (t - I->x) > 1e-3 && n < 10);
-      if (fabs (t - I->x) > 1e-3)
+      while (fabs (t - I->x) > 1e-5 && n < 100);
+      if (fabs (t - I->x) > 1e-5)
 	g_warning ("gfs_surface_segment_intersection(): convergence could not be reached\n"
-		   "after %d iterations", n);
+		   "after %d iterations, error is %g", n, fabs (t - I->x));
     }
   }
   return I->n;

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list