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

Stephane Popinet s.popinet at niwa.co.nz
Fri May 15 02:51:55 UTC 2009


The following commit has been merged in the upstream branch:
commit c3ae5eb7d58682bd707f88b9ec047d1327954c75
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Tue Jun 7 08:10:59 2005 +1000

    New macro gfs_cell_volume()
    
    darcs-hash:20050606221059-fbd8f-6eebd1266970f7e0d3d8239aed94fb170382e616.gz

diff --git a/src/domain.c b/src/domain.c
index 6709490..47dda35 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1303,9 +1303,7 @@ static void add_norm (const FttCell * cell, gpointer * data)
   GfsNorm * n = data[0];
   GfsVariable * v = data[1];
 
-  gfs_norm_add (n, GFS_VARIABLE (cell, v->i),
-		ftt_cell_volume (cell)*(GFS_IS_MIXED (cell) ?
-					GFS_STATE (cell)->solid->a : 1.));
+  gfs_norm_add (n, GFS_VARIABLE (cell, v->i), gfs_cell_volume (cell));
 }
 
 #ifdef HAVE_MPI
@@ -1437,9 +1435,7 @@ static void add_norm_velocity (const FttCell * cell, GfsNorm * n)
 
     unorm += uc*uc;
   }
-  gfs_norm_add (n, sqrt (unorm), 
-		ftt_cell_volume (cell)*(GFS_IS_MIXED (cell) ? 
-					GFS_STATE (cell)->solid->a : 1.));
+  gfs_norm_add (n, sqrt (unorm), gfs_cell_volume (cell));
 }
 
 /**
diff --git a/src/fluid.c b/src/fluid.c
index 1f02983..dbfdbe8 100644
--- a/src/fluid.c
+++ b/src/fluid.c
@@ -1403,9 +1403,7 @@ static void add_norm (const FttCell * cell, gpointer * data)
   GfsNorm * n = data[0];
   GfsVariable * v = data[1];
 
-  gfs_norm_add (n, GFS_VARIABLE (cell, v->i), 
-		ftt_cell_volume (cell)*(GFS_IS_MIXED (cell) ? 
-				    GFS_STATE (cell)->solid->a : 1.));
+  gfs_norm_add (n, GFS_VARIABLE (cell, v->i), gfs_cell_volume (cell));
 }
 
 /**
diff --git a/src/fluid.h b/src/fluid.h
index 79b2e9e..0f16562 100644
--- a/src/fluid.h
+++ b/src/fluid.h
@@ -208,6 +208,9 @@ GtsRange              gfs_stats_variable             (FttCell * root,
 						      FttTraverseFlags flags,
 						      gint max_depth);
 
+#define               gfs_cell_volume(cell)   (ftt_cell_volume (cell)*(GFS_IS_MIXED (cell) ?\
+					       GFS_STATE (cell)->solid->a : 1.))
+
 typedef struct _GfsNorm GfsNorm;
 
 struct _GfsNorm {
diff --git a/src/output.c b/src/output.c
index 230992a..a553b09 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1737,8 +1737,7 @@ GfsOutputClass * gfs_output_scalar_stats_class (void)
 
 static void add (FttCell * cell, gpointer * data)
 {
-  GfsSolidVector * solid = GFS_STATE (cell)->solid;
-  gdouble vol = (solid ? solid->a : 1.)*ftt_cell_volume (cell);
+  gdouble vol = gfs_cell_volume (cell);
   GfsVariable * v = data[0];
   gdouble * sum = data[1];
 
@@ -1799,10 +1798,9 @@ GfsOutputClass * gfs_output_scalar_sum_class (void)
 
 static void add_energy (FttCell * cell, gpointer * data)
 {
-  GfsSolidVector * solid = GFS_STATE (cell)->solid;
   GfsStateVector * s = GFS_STATE (cell);
   GtsRange * ps = data[2];
-  gdouble vol = (solid ? solid->a : 1.)*ftt_cell_volume (cell);
+  gdouble vol = gfs_cell_volume (cell);
   gdouble * ke = data[0];
   gdouble * pe = data[1];
 
@@ -2083,7 +2081,7 @@ static void compute_correlation (FttCell * cell, gpointer * data)
     gfs_cell_cm (cell, &p);
   ref = gfs_function_value (GFS_OUTPUT_ERROR_NORM (o)->s, NULL, &p, sim->time.t);
   v = GFS_VARIABLE (cell, o->v->i) - *bias;
-  w = ftt_cell_volume (cell)*(GFS_IS_MIXED (cell) ? GFS_STATE (cell)->solid->a : 1.);
+  w = gfs_cell_volume (cell);
   *sumref += ref*ref*w;
   *sum += v*ref*w;
 }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list