11#ifndef ELECSTATE_H
22#define ELECSTATE_H
3- #include " module_parameter/parameter.h"
4-
53#include " fp_energy.h"
64#include " module_cell/klist.h"
75#include " module_elecstate/module_charge/charge.h"
6+ #include " module_parameter/parameter.h"
87#include " module_psi/psi.h"
98#include " potentials/potential_new.h"
109
@@ -14,10 +13,10 @@ namespace elecstate
1413class ElecState
1514{
1615 public:
17- ElecState (){}
18- ElecState (Charge* charge_in,
19- ModulePW::PW_Basis* rhopw_in,
20- ModulePW::PW_Basis_Big* bigpw_in)
16+ ElecState ()
17+ {
18+ }
19+ ElecState (Charge* charge_in, ModulePW::PW_Basis* rhopw_in, ModulePW::PW_Basis_Big* bigpw_in)
2120 {
2221 this ->charge = charge_in;
2322 this ->charge ->set_rhopw (rhopw_in);
@@ -26,20 +25,20 @@ class ElecState
2625 }
2726 virtual ~ElecState ()
2827 {
29- if (this ->pot != nullptr )
28+ if (this ->pot != nullptr )
3029 {
3130 delete this ->pot ;
3231 this ->pot = nullptr ;
3332 }
3433 }
35- void init_ks (Charge * chg_in, // pointer for class Charge
36- const K_Vectors * klist_in,
37- int nk_in, // number of k points
38- ModulePW::PW_Basis* rhopw_in,
39- const ModulePW::PW_Basis_Big* bigpw_in);
34+ void init_ks (Charge* chg_in, // pointer for class Charge
35+ const K_Vectors* klist_in,
36+ int nk_in, // number of k points
37+ ModulePW::PW_Basis* rhopw_in,
38+ const ModulePW::PW_Basis_Big* bigpw_in);
4039
4140 // return current electronic density rho, as a input for constructing Hamiltonian
42- virtual const double * getRho (int spin) const ;
41+ virtual const double * getRho (int spin) const ;
4342
4443 // calculate electronic charge density on grid points or density matrix in real space
4544 // the consequence charge density rho saved into rho_out, preparing for charge mixing.
@@ -78,17 +77,14 @@ class ElecState
7877
7978 // use occupied weights from INPUT and skip calculate_weights
8079 // mohan updated on 2024-06-08
81- void fixed_weights (
82- const std::vector<double >& ocp_kb,
83- const int &nbands,
84- const double &nelec);
80+ void fixed_weights (const std::vector<double >& ocp_kb, const int & nbands, const double & nelec);
8581
86- // if nupdown is not 0(TWO_EFERMI case),
87- // nelec_spin will be fixed and weights will be constrained
82+ // if nupdown is not 0(TWO_EFERMI case),
83+ // nelec_spin will be fixed and weights will be constrained
8884 void init_nelec_spin ();
89- // used to record number of electrons per spin index
90- // for NSPIN=2, it will record number of spin up and number of spin down
91- // for NSPIN=4, it will record total number, magnetization for x, y, z direction
85+ // used to record number of electrons per spin index
86+ // for NSPIN=2, it will record number of spin up and number of spin down
87+ // for NSPIN=4, it will record total number, magnetization for x, y, z direction
9288 std::vector<double > nelec_spin;
9389
9490 virtual void print_psi (const psi::Psi<double >& psi_in, const int istep = -1 )
@@ -102,7 +98,7 @@ class ElecState
10298
10399 /* *
104100 * @brief Init rho_core, init rho, renormalize rho, init pot
105- *
101+ *
106102 * @param istep i-th step
107103 * @param ucell unit cell
108104 * @param strucfac structure factor
@@ -142,28 +138,24 @@ class ElecState
142138 void set_exx (const std::complex <double >& Eexx);
143139#endif // __LCAO
144140#endif // __EXX
145-
141+
146142 double get_hartree_energy ();
147143 double get_etot_efield ();
148144 double get_etot_gatefield ();
149145
150146 double get_solvent_model_Ael ();
151147 double get_solvent_model_Acav ();
152148
153- virtual double get_spin_constrain_energy () {
149+ virtual double get_spin_constrain_energy ()
150+ {
154151 return 0.0 ;
155152 }
156153
157154 double get_dftu_energy ();
158155 double get_local_pp_energy ();
159156
160- #ifdef __DEEPKS
161- double get_deepks_E_delta ();
162- double get_deepks_E_delta_band ();
163- #endif
164-
165- fenergy f_en; // /< energies contribute to the total free energy
166- efermi eferm; // /< fermi energies
157+ fenergy f_en; // /< energies contribute to the total free energy
158+ efermi eferm; // /< fermi energies
167159
168160 // below defines the bandgap:
169161
0 commit comments