@@ -259,8 +259,17 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
259259 // 14) initialize rdmft, added by jghan
260260 if ( PARAM.inp .rdmft == true )
261261 {
262- rdmft_solver.init ( this ->GG , this ->GK , this ->pv , ucell, this ->kv , *(this ->pelec ),
263- this ->orb_ , two_center_bundle_, PARAM.inp .dft_functional , PARAM.inp .rdmft_power_alpha );
262+ rdmft_solver.init (this ->GG ,
263+ this ->GK ,
264+ this ->pv ,
265+ ucell,
266+ this ->gd ,
267+ this ->kv ,
268+ *(this ->pelec ),
269+ this ->orb_ ,
270+ two_center_bundle_,
271+ PARAM.inp .dft_functional ,
272+ PARAM.inp .rdmft_power_alpha );
264273 }
265274
266275 ModuleBase::timer::tick (" ESolver_KS_LCAO" , " before_all_runners" );
@@ -296,6 +305,7 @@ void ESolver_KS_LCAO<TK, TR>::cal_force(UnitCell& ucell, ModuleBase::matrix& for
296305 PARAM.inp .test_force ,
297306 PARAM.inp .test_stress ,
298307 ucell,
308+ this ->gd ,
299309 this ->pv ,
300310 this ->pelec ,
301311 this ->psi ,
@@ -458,7 +468,7 @@ void ESolver_KS_LCAO<TK, TR>::after_all_runners(UnitCell& ucell)
458468 this ->kv ,
459469 orb_.cutoffs (),
460470 this ->pelec ->wg ,
461- GlobalC::GridD
471+ this -> gd
462472#ifdef __EXX
463473 ,
464474 this ->exx_lri_double ? &this ->exx_lri_double ->Hexxs : nullptr ,
@@ -484,7 +494,7 @@ void ESolver_KS_LCAO<TK, TR>::after_all_runners(UnitCell& ucell)
484494 this ->GK ,
485495 this ->kv ,
486496 this ->pelec ->wg ,
487- GlobalC::GridD ,
497+ this -> gd ,
488498 orb_.cutoffs (),
489499 this ->two_center_bundle_
490500#ifdef __EXX
@@ -1036,7 +1046,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
10361046 this ->pelec ->klist ->kvec_d ,
10371047 ucell,
10381048 orb_,
1039- GlobalC::GridD ,
1049+ this -> gd ,
10401050 &(this ->pv ),
10411051 *(this ->psi ),
10421052 dynamic_cast <const elecstate::ElecStateLCAO<TK>*>(this ->pelec )->get_DM (),
@@ -1136,14 +1146,23 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
11361146 two_center_bundle_,
11371147 orb_,
11381148 ucell,
1139- GlobalC::GridD ,
1149+ this -> gd ,
11401150 this ->kv ,
11411151 this ->p_hamilt );
1142-
1152+
11431153 // ! Perform Mulliken charge analysis
11441154 if (PARAM.inp .out_mul )
11451155 {
1146- ModuleIO::cal_mag (&(this ->pv ), this ->p_hamilt , this ->kv , this ->pelec , this ->two_center_bundle_ , this ->orb_ , ucell, istep, true );
1156+ ModuleIO::cal_mag (&(this ->pv ),
1157+ this ->p_hamilt ,
1158+ this ->kv ,
1159+ this ->pelec ,
1160+ this ->two_center_bundle_ ,
1161+ this ->orb_ ,
1162+ ucell,
1163+ this ->gd ,
1164+ istep,
1165+ true );
11471166 }
11481167 }
11491168
@@ -1189,7 +1208,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
11891208 &hR,
11901209 &ucell,
11911210 orb_.cutoffs (),
1192- &GlobalC::GridD ,
1211+ &this -> gd ,
11931212 two_center_bundle_.kinetic_orb .get ());
11941213
11951214 const int nspin_k = (PARAM.inp .nspin == 2 ? 2 : 1 );
@@ -1228,12 +1247,12 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12281247 PARAM.inp .wannier_spin );
12291248
12301249 myWannier.calculate (ucell,
1231- this ->pelec ->ekb ,
1232- this ->pw_wfc ,
1233- this ->pw_big ,
1234- this ->sf ,
1235- this ->kv ,
1236- this ->psi ,
1250+ this ->pelec ->ekb ,
1251+ this ->pw_wfc ,
1252+ this ->pw_big ,
1253+ this ->sf ,
1254+ this ->kv ,
1255+ this ->psi ,
12371256 &(this ->pv ));
12381257 }
12391258 else if (PARAM.inp .wannier_method == 2 )
@@ -1247,7 +1266,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12471266 PARAM.inp .wannier_spin ,
12481267 orb_);
12491268
1250- myWannier.calculate (ucell,this ->pelec ->ekb , this ->kv , *(this ->psi ), &(this ->pv ));
1269+ myWannier.calculate (ucell, this -> gd , this ->pelec ->ekb , this ->kv , *(this ->psi ), &(this ->pv ));
12511270 }
12521271 std::cout << FmtCore::format (" >> Finish %s.\n * * * * * *\n " , " Wave function to Wannier90" );
12531272 }
@@ -1259,12 +1278,10 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12591278 {
12601279 std::cout << FmtCore::format (" \n * * * * * *\n << Start %s.\n " , " Berry phase calculation" );
12611280 berryphase bp (&(this ->pv ));
1262- bp.lcao_init (ucell,
1263- this ->kv ,
1264- this ->GridT ,
1265- orb_); // additional step before calling
1266- // macroscopic_polarization (why capitalize
1267- // the function name?)
1281+ bp.lcao_init (ucell, this ->gd , this ->kv , this ->GridT , orb_);
1282+ // additional step before calling
1283+ // macroscopic_polarization (why capitalize
1284+ // the function name?)
12681285 bp.Macroscopic_polarization (ucell,this ->pw_wfc ->npwk_max , this ->psi , this ->pw_rho , this ->pw_wfc , this ->kv );
12691286 std::cout << FmtCore::format (" >> Finish %s.\n * * * * * *\n " , " Berry phase calculation" );
12701287 }
0 commit comments