[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:58 UTC 2009
The following commit has been merged in the upstream branch:
commit a738cd872dd5bea486ee10d828f11ceb92b5089d
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue Feb 27 12:59:13 2007 +1100
Added tolerance to avoid "missed" synchronised events
darcs-hash:20070227015913-d4795-63feee77713791f9d002efb5a395115c699ab474.gz
diff --git a/src/simulation.c b/src/simulation.c
index 2ebe940..313d04e 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -1051,8 +1051,10 @@ void gfs_simulation_set_timestep (GfsSimulation * sim)
sim->advection_params.dt = cfl*gfs_domain_cfl (GFS_DOMAIN (sim), FTT_TRAVERSE_LEAFS, -1);
else
sim->advection_params.dt = G_MAXINT;
+ if (sim->advection_params.dt > sim->time.dtmax)
+ sim->advection_params.dt = sim->time.dtmax;
- i = GFS_DOMAIN (sim)->variables;
+ GSList * i = GFS_DOMAIN (sim)->variables;
while (i) {
GfsVariable * v = i->data;
if (v->sources) {
@@ -1069,16 +1071,13 @@ void gfs_simulation_set_timestep (GfsSimulation * sim)
}
i = i->next;
}
-
- if (sim->advection_params.dt > sim->time.dtmax)
- sim->advection_params.dt = sim->time.dtmax;
gdouble tnext = G_MAXINT;
- GSList * i = sim->events->items;
+ i = sim->events->items;
while (i) {
GfsEvent * event = i->data;
if (t < event->t && event->t < tnext)
- tnext = event->t;
+ tnext = event->t + 1e-9;
i = i->next;
}
if (sim->time.end < tnext)
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list