diff options
Diffstat (limited to 'src/RK4.c')
-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 */ |