Case when i compared to i is not needed as particles dont interact with themselves |
At step k, interact particle i with particle j= 1 + mod((i+k-1),N) |
Accumulate force on i due to j in fixed Ai |
Accumulate negative of this as force on j due to i in circulating Acj |
At the end of the algorithm, add Ai and Aci |
In parallel version, Note that Ai will be calculated in "home processor for particle i but Aci will travel around the machine being accumulated in processor holding particle j |
Thus this violates the owner computes rule and so this parallel algorithm must be implemented by hand -- the compiler will not find it automatically |