Merge release-4-6 into master
[alexxy/gromacs.git] / src / programs / mdrun / md.c
index 3786eee68cbd2a8c0e61de4308b740e64b4f0319..535b023658ea7ad53a17a6d21295427a91d7648e 100644 (file)
@@ -1487,7 +1487,7 @@ double do_md(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
         if (ETC_ANDERSEN(ir->etc) && EI_VV(ir->eI))
         {
             gmx_bool bDoAndersenConstr;
-            bDoAndersenConstr = update_randomize_velocities(ir,step,mdatoms,state,upd,&top->idef,constr);
+            bDoAndersenConstr = (constr && update_randomize_velocities(ir,step,mdatoms,state,upd,&top->idef,constr));
             /* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
             if (bDoAndersenConstr)
             {