diff options
Diffstat (limited to 'src/SetTime.c')
-rw-r--r-- | src/SetTime.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/SetTime.c b/src/SetTime.c index af044f4..1d1596d 100644 --- a/src/SetTime.c +++ b/src/SetTime.c @@ -57,6 +57,35 @@ static const CCTK_REAL alpha_array[6] = { 1.0/2.0, }; +/* RK65 coefficients */ +static const CCTK_REAL alpha_array65[8] = { + 0.0, + 1.0/10.0, + 2.0/9.0, + 3.0/7.0, + 3.0/5.0, + 4.0/5.0, + 1.0, + 1.0 +}; + +/* RK87 coefficients */ + static const CCTK_REAL alpha_array87[13] = { + 0.0, + 1.0/18.0, + 1.0/12.0, + 1.0/8.0, + 5.0/16.0, + 3.0/8.0, + 59.0/400.0, + 93.0/200.0, + 5490023248.0/9719169821.0, + 13.0/20.0, + 1201146811.0/1299019798.0, + 1.0, + 1.0 +}; + /******************************************************************** ********************* External Routines ********************** ********************************************************************/ @@ -216,6 +245,22 @@ int MoL_ResetTime(CCTK_ARGUMENTS) + ((alpha_array[substep] - 1) * (* Original_Delta_Time) / cctkGH->cctk_timefac)); } + else if (CCTK_EQUALS(ODE_Method,"RK65")) + { + const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); + cctkGH->cctk_time + = ((* Original_Time) + + ((alpha_array65[substep] - 1) + * (* Original_Delta_Time) / cctkGH->cctk_timefac)); + } + else if (CCTK_EQUALS(ODE_Method,"RK87")) + { + const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); + cctkGH->cctk_time + = ((* Original_Time) + + ((alpha_array87[substep] - 1) + * (* Original_Delta_Time) / cctkGH->cctk_timefac)); + } #ifdef MOLDEBUG printf("MoL has once more reset t (%d): %f.\n", *MoL_Intermediate_Step, cctkGH->cctk_time); @@ -301,6 +346,20 @@ int MoL_ResetDeltaTime(CCTK_ARGUMENTS) = ((alpha_array[substep + 1] - alpha_array[substep]) * (* Original_Delta_Time)); } + else if (CCTK_EQUALS(ODE_Method,"RK65")) + { + const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); + cctkGH->cctk_delta_time + = ((alpha_array65[substep + 1] - alpha_array65[substep]) + * (* Original_Delta_Time)); + } + else if (CCTK_EQUALS(ODE_Method,"RK87")) + { + const int substep = MoL_Intermediate_Steps - (* MoL_Intermediate_Step); + cctkGH->cctk_delta_time + = ((alpha_array87[substep + 1] - alpha_array87[substep]) + * (* Original_Delta_Time)); + } #ifdef MOLDEBUG printf("MoL has once more reset dt (%d): %f.\n", *MoL_Intermediate_Step, |