|
16 | 16 | namespace ModuleESolver |
17 | 17 | { |
18 | 18 |
|
19 | | -class ESolver |
20 | | -{ |
21 | | -// protected: |
22 | | -// ModuleBase::matrix lattice_v; |
23 | | -public: |
24 | | - ESolver(){ |
25 | | - classname = "ESolver"; |
26 | | - } |
27 | | - virtual ~ESolver(){}; |
28 | | - |
29 | | - //virtual void Init(Input_EnSolver &inp, matrix &lattice_v)=0 |
30 | | - virtual void Init(Input &inp, UnitCell_pseudo &cell)=0; |
31 | | - |
32 | | - // They shoud be add after atom class is refactored |
33 | | - // virtual void UpdateLatAtom(ModuleBase::matrix &lat_in, Atom &atom_in); |
34 | | - // virtual void UpdateLat(ModuleBase::matrix &lat_in); |
35 | | - // virtual void UpdateAtom(Atom &atom_in); |
36 | | - |
37 | | - /// These two virtual `Run` will be merged in the future. |
38 | | - //virtual void Run(int istep, Atom &atom) = 0; |
39 | | - virtual void Run(const int istep, UnitCell_pseudo& cell) = 0; |
40 | | - virtual void Run(int istep, |
41 | | - Record_adj& ra /**< would be a 2nd-module of Cell*/, |
42 | | - Local_Orbital_Charge& loc /**< EState*/, |
43 | | - Local_Orbital_wfc& lowf /**< Psi*/, |
44 | | - LCAO_Hamilt& uhm /**< Hamilt*/) {}; |
45 | | - |
46 | | - virtual void cal_Energy(energy &en) = 0; |
47 | | - virtual void cal_Force(ModuleBase::matrix &force) = 0; |
48 | | - virtual void cal_Stress(ModuleBase::matrix &stress) = 0; |
49 | | - |
50 | | - //Print current classname. |
51 | | - void printname(); |
52 | | - |
53 | | - //temporarily |
54 | | - //get iterstep used in current scf |
55 | | - virtual int getniter(){return 0;} |
56 | | - string classname; |
57 | | -}; |
58 | | - |
59 | | -void init_esolver(ESolver* &p_esolver, const string use_esol); |
60 | | -void clean_esolver(ESolver* &pesolver); |
| 19 | + class ESolver |
| 20 | + { |
| 21 | + // protected: |
| 22 | + // ModuleBase::matrix lattice_v; |
| 23 | + public: |
| 24 | + ESolver() { |
| 25 | + classname = "ESolver"; |
| 26 | + } |
| 27 | + virtual ~ESolver() {}; |
| 28 | + |
| 29 | + //virtual void Init(Input_EnSolver &inp, matrix &lattice_v)=0 |
| 30 | + virtual void Init(Input& inp, UnitCell_pseudo& cell) = 0; |
| 31 | + |
| 32 | + // They shoud be add after atom class is refactored |
| 33 | + // virtual void UpdateLatAtom(ModuleBase::matrix &lat_in, Atom &atom_in); |
| 34 | + // virtual void UpdateLat(ModuleBase::matrix &lat_in); |
| 35 | + // virtual void UpdateAtom(Atom &atom_in); |
| 36 | + |
| 37 | + virtual void Run(int istep, UnitCell_pseudo& cell) = 0; |
| 38 | + |
| 39 | + //Deal with exx and other calculation than scf/md/relax: |
| 40 | + // such as nscf, istate-charge or envelope |
| 41 | + virtual void othercalculation(const int istep) {}; |
| 42 | + |
| 43 | + virtual void cal_Energy(energy& en) = 0; |
| 44 | + virtual void cal_Force(ModuleBase::matrix& force) = 0; |
| 45 | + virtual void cal_Stress(ModuleBase::matrix& stress) = 0; |
| 46 | + virtual void postprocess() {}; |
| 47 | + |
| 48 | + //Print current classname. |
| 49 | + void printname(); |
| 50 | + |
| 51 | + //temporarily |
| 52 | + //get iterstep used in current scf |
| 53 | + virtual int getniter() { return 0; } |
| 54 | + string classname; |
| 55 | + }; |
| 56 | + |
| 57 | + void init_esolver(ESolver*& p_esolver, const string use_esol); |
| 58 | + void clean_esolver(ESolver*& pesolver); |
61 | 59 |
|
62 | 60 | } |
63 | 61 |
|
|
0 commit comments