aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2011-05-24 19:18:47 +0000
committereschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2011-05-24 19:18:47 +0000
commit06ab1f5caf1a3a3a4a372b8dee6539da8f9e919d (patch)
tree2ed8977adb52820fa5b235f794c5be8d900c1cdd
parent42b20a1be5e2d6baf633cd68adff4991e869c154 (diff)
Correct calculation of sum_alpha when more than one component (or more
than one map) exist on the current process git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@147 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
-rw-r--r--src/RK4.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/RK4.c b/src/RK4.c
index 55a4a4e..f0ebc8f 100644
--- a/src/RK4.c
+++ b/src/RK4.c
@@ -100,6 +100,8 @@ CCTK_WARN(0, "not implemented");
we know the "real" alpha (including round-off errors) when we
calculate the final result. */
static CCTK_REAL sum_alpha;
+ /* the last MoL intermediate step that was summed */
+ static CCTK_INT last_sum_step;
totalsize = 1;
for (arraydim = 0; arraydim < cctk_dim; arraydim++)
@@ -134,8 +136,14 @@ CCTK_WARN(0, "not implemented");
if (MoL_Intermediate_Steps == (*MoL_Intermediate_Step))
{
sum_alpha = 0.0;
+ last_sum_step = -1;
+ }
+ /* Add alpha once per intermediate step */
+ if (last_sum_step != (*MoL_Intermediate_Step))
+ {
+ sum_alpha += alpha;
+ last_sum_step = (*MoL_Intermediate_Step);
}
- sum_alpha += alpha;
/* FIXME */