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

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


The following commit has been merged in the upstream branch:
commit 8fbf4eca65819c0ac0e771fa5c641a20fa59a796
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Tue Sep 18 08:04:51 2007 +1000

    Bug fix for gfs_domain_stats_balance() on serial parameter files
    
    darcs-hash:20070917220451-d4795-7c017a35fa27ea4c7205190cecf53607ebc1c7ce.gz

diff --git a/src/domain.c b/src/domain.c
index 2731748..ae550d1 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1388,14 +1388,16 @@ static void cell_count (FttCell * cell, guint * count)
   (*count)++;
 }
 
+#define BPID(b) ((b)->pid > 0 ? (b)->pid : 0)
+
 static void box_count (GfsBox * b, GArray * a)
 {
-  guint count = 0;
+  guint count = 0, pid = BPID(b);
   ftt_cell_traverse (b->root, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
 		     (FttCellTraverseFunc) cell_count, &count);
-  if (b->pid >= a->len)
-    g_array_set_size (a, b->pid + 1);
-  g_array_index (a, guint, b->pid) += count;
+  if (pid >= a->len)
+    g_array_set_size (a, pid + 1);
+  g_array_index (a, guint, pid) += count;
 }
 
 static void boundary_size (GfsBox * box, GArray * a)
@@ -1412,7 +1414,7 @@ static void boundary_size (GfsBox * box, GArray * a)
        )
       ftt_cell_traverse_boundary (box->root, d, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
 				  (FttCellTraverseFunc) cell_count, &count);
-  g_array_index (a, guint, box->pid) += count;
+  g_array_index (a, guint, BPID (box)) += count;
 }
 
 /**

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list