diff options
author | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-07-08 13:54:49 +0000 |
---|---|---|
committer | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-07-08 13:54:49 +0000 |
commit | 914705c9c1061631babe6376cf5b6e32dc4544db (patch) | |
tree | 56ec1b5ff01ec9ee105f114a412a005a6a11ca0e /src/SetTime.c | |
parent | ba2fe21b1c1379619f3eee1c6080b0812b2f6761 (diff) |
Correct the setting of cctk_time for the generic solvers. Should only affect Carpet runs.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@20 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/SetTime.c')
-rw-r--r-- | src/SetTime.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/SetTime.c b/src/SetTime.c index 718ef44..927f5fa 100644 --- a/src/SetTime.c +++ b/src/SetTime.c @@ -132,19 +132,39 @@ int MoL_ResetTime(CCTK_ARGUMENTS) } else if (CCTK_EQUALS(ODE_Method,"Generic")) { - previous_times[0] = (*Original_Time) - (*Original_Delta_Time)/cctkGH->cctk_timefac; - for (i = MoL_Intermediate_Steps - 1; i > *MoL_Intermediate_Step; i--) + previous_times[0] = (*Original_Time) - + (*Original_Delta_Time)/cctkGH->cctk_timefac; + for (i = MoL_Intermediate_Steps - 1; i > *MoL_Intermediate_Step - 1; i--) { + previous_times[MoL_Intermediate_Steps - i] = + RKBetaCoefficients[MoL_Intermediate_Steps - i - 1] * + (*Original_Delta_Time)/cctkGH->cctk_timefac; for (j = MoL_Intermediate_Steps; j > i; j--) { - alphaindex = (MoL_Intermediate_Steps - i) * - MoL_Intermediate_Steps + j; - previous_times[MoL_Intermediate_Steps - i] = - RKBetaCoefficients[MoL_Intermediate_Steps - j] * - (*Original_Delta_Time)/cctkGH->cctk_timefac + - RKAlphaCoefficients[alphaindex]; + alphaindex = (MoL_Intermediate_Steps - i - 1) * + MoL_Intermediate_Steps + MoL_Intermediate_Steps - j; + previous_times[MoL_Intermediate_Steps - i] += + RKAlphaCoefficients[alphaindex] * + previous_times[MoL_Intermediate_Steps - j]; +#ifdef MOLDEBUG + printf("i %d j %d is %d index %d t %g dt %g alpha %g beta %g\n", + i, j, MoL_Intermediate_Steps, alphaindex, + previous_times[MoL_Intermediate_Steps - i], + (*Original_Delta_Time)/cctkGH->cctk_timefac, + RKAlphaCoefficients[alphaindex], + RKBetaCoefficients[MoL_Intermediate_Steps - i - 1]); +#endif } } +#ifdef MOLDEBUG + printf("MoL says the previous times are "); + for (i = 0; i < MoL_Intermediate_Steps - *MoL_Intermediate_Step + + 1; i++) + { + printf("%g ", previous_times[i]); + } + printf("\n"); +#endif cctkGH->cctk_time = previous_times[MoL_Intermediate_Steps - *MoL_Intermediate_Step]; } |