diff options
-rw-r--r-- | src/GenericRK.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/GenericRK.c b/src/GenericRK.c index 196c83e..60648f1 100644 --- a/src/GenericRK.c +++ b/src/GenericRK.c @@ -101,7 +101,12 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS) { totalsize *= cctk_lsh[arraydim]; } - + + if (scratchspace_firstindex == -99) + { + scratchspace_firstindex = CCTK_FirstVarIndex("MOL::SCRATCHSPACE"); + } + beta = RKBetaCoefficients[MoL_Intermediate_Steps - (*MoL_Intermediate_Step)]; @@ -176,7 +181,7 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS) scratchindex) * totalsize]; */ ScratchVar = CCTK_VarDataPtrI(cctkGH, 0, - CCTK_FirstVarIndex("MOL::SCRATCHSPACE") + scratchspace_firstindex + var + MoL_Num_Evolved_Vars * scratchindex); #ifdef MOLDEBUG @@ -231,7 +236,7 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS) (*MoL_Intermediate_Step)) * totalsize]; */ ScratchVar = CCTK_VarDataPtrI(cctkGH, 0, - CCTK_FirstVarIndex("MOL::SCRATCHSPACE") + scratchspace_firstindex + var + MoL_Num_Evolved_Vars * (MoL_Intermediate_Steps - (*MoL_Intermediate_Step))); #ifdef MOLDEBUG |