Correct LINCS dHdl contribution
authorBerk Hess <hess@kth.se>
Mon, 9 Nov 2015 14:52:10 +0000 (15:52 +0100)
committerBerk Hess <hess@kth.se>
Mon, 9 Nov 2015 15:37:27 +0000 (16:37 +0100)
The LINCS constraint contribution to dH/dlambda was missing a factor
1/delta_t^2 and thus orders of magnitude too small.

Fixes #1851

Change-Id: I864726d9a86a34207d2a02ad0803874fbfb33966

src/gromacs/mdlib/clincs.c

index 783ad72c8530158783b5eab8f7f3d647489c9f75..5d843094bce3ea853b904fbdca81520a4e1072f7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1705,7 +1705,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         {
             dhdlambda += lincsd->th[th].dhdlambda;
         }
-        if (econqCoord)
+        if (econq == econqCoord)
         {
             /* dhdlambda contains dH/dlambda*dt^2, correct for this */
             dhdlambda /= ir->delta_t*ir->delta_t;