Fix ref error in constraint pull code
[alexxy/gromacs.git] / src / mdlib / pull.c
index a06f7440aa6baf65bb1a8bbe9182f80f969a42e1..ce5961e86546e9cf846f903d8499038d039e0a68 100644 (file)
@@ -688,6 +688,21 @@ static void do_constraint(t_pull *pull, t_mdatoms *md, t_pbc *pbc,
         {
             pgrp = &pull->grp[g];
 
+            if (pull->eGeom == epullgPOS)
+            {
+                for (m = 0; m < DIM; m++)
+                {
+                    ref[m] = pgrp->init[m] + pgrp->rate*t*pgrp->vec[m];
+                }
+            }
+            else
+            {
+                ref[0] = pgrp->init[0] + pgrp->rate*t;
+                /* Keep the compiler happy */
+                ref[1] = 0;
+                ref[2] = 0;
+            }
+
             get_pullgrps_dr(pull, pbc, g, t, rinew[g], rjnew[PULL_CYL(pull) ? g : 0],
                             -1, unc_ij);