From d7bb127b4e5101e8f8d8c644d9ae7229effc3ea6 Mon Sep 17 00:00:00 2001 From: eschnett Date: Mon, 10 Mar 2014 18:55:44 +0000 Subject: Correct RK87 git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@214 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b --- src/RK87.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/RK87.c b/src/RK87.c index fb16b37..90a553b 100644 --- a/src/RK87.c +++ b/src/RK87.c @@ -71,6 +71,7 @@ void MoL_RK87Add(CCTK_ARGUMENTS) CCTK_INT arraydim; static CCTK_INT scratchspace_firstindex = -99; + static CCTK_INT error_firstindex = -99; CCTK_INT var, scratchstep; CCTK_INT totalsize; @@ -131,6 +132,10 @@ void MoL_RK87Add(CCTK_ARGUMENTS) { scratchspace_firstindex = CCTK_FirstVarIndex("MOL::SCRATCHSPACE"); } + if (error_firstindex == -99) + { + error_firstindex = CCTK_FirstVarIndex("MOL::ERRORESTIMATE"); + } /* Real GFs */ @@ -146,20 +151,19 @@ void MoL_RK87Add(CCTK_ARGUMENTS) { int const step = MoL_Intermediate_Steps - (*MoL_Intermediate_Step); int const scratchvarindex = - scratchspace_firstindex + MoL_Num_Evolved_Vars * step + var; + scratchspace_firstindex + MoLNumEvolvedVariables * step + var; int const nsrcs = 1; CCTK_INT const srcs[] = {RHSVariableIndex[var]}; CCTK_INT const tls[] = {0}; CCTK_REAL const facts[] = {(*Original_Delta_Time) / cctkGH->cctk_timefac}; MoL_LinearCombination(cctkGH, - scratchvarindex, rl, tl, 1.0, + scratchvarindex, rl, tl, 0.0, srcs, tls, facts, nsrcs); } for (var = 0; var < MoLNumEvolvedVariables; var++) { - int const error_firstindex = CCTK_FirstVarIndex("MOL::ERRORESTIMATE"); int const step = MoL_Intermediate_Steps - (*MoL_Intermediate_Step); if (*MoL_Intermediate_Step - 1) @@ -175,7 +179,7 @@ void MoL_RK87Add(CCTK_ARGUMENTS) for (scratchstep = 0; scratchstep < step + 1; scratchstep++) { int const scratchvarindex = - scratchspace_firstindex + MoL_Num_Evolved_Vars * scratchstep + var; + scratchspace_firstindex + MoLNumEvolvedVariables * scratchstep + var; srcs [scratchstep+1] = scratchvarindex; tls [scratchstep+1] = 0; facts[scratchstep+1] = beta_array[step][scratchstep]; @@ -199,7 +203,7 @@ void MoL_RK87Add(CCTK_ARGUMENTS) for (scratchstep = 0; scratchstep < 13; scratchstep++) { int const scratchvarindex = - scratchspace_firstindex + MoL_Num_Evolved_Vars * scratchstep + var; + scratchspace_firstindex + MoLNumEvolvedVariables * scratchstep + var; srcs [scratchstep+1] = scratchvarindex; tls [scratchstep+1] = 0; facts[scratchstep+1] = gamma_array[scratchstep]; @@ -219,7 +223,7 @@ void MoL_RK87Add(CCTK_ARGUMENTS) for (scratchstep = 0; scratchstep < 13; scratchstep++) { int const scratchvarindex = - scratchspace_firstindex + MoL_Num_Evolved_Vars * scratchstep + var; + scratchspace_firstindex + MoLNumEvolvedVariables * scratchstep + var; srcs [scratchstep] = scratchvarindex; tls [scratchstep] = 0; facts[scratchstep] = -- cgit v1.2.3