A .top that has B-state parameters for non-bonded interactions
should run the same with free-energy = no as a .top that has no
B-state parameters. Renamed variable to better reflect its use,
and used it to correctly trigger the FEP code path.
Change-Id: I47656b29ef4ca2462af0fb587e0424d0eab3d5c4
int *a_con;
int ftype;
int ia;
int *a_con;
int ftype;
int ia;
- gmx_bool bId, *bExcl, bExclIntraAll, bExclInter, bHaveVDW, bHaveQ, bFEP;
+ gmx_bool bId, *bExcl, bExclIntraAll, bExclInter, bHaveVDW, bHaveQ, bHavePerturbedAtoms;
ncg_tot = ncg_mtop(mtop);
snew(cginfo_mb, mtop->nmolblock);
ncg_tot = ncg_mtop(mtop);
snew(cginfo_mb, mtop->nmolblock);
/* bExclIntraAll: all intra cg interactions excluded
* bExclInter: any inter cg interactions excluded
*/
/* bExclIntraAll: all intra cg interactions excluded
* bExclInter: any inter cg interactions excluded
*/
- bExclIntraAll = TRUE;
- bExclInter = FALSE;
- bHaveVDW = FALSE;
- bHaveQ = FALSE;
- bFEP = FALSE;
+ bExclIntraAll = TRUE;
+ bExclInter = FALSE;
+ bHaveVDW = FALSE;
+ bHaveQ = FALSE;
+ bHavePerturbedAtoms = FALSE;
for (ai = a0; ai < a1; ai++)
{
/* Check VDW and electrostatic interactions */
for (ai = a0; ai < a1; ai++)
{
/* Check VDW and electrostatic interactions */
bHaveQ = bHaveQ || (molt->atoms.atom[ai].q != 0 ||
molt->atoms.atom[ai].qB != 0);
bHaveQ = bHaveQ || (molt->atoms.atom[ai].q != 0 ||
molt->atoms.atom[ai].qB != 0);
- bFEP = bFEP || (PERTURBED(molt->atoms.atom[ai]) != 0);
+ bHavePerturbedAtoms = bHavePerturbedAtoms || (PERTURBED(molt->atoms.atom[ai]) != 0);
/* Clear the exclusion list for atom ai */
for (aj = a0; aj < a1; aj++)
/* Clear the exclusion list for atom ai */
for (aj = a0; aj < a1; aj++)
{
SET_CGINFO_HAS_Q(cginfo[cgm+cg]);
}
{
SET_CGINFO_HAS_Q(cginfo[cgm+cg]);
}
+ if (bHavePerturbedAtoms && fr->efep != efepNO)
{
SET_CGINFO_FEP(cginfo[cgm+cg]);
*bFEP_NonBonded = TRUE;
{
SET_CGINFO_FEP(cginfo[cgm+cg]);
*bFEP_NonBonded = TRUE;