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

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


The following commit has been merged in the upstream branch:
commit 9e7fc50a1d13782594d8a9e111567821a4a119ad
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Mar 23 08:16:55 2007 +1100

    ftt_cell_locate() works for 2D3
    
    darcs-hash:20070322211655-d4795-1bfec054fb3eae51fe3c3b9d572e71151f9c04d9.gz

diff --git a/src/ftt.c b/src/ftt.c
index a23c0ea..701ac16 100644
--- a/src/ftt.c
+++ b/src/ftt.c
@@ -1556,17 +1556,19 @@ FttCell * ftt_cell_locate (FttCell * root,
   size = ftt_cell_size (root)/2.;
 
   if (target.x > pos.x + size || target.x < pos.x - size ||
-      target.y > pos.y + size || target.y < pos.y - size ||
-      target.z > pos.z + size || target.z < pos.z - size)
+      target.y > pos.y + size || target.y < pos.y - size
+#if FTT_2D3
+      || target.z > pos.z + 0.5 || target.z < pos.z - 0.5
+#elif !FTT_2D
+      || target.z > pos.z + size || target.z < pos.z - size
+#endif
+      )
     return NULL;
 
   do {
     if (FTT_CELL_IS_LEAF (root) || ftt_cell_level (root) == max_depth)
       return root;
-#if FTT_2D3
-    guint n = 0;
-    g_assert_not_implemented ();
-#elif FTT_2D
+#if (FTT_2D || FTT_2D3)
     static guint index[2][2] = {{2,3},{0,1}};
     guint n = index[target.y > pos.y][target.x > pos.x];
 #else  /* 3D */
@@ -1577,7 +1579,9 @@ FttCell * ftt_cell_locate (FttCell * root,
     size /= 2.;
     pos.x += coords[n][0]*size;
     pos.y += coords[n][1]*size;
+#if !(FTT_2D || FTT_2D3)
     pos.z += coords[n][2]*size;
+#endif /* 3D */
   } while (!FTT_CELL_IS_DESTROYED (root));
   return NULL;
 }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list