snew(atom, 1);
/* First assign input line to temporary array */
- nfields = sscanf(line, "%s%s%s%s%s%s%s%s%s%s%s%s", tmpfield[0], tmpfield[1], tmpfield[2],
- tmpfield[3], tmpfield[4], tmpfield[5], tmpfield[6], tmpfield[7], tmpfield[8],
- tmpfield[9], tmpfield[10], tmpfield[11]);
+ nfields = sscanf(line,
+ "%s%s%s%s%s%s%s%s%s%s%s%s",
+ tmpfield[0],
+ tmpfield[1],
+ tmpfield[2],
+ tmpfield[3],
+ tmpfield[4],
+ tmpfield[5],
+ tmpfield[6],
+ tmpfield[7],
+ tmpfield[8],
+ tmpfield[9],
+ tmpfield[10],
+ tmpfield[11]);
/* Comments on optional fields in the atomtypes section:
*
{
if (have_bonded_type)
{
- nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf", type, btype, &atomnr, &m, &q,
- ptype, &c[0], &c[1]);
+ nread = sscanf(
+ line, "%s%s%d%lf%lf%s%lf%lf", type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1]);
if (nread < 8)
{
too_few(wi);
{
if (have_bonded_type)
{
- nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf%lf", type, btype, &atomnr, &m, &q,
- ptype, &c[0], &c[1], &c[2]);
+ nread = sscanf(
+ line, "%s%s%d%lf%lf%s%lf%lf%lf", type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2]);
if (nread < 9)
{
too_few(wi);
else
{
/* have_atomic_number && !have_bonded_type */
- nread = sscanf(line, "%s%d%lf%lf%s%lf%lf%lf", type, &atomnr, &m, &q, ptype,
- &c[0], &c[1], &c[2]);
+ nread = sscanf(
+ line, "%s%d%lf%lf%s%lf%lf%lf", type, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2]);
if (nread < 8)
{
too_few(wi);
if (have_bonded_type)
{
/* !have_atomic_number && have_bonded_type */
- nread = sscanf(line, "%s%s%lf%lf%s%lf%lf%lf", type, btype, &m, &q, ptype, &c[0],
- &c[1], &c[2]);
+ nread = sscanf(
+ line, "%s%s%lf%lf%s%lf%lf%lf", type, btype, &m, &q, ptype, &c[0], &c[1], &c[2]);
if (nread < 8)
{
too_few(wi);
GMX_ASSERT(nrfp <= MAXFORCEPARAM,
"This is ensured in other places, but we need this assert to keep the clang "
"analyzer happy");
- const bool identicalParameters = std::equal(
- bt->interactionTypes[i].forceParam().begin(),
- bt->interactionTypes[i].forceParam().begin() + nrfp, b.forceParam().begin());
+ const bool identicalParameters = std::equal(bt->interactionTypes[i].forceParam().begin(),
+ bt->interactionTypes[i].forceParam().begin() + nrfp,
+ b.forceParam().begin());
if (!bAllowRepeat || identicalParameters)
{
nrfpA = interaction_function[ftype].nrfpA;
strcpy(f1, formnl[nral]);
strcat(f1, formlf);
- if ((nn = sscanf(line, f1, &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9],
- &c[10], &c[11], &c[12]))
+ if ((nn = sscanf(
+ line, f1, &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9], &c[10], &c[11], &c[12]))
!= nrfp)
{
if (nn == nrfpA)
strcat(f1, formlf[nrfp - 1]);
/* Check number of parameters given */
- if ((nn = sscanf(line, f1, &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9],
- &c[10], &c[11]))
+ if ((nn = sscanf(
+ line, f1, &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9], &c[10], &c[11]))
!= nrfp)
{
if (nn == nrfpA)
{
auto message =
gmx::formatString("Error in reading cmap parameter for angle %s %s %s %s %s",
- alc[0], alc[1], alc[2], alc[3], alc[4]);
+ alc[0],
+ alc[1],
+ alc[2],
+ alc[3],
+ alc[4]);
warning_error(wi, message);
}
}
/* Check for the correct number of atoms (again) */
if (bt[F_CMAP].nct() != nct)
{
- auto message = gmx::formatString("Incorrect number of atom types (%d) in cmap type %d\n",
- nct, bt[F_CMAP].cmapAngles);
+ auto message = gmx::formatString(
+ "Incorrect number of atom types (%d) in cmap type %d\n", nct, bt[F_CMAP].cmapAngles);
warning_error(wi, message);
}
std::vector<int> atomTypes =
auto message = gmx::formatString(
"Atoms in the .top are not numbered consecutively from 1 (rather, "
"atomnr = %d, while at->nr = %d)",
- atomnr, at->nr);
+ atomnr,
+ at->nr);
warning_error_and_exit(wi, message, FARGS);
}
}
}
- push_atom_now(symtab, at, atomnr, atypes->atomNumberFromAtomType(type), type, ctype, ptype,
- resnumberic, resname, name, m0, q0, typeB, typeB == type ? ctype : ctypeB, mB, qB, wi);
+ push_atom_now(symtab,
+ at,
+ atomnr,
+ atypes->atomNumberFromAtomType(type),
+ type,
+ ctype,
+ ptype,
+ resnumberic,
+ resname,
+ name,
+ m0,
+ q0,
+ typeB,
+ typeB == type ? ctype : ctypeB,
+ mB,
+ qB,
+ wi);
}
void push_molt(t_symtab* symtab, std::vector<MoleculeInformation>* mol, char* line, warninp* wi)
}
/* Test if this moleculetype overwrites another */
- const auto found = std::find_if(mol->begin(), mol->end(),
- [&type](const auto& m) { return strcmp(*(m.name), type) == 0; });
+ const auto found = std::find_if(
+ mol->begin(), mol->end(), [&type](const auto& m) { return strcmp(*(m.name), type) == 0; });
if (found != mol->end())
{
auto message = gmx::formatString("moleculetype %s is redefined", type);
if (!bFound)
{
auto foundParameter =
- std::find_if(bt[ftype].interactionTypes.begin(), bt[ftype].interactionTypes.end(),
+ std::find_if(bt[ftype].interactionTypes.begin(),
+ bt[ftype].interactionTypes.end(),
[¶mAtoms, &at, &bB](const auto& param) {
return findIfAllNBAtomsMatch(param.atoms(), paramAtoms, at, bB);
});
/* If we did not find a matching type for this cmap torsion */
if (!bFound)
{
- auto message = gmx::formatString("Unknown cmap torsion between atoms %d %d %d %d %d", p->ai() + 1,
- p->aj() + 1, p->ak() + 1, p->al() + 1, p->am() + 1);
+ auto message = gmx::formatString("Unknown cmap torsion between atoms %d %d %d %d %d",
+ p->ai() + 1,
+ p->aj() + 1,
+ p->ak() + 1,
+ p->al() + 1,
+ p->am() + 1);
warning_error_and_exit(wi, message, FARGS);
}
{
if (bB)
{
- return natom_match(currentParamFromParameterArray, at->atom[parameterToAdd.ai()].typeB,
- at->atom[parameterToAdd.aj()].typeB, at->atom[parameterToAdd.ak()].typeB,
- at->atom[parameterToAdd.al()].typeB, atypes);
+ return natom_match(currentParamFromParameterArray,
+ at->atom[parameterToAdd.ai()].typeB,
+ at->atom[parameterToAdd.aj()].typeB,
+ at->atom[parameterToAdd.ak()].typeB,
+ at->atom[parameterToAdd.al()].typeB,
+ atypes);
}
else
{
- return natom_match(currentParamFromParameterArray, at->atom[parameterToAdd.ai()].type,
- at->atom[parameterToAdd.aj()].type, at->atom[parameterToAdd.ak()].type,
- at->atom[parameterToAdd.al()].type, atypes);
+ return natom_match(currentParamFromParameterArray,
+ at->atom[parameterToAdd.ai()].type,
+ at->atom[parameterToAdd.aj()].type,
+ at->atom[parameterToAdd.ak()].type,
+ at->atom[parameterToAdd.al()].type,
+ atypes);
}
}
auto pos = bt[ftype].interactionTypes.begin();
while (pos != bt[ftype].interactionTypes.end() && nmatch_max < 4)
{
- pos = std::find_if(bt[ftype].interactionTypes.begin(), bt[ftype].interactionTypes.end(),
+ pos = std::find_if(bt[ftype].interactionTypes.begin(),
+ bt[ftype].interactionTypes.end(),
[&p, &at, &atypes, &bB, &nmatch_max](const auto& param) {
return (findNumberOfDihedralAtomMatches(param, p, at, atypes, bB)
> nmatch_max);
else /* Not a dihedral */
{
gmx::ArrayRef<const int> atomParam = p.atoms();
- auto found = std::find_if(
- bt[ftype].interactionTypes.begin(), bt[ftype].interactionTypes.end(),
- [&atomParam, &at, &atypes, &bB](const auto& param) {
- return findIfAllParameterAtomsMatch(param.atoms(), atomParam, at, atypes, bB);
- });
+ auto found = std::find_if(bt[ftype].interactionTypes.begin(),
+ bt[ftype].interactionTypes.end(),
+ [&atomParam, &at, &atypes, &bB](const auto& param) {
+ return findIfAllParameterAtomsMatch(
+ param.atoms(), atomParam, at, atypes, bB);
+ });
if (found != bt[ftype].interactionTypes.end())
{
nparam_found = 1;
"This probably means that you have inserted topology section \"%s\"\n"
"in a part belonging to a different molecule than you intended to.\n"
"In that case move the \"%s\" section to the right molecule.",
- aa[i], dir2str(d), at->nr, dir2str(d), dir2str(d));
+ aa[i],
+ dir2str(d),
+ at->nr,
+ dir2str(d),
+ dir2str(d));
warning_error_and_exit(wi, message, FARGS);
}
for (int j = i + 1; (j < nral); j++)
strcpy(format, asformat[nral_fmt - 1]);
strcat(format, ccformat);
- nread = sscanf(line, format, &cc[0], &cc[1], &cc[2], &cc[3], &cc[4], &cc[5], &cc[6], &cc[7],
- &cc[8], &cc[9], &cc[10], &cc[11], &cc[12]);
+ nread = sscanf(line,
+ format,
+ &cc[0],
+ &cc[1],
+ &cc[2],
+ &cc[3],
+ &cc[4],
+ &cc[5],
+ &cc[6],
+ &cc[7],
+ &cc[8],
+ &cc[9],
+ &cc[10],
+ &cc[11],
+ &cc[12]);
if ((nread == NRFPA(ftype)) && (NRFPB(ftype) != 0))
{
auto message = gmx::formatString(
"Incorrect number of parameters - found %d, expected %d "
"or %d for %s (after the function type).",
- nread, NRFPA(ftype), NRFP(ftype), interaction_function[ftype].longname);
+ nread,
+ NRFPA(ftype),
+ NRFP(ftype),
+ interaction_function[ftype].longname);
warning_error_and_exit(wi, message, FARGS);
}
{
if (bZero)
{
- fprintf(stderr, "NOTE: No default %s types, using zeroes\n",
+ fprintf(stderr,
+ "NOTE: No default %s types, using zeroes\n",
interaction_function[ftype].longname);
}
else
if ((ftype == F_PDIHS || ftype == F_ANGRES || ftype == F_ANGRESZ) && paramValue[5] != paramValue[2])
{
auto message = gmx::formatString("%s multiplicity can not be perturbed %f!=%f",
- interaction_function[ftype].longname, paramValue[2],
+ interaction_function[ftype].longname,
+ paramValue[2],
paramValue[5]);
warning_error_and_exit(wi, message, FARGS);
}
{
auto message = gmx::formatString("%s table number can not be perturbed %d!=%d",
interaction_function[ftype].longname,
- gmx::roundToInt(param.c0()), gmx::roundToInt(param.c0()));
+ gmx::roundToInt(param.c0()),
+ gmx::roundToInt(param.c0()));
warning_error_and_exit(wi, message, FARGS);
}
"This probably means that you have inserted topology section \"%s\"\n"
"in a part belonging to a different molecule than you intended to.\n"
"In that case move the \"%s\" section to the right molecule.",
- aa[i], dir2str(d), at->nr, dir2str(d), dir2str(d));
+ aa[i],
+ dir2str(d),
+ at->nr,
+ dir2str(d),
+ dir2str(d));
warning_error_and_exit(wi, message, FARGS);
}
else
{
/* This is essentially the same check as in default_cmap_params() done one more time */
- auto message = gmx::formatString(
- "Unable to assign a cmap type to torsion %d %d %d %d and %d\n", param.ai() + 1,
- param.aj() + 1, param.ak() + 1, param.al() + 1, param.am() + 1);
+ auto message =
+ gmx::formatString("Unable to assign a cmap type to torsion %d %d %d %d and %d\n",
+ param.ai() + 1,
+ param.aj() + 1,
+ param.ak() + 1,
+ param.al() + 1,
+ param.am() + 1);
warning_error_and_exit(wi, message, FARGS);
}
}
auto message = gmx::formatString(
"No weight or negative weight found for vsiten "
"constructing atom %d (atom index %d)",
- nj + 1, atc[nj] + 1);
+ nj + 1,
+ atc[nj] + 1);
warning_error_and_exit(wi, message, FARGS);
}
break;
"For moleculetype '%s' in [ system ] %d case insensitive "
"matches, but %d case sensitive matches were found. Check "
"the case of the characters in the moleculetypes.",
- type, nrci, nrcs);
+ type,
+ nrci,
+ nrcs);
warning_error_and_exit(wi, message, FARGS);
}
if (nrci == 1)
for (const auto& param : paramp1)
{
- std::vector<real> forceParam = { fudgeQQ, atoms->atom[param.ai()].q,
- atoms->atom[param.aj()].q, param.c0(), param.c1() };
+ std::vector<real> forceParam = {
+ fudgeQQ, atoms->atom[param.ai()].q, atoms->atom[param.aj()].q, param.c0(), param.c1()
+ };
paramnew.emplace_back(InteractionOfType(param.atoms(), forceParam, ""));
}
}
std::vector<int> atoms = { i, j };
std::vector<real> forceParam = {
- atom[i].q, atom[j].q, nbp->interactionTypes[ntype * atom[i].type + atom[j].type].c0(),
+ atom[i].q,
+ atom[j].q,
+ nbp->interactionTypes[ntype * atom[i].type + atom[j].type].c0(),
nbp->interactionTypes[ntype * atom[i].type + atom[j].type].c1()
};
add_param_to_list(&mol->interactions[F_LJC_PAIRS_NB], InteractionOfType(atoms, forceParam));
"charges and/or atom types set in the topology file as well "
"as through the mdp option '%s'. You can not use both "
"these methods simultaneously.",
- i + 1, mol_name, "couple-moltype");
+ i + 1,
+ mol_name,
+ "couple-moltype");
warning_error_and_exit(wi, message, FARGS);
}