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

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


The following commit has been merged in the upstream branch:
commit ea80761c0744ca0d53690fc8bcc6f8c50eb683f7
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Jan 25 13:24:16 2008 +1100

    Removed gfs_get_from_below_extensive
    
    darcs-hash:20080125022416-d4795-d06d5939356ab0db5c587d062e56cb48119387ad.gz

diff --git a/src/fluid.c b/src/fluid.c
index 850c16c..ed5118e 100644
--- a/src/fluid.c
+++ b/src/fluid.c
@@ -1466,37 +1466,6 @@ void gfs_get_from_below_intensive (FttCell * cell, const GfsVariable * v)
 }
 
 /**
- * gfs_get_from_below_extensive:
- * @cell: a #FttCell.
- * @v: a #GfsVariable to "get from below".
- *
- * Sets the value of the "extensive" variable @v of @cell as (half in
- * 3D) the sum of the values of its children cells.
- *
- * This functions fails if @cell is a leaf of the cell tree.  
- */
-void gfs_get_from_below_extensive (FttCell * cell, const GfsVariable * v)
-{
-  gdouble val = 0.;
-  guint i;
-  FttCellChildren child;
-
-  g_return_if_fail (cell != NULL);
-  g_return_if_fail (!FTT_CELL_IS_LEAF (cell));
-  g_return_if_fail (v != NULL);
-
-  ftt_cell_children (cell, &child);
-  for (i = 0; i < FTT_CELLS; i++)
-    if (child.c[i])
-      val += GFS_VARIABLE (child.c[i], v->i);
-  GFS_VARIABLE (cell, v->i) = val
-#if (!FTT_2D && !FTT_2D3)
-    /2.
-#endif /* not FTT_2D */
-    ;
-}
-
-/**
  * gfs_cell_coarse_fine:
  * @parent: a #FttCell.
  * @v: a #GfsVariable.
diff --git a/src/fluid.h b/src/fluid.h
index 7c63d1b..f2050fb 100644
--- a/src/fluid.h
+++ b/src/fluid.h
@@ -97,8 +97,6 @@ void                  gfs_cell_reset                (FttCell * cell,
 						     GfsVariable * v);
 void                  gfs_get_from_below_intensive  (FttCell * cell, 
 						     const GfsVariable * v);
-void                  gfs_get_from_below_extensive  (FttCell * cell, 
-						     const GfsVariable * v);
 void                  gfs_cell_coarse_fine          (FttCell * cell,
 						     GfsVariable * v);
 gdouble               gfs_face_interpolated_value   (const FttCellFace * face,
diff --git a/src/poisson.c b/src/poisson.c
index c278ddd..ba08df2 100644
--- a/src/poisson.c
+++ b/src/poisson.c
@@ -599,6 +599,32 @@ static void get_from_above (FttCell * parent, GfsVariable * v)
     }
 }
 
+static void get_from_below_3D (FttCell * cell, const GfsVariable * v)
+{
+  gdouble val = 0.;
+  guint i;
+  FttCellChildren child;
+
+  ftt_cell_children (cell, &child);
+  for (i = 0; i < FTT_CELLS; i++)
+    if (child.c[i])
+      val += GFS_VARIABLE (child.c[i], v->i);
+  GFS_VARIABLE (cell, v->i) = val/2.;
+}
+
+static void get_from_below_2D (FttCell * cell, const GfsVariable * v)
+{
+  gdouble val = 0.;
+  guint i;
+  FttCellChildren child;
+
+  ftt_cell_children (cell, &child);
+  for (i = 0; i < FTT_CELLS; i++)
+    if (child.c[i])
+      val += GFS_VARIABLE (child.c[i], v->i);
+  GFS_VARIABLE (cell, v->i) = val;
+}
+
 /**
  * gfs_poisson_cycle:
  * @domain: the domain on which to solve the Poisson equation.
@@ -644,7 +670,9 @@ void gfs_poisson_cycle (GfsDomain * domain,
   /* compute residual on non-leafs cells */
   gfs_domain_cell_traverse (domain, 
 			    FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
-			    (FttCellTraverseFunc) gfs_get_from_below_extensive, res);
+			    p->dimension == 2 ? (FttCellTraverseFunc) get_from_below_2D : 
+			    (FttCellTraverseFunc) get_from_below_3D,
+			    res);
 
   /* relax top level */
   gfs_domain_cell_traverse (domain,
diff --git a/tools/gfscompare.c b/tools/gfscompare.c
index cb55e73..302321c 100644
--- a/tools/gfscompare.c
+++ b/tools/gfscompare.c
@@ -327,7 +327,6 @@ int main (int argc, char * argv[])
   gboolean centered = FALSE;
   gboolean weighted = TRUE;
   gdouble constant = 0.;
-  gboolean extensive = FALSE;
   gboolean absolute = FALSE;
 #if FTT_2D
   gboolean gnuplot = FALSE;
@@ -364,7 +363,6 @@ int main (int argc, char * argv[])
       {"centered", no_argument, NULL, 'c'},
       {"not-weighted", no_argument, NULL, 'w'},
       {"constant", no_argument, NULL, 'C'},
-      {"extensive", no_argument, NULL, 'e'},
       { NULL }
     };
     int option_index = 0;
@@ -393,9 +391,6 @@ int main (int argc, char * argv[])
     case 'a': /* abs */
       absolute = TRUE;
       break;
-    case 'e': /* extensive */
-      extensive = TRUE;
-      break;
     case 'C': /* constant */
       constant = TRUE;
       break;
@@ -451,7 +446,6 @@ int main (int argc, char * argv[])
      "  -m V  --min=V       set minimum of color scale to V (used with -S)\n"
      "  -M V  --max=V       set maximum of color scale to V\n"
      "  -a    --abs         output the absolute value of the error field\n"
-     "  -e    --extensive   variable is extensive\n"
      "  -C    --constant    apply a constant shift to one of the field, minimizing\n"
      "                      the error between the two fields (useful for pressure)\n"
      "  -w    --not-weighted do not use area-weighted norm estimation\n"
@@ -638,22 +632,12 @@ int main (int argc, char * argv[])
   }
 #endif /* FTT_2D */
   else {
-    if (!extensive) {
-      gfs_domain_cell_traverse (GFS_DOMAIN (s1), 
-				FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
-				(FttCellTraverseFunc) gfs_get_from_below_intensive, var1);
-      gfs_domain_cell_traverse (GFS_DOMAIN (s2), 
-				FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
-				(FttCellTraverseFunc) gfs_get_from_below_intensive, var2);
-    }
-    else {
-      gfs_domain_cell_traverse (GFS_DOMAIN (s1), 
-				FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
-				(FttCellTraverseFunc) gfs_get_from_below_extensive, var1);
-      gfs_domain_cell_traverse (GFS_DOMAIN (s2), 
-				FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
-				(FttCellTraverseFunc) gfs_get_from_below_extensive, var2);
-    }
+    gfs_domain_cell_traverse (GFS_DOMAIN (s1), 
+			      FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
+			      (FttCellTraverseFunc) gfs_get_from_below_intensive, var1);
+    gfs_domain_cell_traverse (GFS_DOMAIN (s2), 
+			      FTT_POST_ORDER, FTT_TRAVERSE_NON_LEAFS, -1,
+			      (FttCellTraverseFunc) gfs_get_from_below_intensive, var2);
     data[4] = &period;
     gts_container_foreach (GTS_CONTAINER (s1), (GtsFunc) difference_box, data);
   }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list