Fixed sign error in posres dvdl
authorBerk Hess <hess@kth.se>
Mon, 16 Jun 2014 07:17:35 +0000 (09:17 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 18 Jun 2014 06:47:29 +0000 (08:47 +0200)
For position restraints the sign of the contribution of the change
in reference location was incorrect. Note that the contribution of
the change in force constant was and is correct.

Fixes #1408.

Change-Id: I75210c3855d13fdd58e0a698d6c5d7c7116f456b

src/gmxlib/bondfree.c

index 2c25351ec20380e4eb27ad9e2c535f451ba0c5f4..e9f68b3c10337e2ed807f86df9d5a906fcf09f37 100644 (file)
@@ -2297,7 +2297,7 @@ real posres(int nbonds,
             vtot       += 0.5*kk*dx[m]*dx[m];
             *dvdlambda +=
                 0.5*(pr->posres.fcB[m] - pr->posres.fcA[m])*dx[m]*dx[m]
-                -fm*dpdl[m];
+                fm*dpdl[m];
 
             /* Here we correct for the pbc_dx which included rdist */
             if (bForceValid)