Skip to content

Commit

Permalink
Merge pull request #1895 from ghutchis/tweak-ob-forcefields
Browse files Browse the repository at this point in the history
  • Loading branch information
ghutchis authored Dec 27, 2024
2 parents 7555468 + 703dc57 commit b5ee690
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions avogadro/qtplugins/forcefield/obenergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions avogadro/qtplugins/forcefield/obenergy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 9 additions & 0 deletions avogadro/qtplugins/forcefield/obmmenergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions avogadro/qtplugins/forcefield/obmmenergy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit b5ee690

Please sign in to comment.