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

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


The following commit has been merged in the upstream branch:
commit f38d79e96634810d55ff63dec4196fc1270f3cc1
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Sun May 20 19:51:55 2007 +1000

    G_MAXDOUBLE values are ignored by gfs_norm_add() and gts_range_add_value()
    
    darcs-hash:20070520095155-d4795-2697848ccfd44d4ffa56a70cc8890572e776f2dc.gz

diff --git a/src/domain.c b/src/domain.c
index 2f1766c..d7fe759 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1193,9 +1193,10 @@ void gfs_domain_cell_traverse_boundary (GfsDomain * domain,
 static void add_stats (const FttCell * cell, gpointer * data)
 {
   GtsRange * s = data[0];
-  GfsVariable * v = data[1];
+  gdouble v = GFS_VARIABLE (cell, GFS_VARIABLE1 (data[1])->i);
 
-  gts_range_add_value (s, GFS_VARIABLE (cell, v->i));
+  if (v < G_MAXDOUBLE)
+    gts_range_add_value (s, v);
 }
 
 #ifdef HAVE_MPI
diff --git a/src/fluid.c b/src/fluid.c
index 9b1b76d..9301b6f 100644
--- a/src/fluid.c
+++ b/src/fluid.c
@@ -1611,9 +1611,10 @@ void gfs_cell_reset (FttCell * cell, GfsVariable * v)
 static void add_stats (const FttCell * cell, gpointer * data)
 {
   GtsRange * s = data[0];
-  GfsVariable * v = data[1];
+  gdouble v = GFS_VARIABLE (cell, GFS_VARIABLE1 (data[1])->i);
 
-  gts_range_add_value (s, GFS_VARIABLE (cell, v->i));
+  if (v < G_MAXDOUBLE)
+    gts_range_add_value (s, v);
 }
 
 /**
@@ -1732,13 +1733,15 @@ void gfs_norm_add (GfsNorm * n, gdouble val, gdouble weight)
 {
   g_return_if_fail (n != NULL);
 
-  n->bias += weight*val;
-  val = fabs (val);
-  if (val > n->infty)
-    n->infty = val;
-  n->first += weight*val;
-  n->second += weight*val*val;
-  n->w += weight;
+  if (val < G_MAXDOUBLE) {
+    n->bias += weight*val;
+    val = fabs (val);
+    if (val > n->infty)
+      n->infty = val;
+    n->first += weight*val;
+    n->second += weight*val*val;
+    n->w += weight;
+  }
 }
 
 /**

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list