*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, 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.
{
gmx_bool bExcl;
double nonsimd_step_frac;
- int mb, nmol, ftype;
- gmx_moltype_t *molt;
+ int ftype;
double ndtot_c, ndtot_simd;
#if GMX_SIMD_HAVE_REAL
gmx_bool bSimdBondeds = TRUE;
*/
ndtot_c = 0;
ndtot_simd = 0;
- for (mb = 0; mb < mtop->nmolblock; mb++)
+ for (const gmx_molblock_t &molb : mtop->molblock)
{
- molt = &mtop->moltype[mtop->molblock[mb].type];
- nmol = mtop->molblock[mb].nmol;
+ const gmx_moltype_t *molt = &mtop->moltype[molb.type];
for (ftype = 0; ftype < F_NRE; ftype++)
{
int nbonds;
nd_c = NRAL(ftype) - 1;
break;
}
- nbonds = nmol*molt->ilist[ftype].nr/(1 + NRAL(ftype));
+ nbonds = molb.nmol*molt->ilist[ftype].nr/(1 + NRAL(ftype));
ndtot_c += nbonds*nd_c;
ndtot_simd += nbonds*nd_simd;
}
}
if (bExcl)
{
- ndtot_c += nmol*(molt->excls.nra - molt->atoms.nr)/2;
+ ndtot_c += molb.nmol*(molt->excls.nra - molt->atoms.nr)/2;
}
}
double *cost_pp,
gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
{
- t_atom *atom;
- int mb, nmol, atnr, cg, a, a0, ncqlj, ncq, nclj;
+ int atnr, cg, a0, ncqlj, ncq, nclj;
gmx_bool bBHAM, bLJcut, bWater, bQ, bLJ;
int nw, nqlj, nq, nlj;
double fq, fqlj, flj, fqljw, fqw;
t_iparams *iparams;
- gmx_moltype_t *molt;
bBHAM = (mtop->ffparams.functype[0] == F_BHAM);
nlj = 0;
*bChargePerturbed = FALSE;
*bTypePerturbed = FALSE;
- for (mb = 0; mb < mtop->nmolblock; mb++)
+ for (const gmx_molblock_t &molb : mtop->molblock)
{
- molt = &mtop->moltype[mtop->molblock[mb].type];
- atom = molt->atoms.atom;
- nmol = mtop->molblock[mb].nmol;
- a = 0;
+ const gmx_moltype_t *molt = &mtop->moltype[molb.type];
+ const t_atom *atom = molt->atoms.atom;
+ int a = 0;
for (cg = 0; cg < molt->cgs.nr; cg++)
{
bWater = !bBHAM;
}
if (bWater)
{
- nw += nmol;
+ nw += molb.nmol;
}
else
{
- nqlj += nmol*ncqlj;
- nq += nmol*ncq;
- nlj += nmol*nclj;
+ nqlj += molb.nmol*ncqlj;
+ nq += molb.nmol*ncq;
+ nlj += molb.nmol*nclj;
}
}
}
double *cost_pp,
gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
{
- t_atom *atom;
- int mb, nmol, atnr, a, nqlj, nq, nlj;
+ int atnr, a, nqlj, nq, nlj;
gmx_bool bQRF;
t_iparams *iparams;
- gmx_moltype_t *molt;
real r_eff;
double c_qlj, c_q, c_lj;
double nppa;
nq = 0;
*bChargePerturbed = FALSE;
*bTypePerturbed = FALSE;
- for (mb = 0; mb < mtop->nmolblock; mb++)
+ for (const gmx_molblock_t &molb : mtop->molblock)
{
- molt = &mtop->moltype[mtop->molblock[mb].type];
- atom = molt->atoms.atom;
- nmol = mtop->molblock[mb].nmol;
+ const gmx_moltype_t *molt = &mtop->moltype[molb.type];
+ const t_atom *atom = molt->atoms.atom;
for (a = 0; a < molt->atoms.nr; a++)
{
if (atom[a].q != 0 || atom[a].qB != 0)
if (iparams[(atnr+1)*atom[a].type].lj.c6 != 0 ||
iparams[(atnr+1)*atom[a].type].lj.c12 != 0)
{
- nqlj += nmol;
+ nqlj += molb.nmol;
}
else
{
- nq += nmol;
+ nq += molb.nmol;
}
}
if (atom[a].q != atom[a].qB)