diff options
author | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2006-07-28 09:43:58 +0000 |
---|---|---|
committer | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2006-07-28 09:43:58 +0000 |
commit | eeb8bdf88f9b3de750e95bdb98ae78a8f9b4ad49 (patch) | |
tree | a977e595715cf6812308bdbf4d222cdf669f3b39 /src/SetTime.c | |
parent | 98729fc9f1f8008d16f827f8147bac3760a977e6 (diff) |
Efficient RK4, as provided by Yosef Zlochower.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@113 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/SetTime.c')
-rw-r--r-- | src/SetTime.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SetTime.c b/src/SetTime.c index 3e9ae3f..5149eb2 100644 --- a/src/SetTime.c +++ b/src/SetTime.c @@ -247,6 +247,22 @@ int MoL_ResetTime(CCTK_ARGUMENTS) 0.5*(*Original_Delta_Time)/cctkGH->cctk_timefac; } } + else if (CCTK_EQUALS(ODE_Method,"RK4")) + { + const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); + + CCTK_REAL dt = (*Original_Delta_Time)/cctkGH->cctk_timefac; + switch (substep) + { + case 1: + case 2: + dt *= 0.5; + break; + default: + dt = 0; + } + cctkGH->cctk_time = (*Original_Time) - dt; + } else if (CCTK_EQUALS(ODE_Method,"RK45") || CCTK_EQUALS(ODE_Method,"RK45CK")) { const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); |