Open rhaas80 opened 7 years ago
Actually, moving the offset into the computation should do the trick:
ConditionalOnParameterTextual[
"(cctk_iteration - " <> functionName <> "_calc_offset) % " <> functionName <> "_calc_every != 0"
, "return;\n"],
No, that does not work either since it would compute eg for level 2 at iteration 1 (assuming offset is 1) but it would need to compute at iteration 3 for a calc_every of 4.
Currently Kranc always inserts this fragment (in Kranc/Tools/CodeGen/CodeGenCalculation.m)
which is however not correct in CCTK_EVOL since there the data that will appear as cctk_iteration = it is cctk_iteration+1. calc_offset does not help since it would have to be 1 for rl>rl_finest and 0 for rl==rk_finest.
As far as I know the only way to fix is to either make the condition dependent on EVOL vs POSTSTEP or to run at every single timestep.