diff options
author | eschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2011-05-24 19:18:47 +0000 |
---|---|---|
committer | eschnett <eschnett@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2011-05-24 19:18:47 +0000 |
commit | 06ab1f5caf1a3a3a4a372b8dee6539da8f9e919d (patch) | |
tree | 2ed8977adb52820fa5b235f794c5be8d900c1cdd /src | |
parent | 42b20a1be5e2d6baf633cd68adff4991e869c154 (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
Diffstat (limited to 'src')
-rw-r--r-- | src/RK4.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 */ |