@@ -115,9 +115,9 @@ ESolver_KS_PW<T, Device>::~ESolver_KS_PW()
115115}
116116
117117template <typename T, typename Device>
118- void ESolver_KS_PW<T, Device>::allocate_hamilt()
118+ void ESolver_KS_PW<T, Device>::allocate_hamilt(const UnitCell& ucell )
119119{
120- this ->p_hamilt = new hamilt::HamiltPW<T, Device>(this ->pelec ->pot , this ->pw_wfc , &this ->kv , &this ->ppcell );
120+ this ->p_hamilt = new hamilt::HamiltPW<T, Device>(this ->pelec ->pot , this ->pw_wfc , &this ->kv , &this ->ppcell , &ucell );
121121}
122122template <typename T, typename Device>
123123void ESolver_KS_PW<T, Device>::deallocate_hamilt()
@@ -202,10 +202,10 @@ void ESolver_KS_PW<T, Device>::before_all_runners(UnitCell& ucell, const Input_p
202202 }
203203
204204 // ! init pseudopotential
205- this ->ppcell .init (ucell. ntype , &this ->sf , this ->pw_wfc );
205+ this ->ppcell .init (ucell, &this ->sf , this ->pw_wfc );
206206
207207 // ! initalize local pseudopotential
208- this ->ppcell .init_vloc (this ->pw_rhod );
208+ this ->ppcell .init_vloc (ucell, this ->pw_rhod );
209209 ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " LOCAL POTENTIAL" );
210210
211211 // ! Initalize non-local pseudopotential
@@ -279,7 +279,7 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
279279 this ->deallocate_hamilt ();
280280
281281 // allocate HamiltPW
282- this ->allocate_hamilt ();
282+ this ->allocate_hamilt (ucell );
283283
284284 // ----------------------------------------------------------
285285 // about vdw, jiyy add vdwd3 and linpz add vdwd2
@@ -621,7 +621,8 @@ void ESolver_KS_PW<T, Device>::cal_force(UnitCell& ucell, ModuleBase::matrix& fo
621621 : reinterpret_cast <psi::Psi<std::complex <double >, Device>*>(this ->kspw_psi );
622622
623623 // Calculate forces
624- ff.cal_force (force,
624+ ff.cal_force (ucell,
625+ force,
625626 *this ->pelec ,
626627 this ->pw_rhod ,
627628 &ucell.symm ,
0 commit comments