1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2008 The Regents of the University of California
4 //
5 // This file is part of Qbox
6 //
7 // Qbox is distributed under the terms of the GNU General Public License
8 // as published by the Free Software Foundation, either version 2 of
9 // the License, or (at your option) any later version.
10 // See the file COPYING in the root directory of this distribution
11 // or <http://www.gnu.org/licenses/>.
12 //
13 ////////////////////////////////////////////////////////////////////////////////
14 //
15 // Sample.h
16 //
17 ////////////////////////////////////////////////////////////////////////////////
18 
19 #ifndef SAMPLE_H
20 #define SAMPLE_H
21 
22 #include "MPIdata.h"
23 #include "Context.h"
24 #include "AtomSet.h"
25 #include "ConstraintSet.h"
26 #include "ExtForceSet.h"
27 #include "Wavefunction.h"
28 #include "Control.h"
29 
30 class UserInterface;
31 class ExternalPotential;
32 
33 class Sample
34 {
35   private:
36 
37   public:
38 
39   Context sd_ctxt;
40   AtomSet atoms;
41   ConstraintSet constraints;
42   ExtForceSet extforces;
43   ExternalPotential* vext;
44   Wavefunction wf;
45   Wavefunction* wfv; // wavefunction velocity
46   Control ctrl;
47   UserInterface *ui;
48 
ui(ui_)49   Sample(UserInterface *ui_ = 0) : ui(ui_),
50     sd_ctxt(MPIdata::sd_comm(),MPIdata::ngb(),MPIdata::nstb()),
51     wf(sd_ctxt), wfv(0), vext(0) {}
~Sample(void)52   ~Sample(void) { delete wfv; }
reset(void)53   void reset(void)
54   {
55     atoms.reset();
56     constraints.reset();
57     extforces.reset();
58     wf.reset();
59     delete wfv;
60   }
61 };
62 #endif
63