/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
{
verletbuf_atomtype_t *att;
int natt;
- int mb, nmol, ft, i, a1, a2, a3, a;
- const t_atoms *atoms;
+ int ft, i, a1, a2, a3, a;
const t_ilist *il;
const t_iparams *ip;
atom_nonbonded_kinetic_prop_t *prop;
*n_nonlin_vsite = 0;
}
- for (mb = 0; mb < mtop->nmolblock; mb++)
+ for (const gmx_molblock_t &molblock : mtop->molblock)
{
- nmol = mtop->molblock[mb].nmol;
-
- atoms = &mtop->moltype[mtop->molblock[mb].type].atoms;
+ int nmol = molblock.nmol;
+ const gmx_moltype_t &moltype = mtop->moltype[molblock.type];
+ const t_atoms *atoms = &moltype.atoms;
/* Check for constraints, as they affect the kinetic energy.
* For virtual sites we need the masses and geometry of
for (ft = F_CONSTR; ft <= F_CONSTRNC; ft++)
{
- il = &mtop->moltype[mtop->molblock[mb].type].ilist[ft];
+ il = &moltype.ilist[ft];
for (i = 0; i < il->nr; i += 1+NRAL(ft))
{
}
}
- il = &mtop->moltype[mtop->molblock[mb].type].ilist[F_SETTLE];
+ il = &moltype.ilist[F_SETTLE];
for (i = 0; i < il->nr; i += 1+NRAL(F_SETTLE))
{
prop[a3].con_len = ip->settle.doh;
}
- get_vsite_masses(&mtop->moltype[mtop->molblock[mb].type],
+ get_vsite_masses(&moltype,
&mtop->ffparams,
vsite_m,
&n_nonlin_vsite_mol);