From 0e80bfd460b0faa686b3723e36852cbde0f859d0 Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Fri, 20 Jun 2014 17:23:06 +0200 Subject: [PATCH] Always set b-state posres, even if identical to a-state Previously we did not read the b-state position restraint file (option -rb) if the name was identical to the a-state, which caused the position restraints to be zero. Rather than trying to be smart, we now always read it. Fixes #1399. Change-Id: I13d93ab667734f022e48143e4cd0672b7f303e1c --- src/gromacs/gmxpreprocess/grompp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gromacs/gmxpreprocess/grompp.c b/src/gromacs/gmxpreprocess/grompp.c index fc7b2c5555..4c1e6d888b 100644 --- a/src/gromacs/gmxpreprocess/grompp.c +++ b/src/gromacs/gmxpreprocess/grompp.c @@ -949,10 +949,10 @@ static void gen_posres(gmx_mtop_t *mtop, t_molinfo *mi, int i, j; read_posres (mtop, mi, FALSE, fnA, rc_scaling, ePBC, com, wi); - if (strcmp(fnA, fnB) != 0) - { - read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi); - } + /* It is safer to simply read the b-state posres rather than trying + * to be smart and copy the positions. + */ + read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi); } static void set_wall_atomtype(gpp_atomtype_t at, t_gromppopts *opts, -- 2.22.0