Fixes a bug in pull group size calculation
authorMagnus Lundborg <lundborg.magnus@gmail.com>
Fri, 21 Sep 2018 07:14:41 +0000 (09:14 +0200)
committerMagnus Lundborg <lundborg.magnus@gmail.com>
Fri, 21 Sep 2018 07:14:41 +0000 (09:14 +0200)
The wrong atom indexes were used when checking the coordinates
of atoms in a pull group (commit aa102e691d59b4de37c8e4).
That lead to false reports of too large pull group
(and presumably false negatives). This fixes the problem.

Refs #2397

Change-Id: Ib7d7e648204c0d1b219714610de7fb5842713048

src/gromacs/pulling/pullutil.cpp

index a3b068c57240d96f058fd36c5f2b2e1b13a0792c..faf588b424554949f4b82968e4a99c792a2c337a 100644 (file)
@@ -857,7 +857,7 @@ static bool pullGroupObeysPbcRestrictions(const pull_group_work_t &group,
     for (gmx::index indexInSet = 0; indexInSet < localAtomIndices.size(); indexInSet++)
     {
         rvec dx;
-        pbc_dx(&pbc, x[indexInSet], x_pbc, dx);
+        pbc_dx(&pbc, x[localAtomIndices[indexInSet]], x_pbc, dx);
 
         bool atomIsTooFar = false;
         if (pbcIsRectangular)