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

Moved deactivation of actions to the beginning of calculation.

Instead of deactivating actions at the end of the step, I prefer
to deactivate all of them just before activation. In this manner, all
dependencies are touched in the prepareDependencies method.
parent 477587be
No related branches found
No related tags found
No related merge requests found
......@@ -369,6 +369,10 @@ void PlumedMain::prepareDependencies(){
// new/changed dependency (up to now, only useful for dependences on virtual atoms,
// which can be dynamically changed).
//
// First switch off all actions
for(ActionSet::iterator p=actionSet.begin();p!=actionSet.end();p++) (*p)->deactivate();
// for optimization, an "active" flag remains false if no action at all is active
active=false;
for(unsigned i=0;i<pilots.size();++i){
......@@ -432,9 +436,6 @@ void PlumedMain::performCalc(){
// this is updating the MD copy of the forces
atoms.updateForces();
// Finally switch off all actions (they will be switched on at next step
for(ActionSet::iterator p=actionSet.begin();p!=actionSet.end();p++) (*p)->deactivate();
}
void PlumedMain::load(std::vector<std::string> & words){
......
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