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

Stephane Popinet popinet at users.sf.net
Tue Nov 24 12:24:16 UTC 2009


The following commit has been merged in the upstream branch:
commit aee41695fe5e1a7e16411b47f5e5b98918420220
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Jun 25 19:57:17 2009 +1000

    Major bug fix for GfsBoundaryPeriodic
    
    Amazingly the implementation of the match() method seems to have been wrong
    right from the initial implementation (then part of BoundaryMpi). Yet, despite
    being completely inconsistent, this implementation managed to "work"
    undetected for several years... The bug also affected parallel simulations
    through inheritance to BoundaryMpi.
    
    darcs-hash:20090625095717-d4795-f27fc785ce2544d4bae955b7a5d1f3dae19e8400.gz

diff --git a/src/boundary.c b/src/boundary.c
index 69fba55..20d308c 100644
--- a/src/boundary.c
+++ b/src/boundary.c
@@ -1137,6 +1137,7 @@ static void boundary_tree (FttCell * cell, GfsBoundaryPeriodic * boundary)
 
     n = ftt_cell_children_direction (cell, GFS_BOUNDARY (boundary)->d, &child);
     for (i = 0; i < n; i++) {
+      /* fixme: using a gdouble to store (and MPI transfer) a boolean is wasteful... */
       gdouble is_destroyed = (child.c[i] == NULL);
       
       if (boundary->sndcount == boundary->sndbuf->len)
@@ -1145,6 +1146,9 @@ static void boundary_tree (FttCell * cell, GfsBoundaryPeriodic * boundary)
 	g_array_index (boundary->sndbuf, gdouble, boundary->sndcount) = is_destroyed;
       boundary->sndcount++;
     }
+    for (i = 0; i < n; i++)
+      if (child.c[i])
+	boundary_tree (child.c[i], boundary);
   }
 }
 
@@ -1153,9 +1157,7 @@ static void periodic_match (GfsBoundary * boundary)
   (* gfs_boundary_class ()->match) (boundary);
 
   g_assert (GFS_BOUNDARY_PERIODIC (boundary)->sndcount == 0);
-  ftt_cell_traverse (boundary->root,
-		     FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
-		     (FttCellTraverseFunc) boundary_tree, boundary);
+  boundary_tree (boundary->root, GFS_BOUNDARY_PERIODIC (boundary));
 }
 
 static void send (GfsBoundary * bb)

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list