Always set b-state posres, even if identical to a-state
[alexxy/gromacs.git] / 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,