Commit 1132441d by Francois Gygi

modified to be consistent with the net_charge variable


git-svn-id: http://qboxcode.org/svn/qb/trunk@388 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 34f0dfc8
......@@ -3,7 +3,7 @@
// AtomCmd.h:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: AtomCmd.h,v 1.5 2004-09-14 22:24:11 fgygi Exp $
// $Id: AtomCmd.h,v 1.6 2005-04-29 18:12:37 fgygi Exp $
#ifndef ATOMCMD_H
#define ATOMCMD_H
......@@ -66,6 +66,7 @@ class AtomCmd : public Cmd
Atom *a = new Atom(name,species,position,velocity);
const int atoms_nel_before = s->atoms.nel();
if ( !(s->atoms.addAtom( a ) ) )
{
if ( ui->onpe0() )
......@@ -73,22 +74,18 @@ class AtomCmd : public Cmd
delete a;
return 1;
}
const int atoms_nel_after = s->atoms.nel();
const int delta_nel = atoms_nel_after - atoms_nel_before;
const int wf_nel = s->wf.nel();
#if DEBUG
cout << " dbg check "<< __FILE__ <<" "<< __LINE__ <<" mype="<< mype << endl;
#endif
s->wf.set_nel(s->atoms.nel());
s->wf.set_nel(wf_nel+delta_nel);
s->wf.update_occ(0.0);
if ( s->wfv != 0 )
{
s->wfv->set_nel(s->atoms.nel());
s->wfv->set_nel(wf_nel+delta_nel);
s->wfv->clear();
}
#if DEBUG
cout << " dbg check "<< __FILE__ <<" "<< __LINE__ <<" mype="<< mype << endl;
#endif
return 0;
}
};
......
......@@ -3,7 +3,7 @@
// LoadCmd.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: LoadCmd.C,v 1.6 2004-09-14 22:24:11 fgygi Exp $
// $Id: LoadCmd.C,v 1.7 2005-04-29 18:12:37 fgygi Exp $
#include "LoadCmd.h"
#include "SampleReader.h"
......@@ -52,17 +52,6 @@ int LoadCmd::action(int argc, char **argv)
s->ctxt_.barrier();
// If only <atomset> was read, set nel for the wavefunction
//cout << " LoadCmd: atoms.nel() = " << s->atoms.nel() << endl;
//cout << " LoadCmd: wf.nel() = " << s->wf.nel() << endl;
if ( s->wf.nel() != s->atoms.nel() )
{
s->wf.set_nel(s->atoms.nel());
s->wf.update_occ(0.0);
}
//cout << " LoadCmd: atoms.nel() = " << s->atoms.nel() << endl;
//cout << " LoadCmd: wf.nel() = " << s->wf.nel() << endl;
if ( ui->onpe0() )
cout << " -->" << endl;
......
......@@ -3,7 +3,7 @@
// Nempty.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: Nempty.h,v 1.1 2003-01-25 01:23:31 fgygi Exp $
// $Id: Nempty.h,v 1.2 2005-04-29 18:12:37 fgygi Exp $
#ifndef NEMPTY_H
#define NEMPTY_H
......@@ -41,6 +41,10 @@ class Nempty : public Var
}
s->wf.set_nempty(v);
if ( s->wfv != 0 )
{
s->wfv->set_nempty(v);
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment