@@ -25,7 +25,7 @@ ESolver_KS::ESolver_KS()
2525 out_freq_elec = GlobalV::OUT_FREQ_ELEC;
2626}
2727
28- void ESolver_KS:: hamilt2density(int istep, int iter, double ethr)
28+ void ESolver_KS:: hamilt2density(const int istep, const int iter, const double ethr)
2929{
3030 ModuleBase::timer:: tick (this ->classname ," hamilt2density" );
3131 // Temporarily, before HSolver is constructed, it should be overrided by
@@ -37,7 +37,7 @@ void ESolver_KS:: hamilt2density(int istep, int iter, double ethr)
3737}
3838
3939
40- void ESolver_KS:: Run(int istep, UnitCell_pseudo& cell)
40+ void ESolver_KS:: Run(const int istep, UnitCell_pseudo& cell)
4141{
4242 ModuleBase::timer:: tick (this ->classname ," Run" );
4343
@@ -109,7 +109,7 @@ void ESolver_KS:: Run(int istep, UnitCell_pseudo& cell)
109109};
110110
111111// <Temporary> It should be a function of Diag_H class in the future.
112- void ESolver_KS:: set_ethr(int istep, int iter)
112+ void ESolver_KS:: set_ethr(const int istep, const int iter)
113113{
114114// It is too complex now and should be modified.
115115 if (iter == 1 )
@@ -148,24 +148,13 @@ void ESolver_KS:: set_ethr(int istep, int iter)
148148 {
149149 this ->diag_ethr = 1 .e -2 ;
150150 }
151-
152- // ----------------------------
153- // this->diag_ethr changes in CG Method.
154- // mohan update 2012-03-26
155- // mohan update 2012-02-08
156- // ----------------------------
157- if (GlobalV::BASIS_TYPE==" lcao" )
158- {
159- this ->diag_ethr = std::min ( this ->diag_ethr , 0.01 *this ->drho / std::max (1.0 , GlobalC::CHR.nelec ));
160- }
161- // mohan update 2009-09-04
162- else
163- {
164- this ->diag_ethr = std::min ( this ->diag_ethr , 0.1 *this ->drho / std::max (1.0 , GlobalC::CHR.nelec ));
165- // std::cout << " new this->diag_ethr = " << this->diag_ethr << std::endl;
166- }
151+ this ->diag_ethr = std::min ( this ->diag_ethr , 0.1 *this ->drho / std::max (1.0 , GlobalC::CHR.nelec ));
167152
168153 }
154+ // if(GlobalV::BASIS_TYPE=="lcao" || GlobalV::BASIS_TYPE=="lcao_in_pw")
155+ // {
156+ // this->diag_ethr = 0.0;
157+ // }
169158}
170159
171160void ESolver_KS:: printhead()
@@ -182,12 +171,12 @@ void ESolver_KS:: printhead()
182171 std::cout << std::setw (11 ) << " TIME(s)" << std::endl;
183172}
184173
185- void ESolver_KS::printiter (bool conv_elec, int iter, double drho, double duration, double ethr)
174+ void ESolver_KS::printiter (const bool conv_elec, const int iter, const double drho, const double duration, const double ethr)
186175{
187176 GlobalC::en.print_etot (conv_elec, iter, drho, duration, ethr);
188177}
189178
190- void ESolver_KS:: writehead(std::ofstream &ofs_running, int istep, int iter)
179+ void ESolver_KS:: writehead(std::ofstream &ofs_running, const int istep, const int iter)
191180{
192181 ofs_running
193182 << " \n "
@@ -197,7 +186,7 @@ void ESolver_KS:: writehead(std::ofstream &ofs_running, int istep, int iter)
197186 << " --------------------------------\n " ;
198187}
199188
200- void ESolver_KS:: reset_diagethr(std::ofstream &ofs_running, double hsover_error)
189+ void ESolver_KS:: reset_diagethr(std::ofstream &ofs_running, const double hsover_error)
201190{
202191 ofs_running << " Notice: Threshold on eigenvalues was too large.\n " ;
203192 ModuleBase::WARNING (" scf" ," Threshold on eigenvalues was too large." );
0 commit comments