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

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


The following commit has been merged in the upstream branch:
commit 500acf85ed401354b5334b57bb1afba0059a8dae
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Tue Sep 11 13:42:39 2007 +1000

    Bug fix for SourceControl divide by zero
    
    darcs-hash:20070911034239-d4795-04b3c14430495bbbf1313200815f278892ac7673.gz

diff --git a/src/source.c b/src/source.c
index dc74a31..bdced85 100644
--- a/src/source.c
+++ b/src/source.c
@@ -358,8 +358,9 @@ static gboolean source_control_event (GfsEvent * event, GfsSimulation * sim)
     GfsSourceControl * s = GFS_SOURCE_CONTROL (event);
     GtsRange r = gfs_domain_stats_variable (GFS_DOMAIN (sim), GFS_SOURCE_SCALAR (event)->v,
 					    FTT_TRAVERSE_LEAFS, -1);
-    s->s = (gfs_function_value (GFS_SOURCE (s)->intensity, NULL) - r.mean)/
-      sim->advection_params.dt;
+    s->s = sim->advection_params.dt > 0. ? 
+      (gfs_function_value (GFS_SOURCE (s)->intensity, NULL) - r.mean)/sim->advection_params.dt :
+      0.;
     return TRUE;
   }
   return FALSE;

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list