Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
perminder-17 committed Apr 6, 2024
1 parent c52f7f7 commit cf21021
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion avogadro/qtplugins/forcefield/forcefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ void Forcefield::optimize()
if (m_molecule == nullptr || m_method == nullptr)
return;

if(!m_molecule->atomCount()){
QMessageBox::information(nullptr, tr("Avogadro"),
tr("No atoms provided for optimization"));
return;
}

// merge all coordinate updates into one step for undo
bool isInteractive = m_molecule->undoMolecule()->isInteractive();
m_molecule->undoMolecule()->setInteractive(true);
Expand Down Expand Up @@ -353,7 +359,7 @@ void Forcefield::energy()
{
if (m_molecule == nullptr || m_method == nullptr)
return;

int n = m_molecule->atomCount();
// we have to cast the current 3d positions into a VectorXd
Core::Array<Vector3> pos = m_molecule->atomPositions3d();
Expand Down

0 comments on commit cf21021

Please sign in to comment.