Mistake in the `rshift` for the `cj` side of the stellar loops
It looks like there might be a mistake in the star pair loop in the case where we have a periodic BC.
On this line https://gitlab.cosma.dur.ac.uk/swift/swiftsim/blob/master/src/runner_doiact_functions_stars.h#L456 we end up deducting rshift
twice (once explicitly and once via dx_max_rshift
). That is wrong.
It also affects the loop exit condition on line 456.
@chaikin spotted this and proposed to change the sign of rhsift
on line 432. This would cancel all the rshift
on the LHS of line 456 and only keep the one that is correctly used in di_max
on the RHS.
What do you think?
Edited by Matthieu Schaller