diff --git a/avogadro/qtplugins/forcefield/obenergy.cpp b/avogadro/qtplugins/forcefield/obenergy.cpp index 03cf1d6dd4..9ca9f7cec6 100644 --- a/avogadro/qtplugins/forcefield/obenergy.cpp +++ b/avogadro/qtplugins/forcefield/obenergy.cpp @@ -137,6 +137,14 @@ OBEnergy::OBEnergy(const std::string& method) OBEnergy::~OBEnergy() {} +bool OBEnergy::acceptsRadicals() const +{ + if (m_identifier == "UFF") + return true; + + return false; +} + Calc::EnergyCalculator* OBEnergy::newInstance() const { return new OBEnergy(m_name); diff --git a/avogadro/qtplugins/forcefield/obenergy.h b/avogadro/qtplugins/forcefield/obenergy.h index c9a605dce8..2ff37b9a9e 100644 --- a/avogadro/qtplugins/forcefield/obenergy.h +++ b/avogadro/qtplugins/forcefield/obenergy.h @@ -48,6 +48,10 @@ class OBEnergy : public Avogadro::Calc::EnergyCalculator // gradient (which may be unsupported and fall back to numeric) void gradient(const Eigen::VectorXd& x, Eigen::VectorXd& grad) override; + bool acceptsIons() const override { return true; } + // UFF can handle radicals + bool acceptsRadicals() const override; + private: class Private; diff --git a/avogadro/qtplugins/forcefield/obmmenergy.cpp b/avogadro/qtplugins/forcefield/obmmenergy.cpp index 41bae1977f..49c67194be 100644 --- a/avogadro/qtplugins/forcefield/obmmenergy.cpp +++ b/avogadro/qtplugins/forcefield/obmmenergy.cpp @@ -73,6 +73,15 @@ OBMMEnergy::~OBMMEnergy() delete m_process; } +bool OBMMEnergy::acceptsRadicals() const +{ + // UFF will figure something out + if (m_identifier == "UFF") + return true; + + return false; +} + QByteArray OBMMEnergy::writeAndRead(const QByteArray& input) { if (m_process == nullptr) diff --git a/avogadro/qtplugins/forcefield/obmmenergy.h b/avogadro/qtplugins/forcefield/obmmenergy.h index 63d0d9d2b3..52a21ebfb6 100644 --- a/avogadro/qtplugins/forcefield/obmmenergy.h +++ b/avogadro/qtplugins/forcefield/obmmenergy.h @@ -66,6 +66,10 @@ class OBMMEnergy : public Avogadro::Calc::EnergyCalculator // gradient (which may be unsupported and fall back to numeric) void gradient(const Eigen::VectorXd& x, Eigen::VectorXd& grad) override; + bool acceptsIons() const override { return true; } + // UFF can handle radicals + bool acceptsRadicals() const override; + /** * @brief Synchronous use of the QProcess. */