Skip to content

Commit

Permalink
Added a check that masses/charges are actually passed from MD
Browse files Browse the repository at this point in the history
This is related to the closed issue #162

I think that with standard usage of PLUMED all the actions should be
active at step zero, and so all the masses and charges should be requested
to codes like NAMD or OPENMM. Anyway,this fix will double check for it
adding an overhead only at the first simulation step.
  • Loading branch information
GiovanniBussi committed Feb 17, 2016
1 parent c890bbb commit 29739c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Atoms.cpp
Expand Up @@ -28,6 +28,7 @@
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

Expand Down Expand Up @@ -191,6 +192,8 @@ void Atoms::share(const std::set<AtomNumber>& unique){
int ndata=3;
if(!massAndChargeOK){
ndata=5;
masses.assign(masses.size(),NAN);
charges.assign(charges.size(),NAN);
mdatoms->getCharges(gatindex,charges);
mdatoms->getMasses(gatindex,masses);
}
Expand Down

0 comments on commit 29739c5

Please sign in to comment.