@@ -955,14 +955,11 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
955955 // 2.5) determine whether rdmft needs to get the initial value, added by jghan, 2024-10-25
956956 bool one_step_exx = false ;
957957 bool get_init_value_rdmft = false ;
958- // the case without hybrid functionals
959- if ( iter == 1 ) get_init_value_rdmft = true ;
960-
958+ if ( iter == 1 ) get_init_value_rdmft = true ; // the case without hybrid functionals
961959#ifdef __EXX
962960 if ( GlobalC::exx_info.info_global .cal_exx )
963961 {
964962 if ( this ->conv_esolver ) one_step_exx = true ;
965-
966963 // the case with hybrid functionals
967964 if ( one_step_exx && iter==1 ) get_init_value_rdmft = true ;
968965 else get_init_value_rdmft = false ;
@@ -1126,8 +1123,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
11261123 ModuleBase::TITLE (" RDMFT" , " E & Egradient" );
11271124 ModuleBase::timer::tick (" RDMFT" , " E & Egradient" );
11281125
1129- // if ( (!GlobalC::exx_info.info_global.cal_exx && iter == 1) || one_step_exx )
1130- // if ( !GlobalC::exx_info.info_global.cal_exx || (GlobalC::exx_info.info_global.cal_exx && one_step_exx) )
11311126 if ( get_init_value_rdmft )
11321127 {
11331128 ModuleBase::matrix occ_number_ks (this ->pelec ->wg );
@@ -1136,14 +1131,14 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)
11361131 for (int inb=0 ; inb < occ_number_ks.nc ; ++inb) occ_number_ks (ik, inb) /= this ->kv .wk [ik];
11371132 }
11381133
1139- this ->update_elec_rdmft (occ_number_ks, *(this ->psi ));
1134+ this ->rdmft_solver . update_elec (occ_number_ks, *(this ->psi ));
11401135
11411136 // initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
11421137 ModuleBase::matrix dE_dOccNum (this ->pelec ->wg .nr , this ->pelec ->wg .nc , true );
11431138 psi::Psi<TK> dE_dWfc (this ->psi ->get_nk (), this ->psi ->get_nbands (), this ->psi ->get_nbasis ());
11441139 dE_dWfc.zero_out ();
11451140
1146- double Etotal_RDMFT = this ->run_rdmft (dE_dOccNum, dE_dWfc);
1141+ double Etotal_RDMFT = this ->rdmft_solver . run (dE_dOccNum, dE_dWfc);
11471142
11481143 ModuleBase::timer::tick (" RDMFT" , " E & Egradient" );
11491144
@@ -1256,14 +1251,14 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
12561251 for (int inb=0 ; inb < occ_number_ks.nc ; ++inb) { occ_number_ks (ik, inb) /= this ->kv .wk [ik];
12571252}
12581253 }
1259- this ->update_elec_rdmft (occ_number_ks, *(this ->psi ));
1254+ this ->rdmft_solver . update_elec (occ_number_ks, *(this ->psi ));
12601255
12611256 // initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
12621257 ModuleBase::matrix dE_dOccNum (this ->pelec ->wg .nr , this ->pelec ->wg .nc , true );
12631258 psi::Psi<TK> dE_dWfc (this ->psi ->get_nk (), this ->psi ->get_nbands (), this ->psi ->get_nbasis ());
12641259 dE_dWfc.zero_out ();
12651260
1266- double Etotal_RDMFT = this ->run_rdmft (dE_dOccNum, dE_dWfc);
1261+ double Etotal_RDMFT = this ->rdmft_solver . run (dE_dOccNum, dE_dWfc);
12671262 }
12681263
12691264 /* ******* test RDMFT *********/
@@ -1395,19 +1390,6 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
13951390}
13961391
13971392
1398- template <typename TK, typename TR>
1399- double ESolver_KS_LCAO<TK, TR>::run_rdmft(ModuleBase::matrix& E_gradient_occNum, psi::Psi<TK>& E_gradient_wfc)
1400- {
1401- return this ->rdmft_solver .run (E_gradient_occNum, E_gradient_wfc);
1402- }
1403-
1404- template <typename TK, typename TR>
1405- void ESolver_KS_LCAO<TK, TR>::update_elec_rdmft(const ModuleBase::matrix& occ_number_in, const psi::Psi<TK>& wfc_in)
1406- {
1407- this ->rdmft_solver .update_elec (occ_number_in, wfc_in);
1408- }
1409-
1410-
14111393// ------------------------------------------------------------------------------
14121394// ! the 20th,21th,22th functions of ESolver_KS_LCAO
14131395// ! mohan add 2024-05-11
0 commit comments