diff options
-rw-r--r-- | src/RK4.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -118,11 +118,11 @@ CCTK_WARN(0, "not implemented"); { case 0: alpha = 1.0 / 3.0; - beta = 0.5; + beta = 1.0 / 2.0; break; case 1: alpha = 2.0 / 3.0; - beta = 0.5; + beta = 1.0 / 2.0; break; case 2: alpha = 1.0 / 3.0; @@ -133,6 +133,7 @@ CCTK_WARN(0, "not implemented"); beta = 1.0 / 6.0; } + /* Initialise alpha before the first intermediate step */ if (MoL_Intermediate_Steps == (*MoL_Intermediate_Step)) { sum_alpha = 0.0; @@ -292,7 +293,7 @@ CCTK_WARN(0, "not done"); #pragma omp parallel for for (index = 0; index < arraytotalsize; index++) { - UpdateVar[index] += ScratchVar[index] - 4.0 / 3.0 * OldVar[index]; + UpdateVar[index] += ScratchVar[index] - (sum_alpha - 1.0) * OldVar[index]; } } arrayscratchlocation += arraytotalsize; |