Fixes a bug in pull group size calculation
[alexxy/gromacs.git] / 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)