Always set b-state posres, even if identical to a-state
authorErik Lindahl <erik@kth.se>
Fri, 20 Jun 2014 15:23:06 +0000 (17:23 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 27 Jun 2014 21:51:28 +0000 (23:51 +0200)
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

index fc7b2c5555164fff59a550c796094b1cc27723c4..4c1e6d888b1d87f78ec401907d5bd23fb0829074 100644 (file)
@@ -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,