Merge branch 'release-2018'
[alexxy/gromacs.git] / src / gromacs / mdlib / update.cpp
index 1cab82b2695e1726920a1e8ebdcbe6787d0eca3c..60896c1045bf14c35777ed6ccd978290bc47ae47 100644 (file)
@@ -549,23 +549,34 @@ static void do_update_md(int                         start,
 
     if (doNoseHoover || doPROffDiagonal || doAcceleration)
     {
+        matrix stepM;
+        if (!doParrinelloRahman)
+        {
+            /* We should not apply PR scaling at this step */
+            clear_mat(stepM);
+        }
+        else
+        {
+            copy_mat(M, stepM);
+        }
+
         if (!doAcceleration)
         {
             updateMDLeapfrogGeneral<AccelerationType::none>
                 (start, nrend, doNoseHoover, dt, dtPressureCouple,
-                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, stepM);
         }
         else if (ekind->bNEMD)
         {
             updateMDLeapfrogGeneral<AccelerationType::group>
                 (start, nrend, doNoseHoover, dt, dtPressureCouple,
-                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, stepM);
         }
         else
         {
             updateMDLeapfrogGeneral<AccelerationType::cosine>
                 (start, nrend, doNoseHoover, dt, dtPressureCouple,
-                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, stepM);
         }
     }
     else