@@ -960,7 +960,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
960960 if ( GlobalC::exx_info.info_global .cal_exx )
961961 {
962962 if ( this ->conv_esolver ) one_step_exx = true ;
963-
964963 // the case with hybrid functionals
965964 if ( one_step_exx && iter==1 ) get_init_value_rdmft = true ;
966965 else get_init_value_rdmft = false ;
@@ -1124,8 +1123,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
11241123 ModuleBase::TITLE (" RDMFT" , " E & Egradient" );
11251124 ModuleBase::timer::tick (" RDMFT" , " E & Egradient" );
11261125
1127- // if ( (!GlobalC::exx_info.info_global.cal_exx && iter == 1) || one_step_exx )
1128- // if ( !GlobalC::exx_info.info_global.cal_exx || (GlobalC::exx_info.info_global.cal_exx && one_step_exx) )
11291126 if ( get_init_value_rdmft )
11301127 {
11311128 ModuleBase::matrix occ_number_ks (this ->pelec ->wg );
@@ -1134,15 +1131,13 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
11341131 for (int inb=0 ; inb < occ_number_ks.nc ; ++inb) occ_number_ks (ik, inb) /= this ->kv .wk [ik];
11351132 }
11361133
1137- // this->update_elec_rdmft(occ_number_ks, *(this->psi));
11381134 this ->rdmft_solver .update_elec (occ_number_ks, *(this ->psi ));
11391135
11401136 // initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
11411137 ModuleBase::matrix dE_dOccNum (this ->pelec ->wg .nr , this ->pelec ->wg .nc , true );
11421138 psi::Psi<TK> dE_dWfc (this ->psi ->get_nk (), this ->psi ->get_nbands (), this ->psi ->get_nbasis ());
11431139 dE_dWfc.zero_out ();
11441140
1145- // double Etotal_RDMFT = this->run_rdmft(dE_dOccNum, dE_dWfc);
11461141 double Etotal_RDMFT = this ->rdmft_solver .run (dE_dOccNum, dE_dWfc);
11471142
11481143 ModuleBase::timer::tick (" RDMFT" , " E & Egradient" );
@@ -1255,14 +1250,14 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
12551250 {
12561251 for (int inb=0 ; inb < occ_number_ks.nc ; ++inb) occ_number_ks (ik, inb) /= this ->kv .wk [ik];
12571252 }
1258- this ->update_elec_rdmft (occ_number_ks, *(this ->psi ));
1253+ this ->rdmft_solver . update_elec (occ_number_ks, *(this ->psi ));
12591254
12601255 // initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
12611256 ModuleBase::matrix dE_dOccNum (this ->pelec ->wg .nr , this ->pelec ->wg .nc , true );
12621257 psi::Psi<TK> dE_dWfc (this ->psi ->get_nk (), this ->psi ->get_nbands (), this ->psi ->get_nbasis ());
12631258 dE_dWfc.zero_out ();
12641259
1265- double Etotal_RDMFT = this ->run_rdmft (dE_dOccNum, dE_dWfc);
1260+ double Etotal_RDMFT = this ->rdmft_solver . run (dE_dOccNum, dE_dWfc);
12661261 }
12671262
12681263 /* ******* test RDMFT *********/
@@ -1394,19 +1389,6 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
13941389}
13951390
13961391
1397- // template <typename TK, typename TR>
1398- // double ESolver_KS_LCAO<TK, TR>::run_rdmft(ModuleBase::matrix& E_gradient_occNum, psi::Psi<TK>& E_gradient_wfc)
1399- // {
1400- // return this->rdmft_solver.run(E_gradient_occNum, E_gradient_wfc);
1401- // }
1402-
1403- // template <typename TK, typename TR>
1404- // void ESolver_KS_LCAO<TK, TR>::update_elec_rdmft(const ModuleBase::matrix& occ_number_in, const psi::Psi<TK>& wfc_in)
1405- // {
1406- // this->rdmft_solver.update_elec(occ_number_in, wfc_in);
1407- // }
1408-
1409-
14101392// ------------------------------------------------------------------------------
14111393// ! the 20th,21th,22th functions of ESolver_KS_LCAO
14121394// ! mohan add 2024-05-11
0 commit comments