Commit 3da75753 by Francois Gygi

new SampleStepper hierarchy


git-svn-id: http://qboxcode.org/svn/qb/trunk@124 cba15fb0-1239-40c8-b417-11db7ca47a34
parent d583b5d3
......@@ -3,13 +3,14 @@
// RunCmd.C:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: RunCmd.C,v 1.2 2003-02-04 19:21:30 fgygi Exp $
// $Id: RunCmd.C,v 1.3 2003-11-21 20:01:47 fgygi Exp $
#include "RunCmd.h"
#include<iostream>
using namespace std;
#include "EnergyFunctional.h"
#include "SampleStepper.h"
#include "BOSampleStepper.h"
#include "CPSampleStepper.h"
#include<ctime>
#include<cassert>
......@@ -17,10 +18,10 @@ using namespace std;
int RunCmd::action(int argc, char **argv)
{
if ( argc != 2 )
if ( argc < 2 || argc > 3)
{
if ( ui->onpe0() )
cout << " use: run nsteps" << endl;
cout << " use: run niter" << endl;
return 1;
}
......@@ -32,10 +33,25 @@ int RunCmd::action(int argc, char **argv)
}
EnergyFunctional ef(*s);
SampleStepper stepper(*s);
SampleStepper* stepper;
int niter = atoi(argv[1]);
stepper.step(ef,niter);
int nite = 1;
if ( argc == 3 )
{
// run niter nite
nite = atoi(argv[2]);
}
if ( s->ctrl.wf_dyn == "MD" )
stepper = new CPSampleStepper(*s);
else
stepper = new BOSampleStepper(*s,nite);
assert(stepper!=0);
s->wf.info(cout,"wavefunction");
stepper->step(ef,niter);
return 0;
}
......@@ -3,15 +3,14 @@
// SampleStepper.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: SampleStepper.h,v 1.6 2003-06-11 22:10:11 fgygi Exp $
// $Id: SampleStepper.h,v 1.7 2003-11-21 20:01:47 fgygi Exp $
#ifndef SAMPLESTEPPER_H
#define SAMPLESTEPPER_H
#include "EnergyFunctional.h"
#include "Sample.h"
#include "Wavefunction.h"
#include <iostream>
#include "Timer.h"
class EnergyFunctional;
#include <map>
#include <string>
using namespace std;
......@@ -20,14 +19,9 @@ typedef map<string,Timer> TimerMap;
class SampleStepper
{
private:
protected:
Sample& s_;
Wavefunction dwf;
Wavefunction* wfv;
vector<vector<double> > tau0,taum,vel,fion;
vector<double> pmass;
UnitCell dcell;
// Do not allow construction of SampleStepper unrelated to a Sample
SampleStepper(void);
......@@ -36,9 +30,9 @@ class SampleStepper
mutable TimerMap tmap;
void step(EnergyFunctional& e, int niter);
virtual void step(EnergyFunctional& e, int niter) = 0;
SampleStepper(Sample& s);
~SampleStepper();
virtual ~SampleStepper(void);
};
#endif
......@@ -3,20 +3,21 @@
// WavefunctionStepper.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: WavefunctionStepper.h,v 1.1.1.1 2002-09-27 00:08:39 fgygi Exp $
// $Id: WavefunctionStepper.h,v 1.2 2003-11-21 20:01:47 fgygi Exp $
#ifndef WAVEFUNCTIONSTEPPER_H
#define WAVEFUNCTIONSTEPPER_H
class Wavefunction;
class WavefunctionStepper
{
private:
public:
virtual void update(Wavefunction& wf, WavefunctionDerivative& dwf) = 0;
virtual void update(Wavefunction& dwf) = 0;
WavefunctionStepper();
~WavefunctionStepper();
WavefunctionStepper() {}
virtual ~WavefunctionStepper() {}
};
#endif
......@@ -36,7 +36,23 @@ UnitCell but was not fixed in 1.8.1. Still observe inf loops for Si432 FCC.
There is no mechanism to remove s.wfv once it has been created through either
the load command or the set wf_dyn MD command. Should implement a block_wf cmd.
Note: when building for release on /usr/apps, the LD_LIBRARY_PATH var will
determine library search path, even if makefile specifies another path.
In 1_9_0: running PSDA steps followed in the same run by MD/MD steps
causes a seg fault.
Created a libxerces-c.a using objects in $XERCESCDIR/lib and linked statically.
This will avoid the problem of needing libxerces-c.so when using qbox.
--------------------------------------------------------------------------------
rel1_10_0 (not for release)
Complete rewrite of the SampleStepper hierarchy, including CP and BO classes.
Runs CP and BO/SD and BO/PSD tests ok. No extrapolation of wavefunctions yet.
Note: wavefunction extrapolation implemented yet.
Planned work: interchange nite iterations and ionic move in BO stepper, so
that the wfs at the end of the iteration are the GS for the ionic positions at
the same time.
--------------------------------------------------------------------------------
rel1_9_0
Large file support (LFS): LFS is not correctly supported for <iostream> in icc
......
......@@ -3,9 +3,9 @@
// qb.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: qb.C,v 1.21 2003-10-02 23:29:10 fgygi Exp $
// $Id: qb.C,v 1.22 2003-11-21 20:01:47 fgygi Exp $
const char* const release = "1.9.0 ";
const char* const release = "1.10.0 ";
const char* const xmlns_url = "http://www.llnl.gov/casc/fpmd/qbox/1.0";
#include <iostream>
......
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