/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020, 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.
{
for (size_t i = 0; i < ilist.iatoms.size(); i += ilistStride(ilist))
{
- if (isConstraintFlexible(iparams.data(), ilist.iatoms[i]))
+ if (isConstraintFlexible(iparams, ilist.iatoms[i]))
{
return true;
}
}
/* Combine all constraint ilists into a single one */
- InteractionList constraintsCombined = jointConstraintList(moltype);
- t_ilist ilistsCombined[F_NRE];
- ilistsCombined[F_CONSTR].nr = constraintsCombined.iatoms.size();
- ilistsCombined[F_CONSTR].iatoms = constraintsCombined.iatoms.data();
- ilistsCombined[F_CONSTRNC].nr = 0;
+ std::array<InteractionList, F_NRE> ilistsCombined;
+ ilistsCombined[F_CONSTR] = jointConstraintList(moltype);
/* We "include" flexible constraints, but none are present (checked above) */
- const ListOfLists<int> at2con = make_at2con(moltype.atoms.nr, ilistsCombined, iparams.data(),
+ const ListOfLists<int> at2con = make_at2con(moltype.atoms.nr, ilistsCombined, iparams,
FlexibleConstraintTreatment::Include);
bool satisfiesCriteria = true;
int firstAtom = 0;
while (satisfiesCriteria && firstAtom < moltype.atoms.nr)
{
- int numAtomsInGroup = detectGroup(firstAtom, moltype, at2con, constraintsCombined);
+ int numAtomsInGroup = detectGroup(firstAtom, moltype, at2con, ilistsCombined[F_CONSTR]);
if (numAtomsInGroup == 0)
{
maxAtom = a;
}
}
- GMX_ASSERT(maxAtom >= 0 || settles.size() > 0,
+ GMX_ASSERT(maxAtom >= 0 || !settles.empty(),
"We should have at least two atoms in the group with constraints");
if (maxAtom < 0)
{