From 7a4d027bf05e9c29ae5f654ab47e6283c6385984 Mon Sep 17 00:00:00 2001 From: allen Date: Sun, 22 Dec 2002 22:13:28 +0000 Subject: 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 --- src/Courant.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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) -- cgit v1.2.3