bugfix for md-vv + nose-hoover + (nstcalcenergy > nsttcouple)
authorMichael Shirts <michael.shirts@virginia.edu>
Thu, 14 Feb 2013 03:01:14 +0000 (22:01 -0500)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 15 Feb 2013 22:34:39 +0000 (23:34 +0100)
Need global communication the step befre nsttcouple
in order to get the kinetic energy right, because
of the offsets velocity verlet from leapfrog.

Fixes redmine #1129

Change-Id: Ia6157db8304cc4fb8cccbda0ac3b949e800efeb5

src/kernel/md.c

index ce7479b133237fca2f3fdab725b6f99a197d4d46..631154fe87b3b2b8a182111a3a513f61976de2a2 100644 (file)
@@ -1114,7 +1114,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
         /* Do we need global communication ? */
         bGStat = (bCalcVir || bCalcEner || bStopCM ||
-                  do_per_step(step, nstglobalcomm) ||
+                  do_per_step(step, nstglobalcomm) || (bVV && IR_NVT_TROTTER(ir) && do_per_step(step-1, nstglobalcomm)) ||
                   (ir->nstlist == -1 && !bRerunMD && step >= nlh.step_nscheck));
 
         do_ene = (do_per_step(step, ir->nstenergy) || bLastStep);