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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:53:34 UTC 2009


The following commit has been merged in the upstream branch:
commit 494705ef4c2e0f6529098902c4b691a9989bf94b
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Feb 2 21:38:10 2006 +1100

    The distance function value was not always correct for cells cut by the isoline
    
    darcs-hash:20060202103810-d4795-c102c68191f8e48b02e2dd6380f8f2284a7899a0.gz

diff --git a/src/levelset.c b/src/levelset.c
index 44f13ff..453aad7 100644
--- a/src/levelset.c
+++ b/src/levelset.c
@@ -212,25 +212,13 @@ static void levelset1 (FttCell * cell, GfsVariable * v)
     if (n == 4) /* ambiguous interface orientation */
       GFS_VARIABLE (cell, v->i) = sqrt (d2);
     else {
-      GtsVector AB;
-      gdouble ABn;
+      GtsVector AB, AP, ABAP;
 
       g_assert (n == 2);
       gts_vector_init (AB, &m[0], &m[1]);
-      ABn = gts_vector_norm (AB);
-      if (ABn == 0.)
-	GFS_VARIABLE (cell, v->i) = GFS_VARIABLE (cell, l->v->i) > l->level ? 
-	  sqrt (d2) : -sqrt (d2);
-      else {
-	GtsVector AP;
-	GtsVector ABAP;
-	gdouble d;
-
-	gts_vector_init (AP, &m[0], &p);
-	gts_vector_cross (ABAP,AB,AP);
-	d = ABAP[2]/ABn;
-	GFS_VARIABLE (cell, v->i) = d*o[0];
-      }
+      gts_vector_init (AP, &m[0], &p);
+      gts_vector_cross (ABAP,AB,AP);
+      GFS_VARIABLE (cell, v->i) = ABAP[2]*o[0] > 0. ? sqrt (d2) : -sqrt (d2);
     }
   }
 }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list