diff options
author | eschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2014-03-10 18:55:44 +0000 |
---|---|---|
committer | eschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2014-03-10 18:55:44 +0000 |
commit | d7bb127b4e5101e8f8d8c644d9ae7229effc3ea6 (patch) | |
tree | 76e439d84d55fe33f45e0d7a9aafd1d62a88af26 | |
parent | 2a23547857e66ae1dbe473e08cbf168958c376d2 (diff) |
Correct RK87
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@214 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
-rw-r--r-- | src/RK87.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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] = |