From 9bf0590cbab4eb7ece77884743e1e3d3dd3b58d6 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 11 Sep 2023 10:04:40 -0400 Subject: [PATCH] Fix autodetect for force field Fix #1324 by ignoring MMFF94 support for iron, etc. (MMFF94 only supports isolated ions.) Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/openbabel/openbabel.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/avogadro/qtplugins/openbabel/openbabel.cpp b/avogadro/qtplugins/openbabel/openbabel.cpp index 05ab620a53..fc00590de3 100644 --- a/avogadro/qtplugins/openbabel/openbabel.cpp +++ b/avogadro/qtplugins/openbabel/openbabel.cpp @@ -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; }