[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:19 UTC 2009
The following commit has been merged in the upstream branch:
commit ce57953287aa568126054a8939396a63af1f641d
Author: Stephane Popinet <popinet at users.sf.net>
Date: Thu Oct 12 07:05:08 2006 +1000
Fixed timestep calculation for 'infinite' events
darcs-hash:20061011210508-d4795-5f41cc57b36341d48656e58fb0787939d9c1adbe.gz
diff --git a/src/simulation.c b/src/simulation.c
index b38fb9b..b4081b1 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -1020,9 +1020,9 @@ void gfs_simulation_set_timestep (GfsSimulation * sim)
if (sim->time.end < tnext)
tnext = sim->time.end;
- if (tnext < G_MAXDOUBLE) {
- gdouble n = ceil ((tnext - t)/sim->advection_params.dt);
- sim->advection_params.dt = n > 0. ? (tnext - t)/n : 0.;
+ gdouble n = ceil ((tnext - t)/sim->advection_params.dt);
+ if (n > 0. && n < 1e9) {
+ sim->advection_params.dt = (tnext - t)/n;
if (n == 1.)
sim->tnext = tnext;
else
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list