Skip to content

Commit

Permalink
Fix autodetect for force field
Browse files Browse the repository at this point in the history
Fix #1324 by ignoring MMFF94 support for iron, etc.
(MMFF94 only supports isolated ions.)

Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Sep 11, 2023
1 parent 2d1307e commit 9bf0590
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions avogadro/qtplugins/openbabel/openbabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,10 @@ QString OpenBabel::autoDetectForceField() const
*eleIter != "N" && *eleIter != "O" && *eleIter != "P" &&
*eleIter != "S") {
gaffValid = false;
mmff94Valid = false;

// These are supported by MMFF94 (but not GAFF)
if (*eleIter != "Fe" && *eleIter != "Li" && *eleIter != "Na" &&
*eleIter != "K" && *eleIter != "Zn" && *eleIter != "Ca" &&
*eleIter != "Cu" && *eleIter != "Mg" && *eleIter != "Na") {
mmff94Valid = false;
}
// MMFF94 supports isolated metal ions but it's safer to use UFF
// Fixes #1324
}
++eleIter;
}
Expand Down

0 comments on commit 9bf0590

Please sign in to comment.