Merge gromacs-4-6 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / pull.c
index 8c2ffbee8a812c5b1db333686038613a29036d6a..2d4db43a422bd253c731d28a2978402c408e77b7 100644 (file)
@@ -322,11 +322,11 @@ static void get_pullgrps_dr(const t_pull *pull,const t_pbc *pbc,int g,double t,
     for(m=0; m<DIM; m++)
     {
         dr[m] *= pull->dim[m];
-        dr2 += dr[m];
+        dr2 += dr[m]*dr[m];
     }
     if (max_dist2 >= 0 && dr2 > 0.98*0.98*max_dist2)
     {
-        gmx_fatal(FARGS,"Distance of pull group %d (%f nm) is larger than 0.49 times the box size (%f)",g,sqrt(dr2),max_dist2);
+        gmx_fatal(FARGS,"Distance of pull group %d (%f nm) is larger than 0.49 times the box size (%f)",g,sqrt(dr2),sqrt(max_dist2));
     }
 
     if (pull->eGeom == epullgDIRPBC)
@@ -524,7 +524,7 @@ static void do_constraint(t_pull *pull, t_mdatoms *md, t_pbc *pbc,
         }
     }
     
-    bConverged_all = TRUE;
+    bConverged_all = FALSE;
     while (!bConverged_all && niter < max_iter)
     {
         bConverged_all = TRUE;