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

small fix in DUMPMASSCHARGE

All atoms were erroneously requested also after the first step.
parent dd68b5c1
No related branches found
No related tags found
No related merge requests found
...@@ -96,10 +96,12 @@ class DumpMassCharge: ...@@ -96,10 +96,12 @@ class DumpMassCharge:
{ {
string file; string file;
bool first; bool first;
bool second;
public: public:
explicit DumpMassCharge(const ActionOptions&); explicit DumpMassCharge(const ActionOptions&);
~DumpMassCharge(); ~DumpMassCharge();
static void registerKeywords( Keywords& keys ); static void registerKeywords( Keywords& keys );
void prepare();
void calculate() {} void calculate() {}
void apply() {} void apply() {}
void update(); void update();
...@@ -120,7 +122,8 @@ DumpMassCharge::DumpMassCharge(const ActionOptions&ao): ...@@ -120,7 +122,8 @@ DumpMassCharge::DumpMassCharge(const ActionOptions&ao):
Action(ao), Action(ao),
ActionAtomistic(ao), ActionAtomistic(ao),
ActionPilot(ao), ActionPilot(ao),
first(true) first(true),
second(true)
{ {
vector<AtomNumber> atoms; vector<AtomNumber> atoms;
parse("FILE",file); parse("FILE",file);
...@@ -142,6 +145,13 @@ DumpMassCharge::DumpMassCharge(const ActionOptions&ao): ...@@ -142,6 +145,13 @@ DumpMassCharge::DumpMassCharge(const ActionOptions&ao):
requestAtoms(atoms); requestAtoms(atoms);
} }
void DumpMassCharge::prepare() {
if(!first && second) {
requestAtoms(vector<AtomNumber>());
second=false;
}
}
void DumpMassCharge::update() { void DumpMassCharge::update() {
if(!first) return; if(!first) return;
first=false; first=false;
......
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