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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:55:39 UTC 2009


The following commit has been merged in the upstream branch:
commit 06abd9425b621b7bf09d7a7980fcd628868e47b8
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Aug 22 14:04:47 2008 +1000

    Spatial functions can now be time-dependent
    
    darcs-hash:20080822040447-d4795-1ea848c8ec2c2b7dac0b1a1731a13abb7c922fdf.gz

diff --git a/src/utils.c b/src/utils.c
index a27cb8f..2566cf7 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -572,7 +572,7 @@ static void function_compile (GfsFunction * f, GtsFile * fp)
       i = i->next;
     }
     if (f->spatial)
-      fputs ("double f (double x, double y, double z) {\n"
+      fputs ("double f (double x, double y, double z, double t) {\n"
 	     "  _x = x; _y = y; _z = z;\n", 
 	     fin);
     else if (f->constant)
@@ -1116,7 +1116,7 @@ GfsFunctionClass * gfs_function_spatial_class (void)
   return klass;
 }
 
-typedef gdouble (* GfsFunctionSpatialFunc) (double x, double y, double z);
+typedef gdouble (* GfsFunctionSpatialFunc) (double x, double y, double z, double t);
 
 /**
  * gfs_function_spatial_value:
@@ -1132,10 +1132,11 @@ gdouble gfs_function_spatial_value (GfsFunction * f, FttVector * p)
   g_return_val_if_fail (p != NULL, 0.);
 
   if (f->f) {
+    GfsSimulation * sim = gfs_object_simulation (f);
     FttVector q = *p;
     check_for_deferred_compilation (f);
-    gfs_simulation_map_inverse (gfs_object_simulation (f), &q);
-    return (* (GfsFunctionSpatialFunc) f->f) (q.x, q.y, q.z);
+    gfs_simulation_map_inverse (sim, &q);
+    return (* (GfsFunctionSpatialFunc) f->f) (q.x, q.y, q.z, sim->time.t);
   }
   else
     return f->val;

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list