aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@5633253d-7678-4964-a54d-f87795f8ee59>2002-12-22 22:13:28 +0000
committerallen <allen@5633253d-7678-4964-a54d-f87795f8ee59>2002-12-22 22:13:28 +0000
commit7a4d027bf05e9c29ae5f654ab47e6283c6385984 (patch)
tree87fb1669612775c091f545bd9ab9e03edd3e3175 /src
parentd0aff2cc6d5c896d7492f87c5da8e619e26364bf (diff)
Patch for halting at cctk_final_time when using Courant timestep from Ian Hawke
Fixes CactusBase/1345 git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Time/trunk@53 5633253d-7678-4964-a54d-f87795f8ee59
Diffstat (limited to 'src')
-rw-r--r--src/Courant.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Courant.c b/src/Courant.c
index ade4e53..3d7451e 100644
--- a/src/Courant.c
+++ b/src/Courant.c
@@ -59,6 +59,14 @@ void Time_Courant(CCTK_ARGUMENTS)
(*courant_wave_speed)/sqrt((double) cctk_dim);
}
+ if (CCTK_Equals(terminate, "time")||CCTK_Equals(terminate, "both"))
+ {
+ if (cctkGH->cctk_time + *courant_dt > cctk_final_time)
+ {
+ *courant_dt = (1 + 1.e-10) * (cctk_final_time - cctkGH->cctk_time);
+ }
+ }
+
/* Set the Cactus timestep */
if (!timestep_outonly)