{
gmx_fatal(FARGS, "Incorrect atomtype (%d)", tp);
}
- fprintf(out, "%6s %6s %8.3f %6d\n", *(rtpDBEntry.atomname[j]), tpnm,
- rtpDBEntry.atom[j].q, rtpDBEntry.cgnr[j]);
+ fprintf(out,
+ "%6s %6s %8.3f %6d\n",
+ *(rtpDBEntry.atomname[j]),
+ tpnm,
+ rtpDBEntry.atom[j].q,
+ rtpDBEntry.cgnr[j]);
}
}
gmx_fatal(FARGS,
"Atom type %s (residue %s) not found in atomtype "
"database",
- buf1, r0->resname.c_str());
+ buf1,
+ r0->resname.c_str());
}
r0->atom.back().type = j;
r0->atom.back().m = atype->atomMassFromAtomType(j);
fprintf(out,
"; bonds angles dihedrals impropers all_dihedrals nr_exclusions HH14 "
"remove_dih\n");
- fprintf(out, " %5d %6d %9d %9d %14d %14d %14d %14d\n\n", rtpDBEntry[0].rb[0].type,
- rtpDBEntry[0].rb[1].type, rtpDBEntry[0].rb[2].type, rtpDBEntry[0].rb[3].type,
- static_cast<int>(rtpDBEntry[0].bKeepAllGeneratedDihedrals), rtpDBEntry[0].nrexcl,
+ fprintf(out,
+ " %5d %6d %9d %9d %14d %14d %14d %14d\n\n",
+ rtpDBEntry[0].rb[0].type,
+ rtpDBEntry[0].rb[1].type,
+ rtpDBEntry[0].rb[2].type,
+ rtpDBEntry[0].rb[3].type,
+ static_cast<int>(rtpDBEntry[0].bKeepAllGeneratedDihedrals),
+ rtpDBEntry[0].nrexcl,
static_cast<int>(rtpDBEntry[0].bGenerateHH14Interactions),
static_cast<int>(rtpDBEntry[0].bRemoveDihedralIfWithImproper));
}
"remove_dih");
GMX_LOG(logger.info)
.asParagraph()
- .appendTextFormatted(
- " %5d %6d %9d %9d %14d %14d %14d %14d", rtpDBEntry[0].rb[0].type,
- rtpDBEntry[0].rb[1].type, rtpDBEntry[0].rb[2].type, rtpDBEntry[0].rb[3].type,
- static_cast<int>(rtpDBEntry[0].bKeepAllGeneratedDihedrals),
- rtpDBEntry[0].nrexcl, static_cast<int>(rtpDBEntry[0].bGenerateHH14Interactions),
- static_cast<int>(rtpDBEntry[0].bRemoveDihedralIfWithImproper));
+ .appendTextFormatted(" %5d %6d %9d %9d %14d %14d %14d %14d",
+ rtpDBEntry[0].rb[0].type,
+ rtpDBEntry[0].rb[1].type,
+ rtpDBEntry[0].rb[2].type,
+ rtpDBEntry[0].rb[3].type,
+ static_cast<int>(rtpDBEntry[0].bKeepAllGeneratedDihedrals),
+ rtpDBEntry[0].nrexcl,
+ static_cast<int>(rtpDBEntry[0].bGenerateHH14Interactions),
+ static_cast<int>(rtpDBEntry[0].bRemoveDihedralIfWithImproper));
}
if (gmx::equalCaseInsensitive("bondedtypes", header, 5))
{
get_a_line(in, line, STRLEN);
- if ((nparam = sscanf(line, "%d %d %d %d %d %d %d %d", &header_settings.rb[ebtsBONDS].type,
+ if ((nparam = sscanf(line,
+ "%d %d %d %d %d %d %d %d",
+ &header_settings.rb[ebtsBONDS].type,
&header_settings.rb[ebtsANGLES].type,
- &header_settings.rb[ebtsPDIHS].type, &header_settings.rb[ebtsIDIHS].type,
- &dum1, &header_settings.nrexcl, &dum2, &dum3))
+ &header_settings.rb[ebtsPDIHS].type,
+ &header_settings.rb[ebtsIDIHS].type,
+ &dum1,
+ &header_settings.nrexcl,
+ &dum2,
+ &dum3))
< 4)
{
- gmx_fatal(FARGS, "need 4 to 8 parameters in the header of .rtp file %s at line:\n%s\n",
- rrdb.c_str(), line);
+ gmx_fatal(FARGS,
+ "need 4 to 8 parameters in the header of .rtp file %s at line:\n%s\n",
+ rrdb.c_str(),
+ line);
}
header_settings.bKeepAllGeneratedDihedrals = (dum1 != 0);
header_settings.bGenerateHH14Interactions = (dum2 != 0);
gmx_fatal(FARGS, "No atoms found in .rtp file in residue %s\n", res->resname.c_str());
}
- auto found = std::find_if(rtpDBEntry->begin(), rtpDBEntry->end() - 1,
- [&res](const PreprocessResidue& entry) {
- return gmx::equalCaseInsensitive(entry.resname, res->resname);
- });
+ auto found = std::find_if(
+ rtpDBEntry->begin(), rtpDBEntry->end() - 1, [&res](const PreprocessResidue& entry) {
+ return gmx::equalCaseInsensitive(entry.resname, res->resname);
+ });
if (found != rtpDBEntry->end() - 1)
{
if (found >= oldArrayEnd)
{
- gmx_fatal(FARGS, "Found a second entry for '%s' in '%s'", res->resname.c_str(),
- rrdb.c_str());
+ gmx_fatal(FARGS, "Found a second entry for '%s' in '%s'", res->resname.c_str(), rrdb.c_str());
}
if (bAllowOverrideRTP)
{
.appendTextFormatted(
"Found another rtp entry for '%s' in '%s',"
" ignoring this entry and keeping the one from '%s.rtp'",
- res->resname.c_str(), rrdb.c_str(), found->filebase.c_str());
+ res->resname.c_str(),
+ rrdb.c_str(),
+ found->filebase.c_str());
/* We should free all the data for this entry.
* The current code gives a lot of dangling pointers.
*/
gmx_fatal(FARGS,
"Found rtp entries for '%s' in both '%s' and '%s'. If you want the first "
"definition to override the second one, set the -rtpo option of pdb2gmx.",
- res->resname.c_str(), found->filebase.c_str(), rrdb.c_str());
+ res->resname.c_str(),
+ found->filebase.c_str(),
+ rrdb.c_str());
}
}
}
std::sort(rtpDBEntry->begin(), rtpDBEntry->end(), [](const PreprocessResidue& a, const PreprocessResidue& b) {
return std::lexicographical_compare(
- a.resname.begin(), a.resname.end(), b.resname.begin(), b.resname.end(),
+ a.resname.begin(),
+ a.resname.end(),
+ b.resname.begin(),
+ b.resname.end(),
[](const char& c1, const char& c2) { return std::toupper(c1) < std::toupper(c2); });
});
}
if (nbest > 1)
{
- gmx_fatal(FARGS, "Residue '%s' not found in residue topology database, looks a bit like %s",
- key.c_str(), bestbuf.c_str());
+ gmx_fatal(FARGS,
+ "Residue '%s' not found in residue topology database, looks a bit like %s",
+ key.c_str(),
+ bestbuf.c_str());
}
else if (besti == -1)
{
.appendTextFormatted(
"'%s' not found in residue topology database, "
"trying to use '%s'",
- key.c_str(), rtpDBEntry[besti].resname.c_str());
+ key.c_str(),
+ rtpDBEntry[besti].resname.c_str());
}
return rtpDBEntry[besti].resname;
gmx::ArrayRef<const PreprocessResidue>::const_iterator
getDatabaseEntry(const std::string& rtpname, gmx::ArrayRef<const PreprocessResidue> rtpDBEntry)
{
- auto found = std::find_if(rtpDBEntry.begin(), rtpDBEntry.end(),
- [&rtpname](const PreprocessResidue& entry) {
- return gmx::equalCaseInsensitive(rtpname, entry.resname);
- });
+ auto found = std::find_if(
+ rtpDBEntry.begin(), rtpDBEntry.end(), [&rtpname](const PreprocessResidue& entry) {
+ return gmx::equalCaseInsensitive(rtpname, entry.resname);
+ });
if (found == rtpDBEntry.end())
{
/* This should never happen, since searchResidueDatabase should have been called