Verified Commit bbb1b47f authored by Kai Szuttor's avatar Kai Szuttor

Merge branch 'python' of https://github.com/espressomd/espresso into features

parents a13dde59 7a485cc4
Pipeline #4488 passed with stages
in 125 minutes and 57 seconds
......@@ -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) {
pos[dir] += box_l[dir];
image_box[dir] -= 1;
}
while (pos[dir] >= box_l[dir]) {
pos[dir] -= box_l[dir];
image_box[dir] += 1;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment