@@ -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
@@ -280,7 +280,7 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
280280 this ->deallocate_hamilt ();
281281
282282 // allocate HamiltPW
283- this ->allocate_hamilt ();
283+ this ->allocate_hamilt (ucell );
284284
285285 // ----------------------------------------------------------
286286 // about vdw, jiyy add vdwd3 and linpz add vdwd2
@@ -623,7 +623,8 @@ void ESolver_KS_PW<T, Device>::cal_force(UnitCell& ucell, ModuleBase::matrix& fo
623623 : reinterpret_cast <psi::Psi<std::complex <double >, Device>*>(this ->kspw_psi );
624624
625625 // Calculate forces
626- ff.cal_force (force,
626+ ff.cal_force (ucell,
627+ force,
627628 *this ->pelec ,
628629 this ->pw_rhod ,
629630 &ucell.symm ,
0 commit comments