Skip to content
Snippets Groups Projects
Commit 021b9aec authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Quick fix for a bug I introduced today

Basically plumed was crashing if NOT using ENERGY
parent 5b21dacd
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <string> #include <string>
#include <cassert> #include <cassert>
#include "ActionWithValue.h" #include "ActionWithValue.h"
#include "Colvar.h"
using namespace std; using namespace std;
using namespace PLMD; using namespace PLMD;
...@@ -108,7 +109,8 @@ void ActionAtomistic::retrieveAtoms(){ ...@@ -108,7 +109,8 @@ void ActionAtomistic::retrieveAtoms(){
for(unsigned j=0;j<indexes.size();j++) positions[j]=p[indexes[j]]; for(unsigned j=0;j<indexes.size();j++) positions[j]=p[indexes[j]];
for(unsigned j=0;j<indexes.size();j++) charges[j]=c[indexes[j]]; for(unsigned j=0;j<indexes.size();j++) charges[j]=c[indexes[j]];
for(unsigned j=0;j<indexes.size();j++) masses[j]=m[indexes[j]]; for(unsigned j=0;j<indexes.size();j++) masses[j]=m[indexes[j]];
energy=plumed.getAtoms().getEnergy(); Colvar*cc=dynamic_cast<Colvar*>(this);
if(cc && cc->checkIsEnergy()) energy=plumed.getAtoms().getEnergy();
} }
void ActionAtomistic::applyForces(){ void ActionAtomistic::applyForces(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment