From a741d07b604e2952a0113203faccd310271dc233 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Wed, 13 Feb 2019 09:55:35 +0100 Subject: [PATCH] Fix mass Delta H double counting With separate mass lambda parameters, the perturbed mass contribution to Delta H (not dH/dlambda) was double counted. This was due to an incorrect fix for issue #2703 for missing Delta H contribution. Refs #2703 Fixes #2849 Change-Id: I1349260e1e90a17a6b7dbe0d239d9474dcfa928c --- docs/release-notes/2019/2019.1.rst | 11 +++++++++++ src/gromacs/mdlib/force.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/2019/2019.1.rst b/docs/release-notes/2019/2019.1.rst index 95956b8c7d..88bdcb2943 100644 --- a/docs/release-notes/2019/2019.1.rst +++ b/docs/release-notes/2019/2019.1.rst @@ -46,6 +46,17 @@ and domain decomposition could lead to a segmentation fault. :issue:`2813` +Correct free-energy Delta H output with mass lambda's +----------------------------------------------------- + +When separate lambda parameters were used for perturbed mass +free-energy contributions, these contributions were double counted +in the Delta H output used for BAR calculations. Note that dH/dlambda +was always correct + +:issue:`2703` +:issue:`2849` + Prevent mdrun -rerun from writing incorrect free-energy output -------------------------------------------------------------- diff --git a/src/gromacs/mdlib/force.cpp b/src/gromacs/mdlib/force.cpp index e86d4eee61..8a76153651 100644 --- a/src/gromacs/mdlib/force.cpp +++ b/src/gromacs/mdlib/force.cpp @@ -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,2015,2016,2017,2018, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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. @@ -784,7 +784,7 @@ void sum_dhdl(gmx_enerdata_t *enerd, gmx::ArrayRef lambda, t_lambda enerpart_lambda += dlam*enerd->term[F_DVDL_CONSTR]; } - if (j == efptMASS) + if (j == efptMASS && !fepvals->separate_dvdl[j]) { enerpart_lambda += dlam*enerd->term[F_DKDL]; } -- 2.11.4.GIT