Skip to content

Commit

Permalink
Merge branch 'python' of https://github.com/espressomd/espresso into …
Browse files Browse the repository at this point in the history
…features
  • Loading branch information
KaiSzuttor committed Dec 17, 2018
2 parents a13dde5 + 7a485cc commit bbb1b47
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/core/grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,13 @@ Vector3d get_mi_vector(T const &a, U const &b) {
template <typename T1, typename T2, typename T3>
void fold_coordinate(T1 &pos, T2 &vel, T3 &image_box, int dir) {
if (PERIODIC(dir)) {
int img_count = (int)floor(pos[dir] * box_l_i[dir]);
image_box[dir] += img_count;
pos[dir] = pos[dir] - img_count * box_l[dir];

if (pos[dir] * box_l_i[dir] < -ROUND_ERROR_PREC ||
pos[dir] * box_l_i[dir] >= 1 + ROUND_ERROR_PREC) {

runtimeErrorMsg() << "particle coordinate out of range, pos = "
<< pos[dir] << ", image box = " << image_box[dir];

image_box[dir] = 0;
pos[dir] = 0;
return;
while (pos[dir] < 0) {

This comment has been minimized.

Copy link
@KaiSzuttor

KaiSzuttor Dec 17, 2018

Author Member

so these are the only changes between a failing rocm and non-failing?

pos[dir] += box_l[dir];
image_box[dir] -= 1;
}
while (pos[dir] >= box_l[dir]) {
pos[dir] -= box_l[dir];
image_box[dir] += 1;
}
}
}
Expand Down

0 comments on commit bbb1b47

Please sign in to comment.