@@ -28,7 +28,8 @@ namespace hsolver
2828
2929#ifdef USE_PAW
3030template <typename T, typename Device>
31- void HSolverPW<T, Device>::paw_func_in_kloop(const int ik)
31+ void HSolverPW<T, Device>::paw_func_in_kloop(const UnitCell& ucell,
32+ const int ik)
3233{
3334 if (this ->use_paw )
3435 {
@@ -68,7 +69,7 @@ void HSolverPW<T, Device>::paw_func_in_kloop(const int ik)
6869 this ->wfc_basis ->get_ig2iy (ik).data (),
6970 this ->wfc_basis ->get_ig2iz (ik).data (),
7071 (const double **)kpg,
71- GlobalC:: ucell.tpiba ,
72+ ucell.tpiba ,
7273 (const double **)gcar);
7374
7475 std::vector<double >().swap (kpt);
@@ -96,7 +97,7 @@ void HSolverPW<T, Device>::call_paw_cell_set_currentk(const int ik)
9697}
9798
9899template <typename T, typename Device>
99- void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecstate::ElecState* pes)
100+ void HSolverPW<T, Device>::paw_func_after_kloop(const UnitCell& ucell, psi::Psi<T, Device>& psi, elecstate::ElecState* pes)
100101{
101102 if (this ->use_paw )
102103 {
@@ -144,7 +145,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
144145 this ->wfc_basis ->get_ig2iy (ik).data (),
145146 this ->wfc_basis ->get_ig2iz (ik).data (),
146147 (const double **)kpg,
147- GlobalC:: ucell.tpiba ,
148+ ucell.tpiba ,
148149 (const double **)gcar);
149150
150151 std::vector<double >().swap (kpt);
@@ -177,7 +178,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
177178 {
178179 GlobalC::paw_cell.get_rhoijp (rhoijp, rhoijselect, nrhoijsel);
179180
180- for (int iat = 0 ; iat < GlobalC:: ucell.nat ; iat++)
181+ for (int iat = 0 ; iat < ucell.nat ; iat++)
181182 {
182183 GlobalC::paw_cell.set_rhoij (iat,
183184 nrhoijsel[iat],
@@ -189,7 +190,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
189190#else
190191 GlobalC::paw_cell.get_rhoijp (rhoijp, rhoijselect, nrhoijsel);
191192
192- for (int iat = 0 ; iat < GlobalC:: ucell.nat ; iat++)
193+ for (int iat = 0 ; iat < ucell.nat ; iat++)
193194 {
194195 GlobalC::paw_cell.set_rhoij (iat,
195196 nrhoijsel[iat],
@@ -252,6 +253,7 @@ template <typename T, typename Device>
252253void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
253254 psi::Psi<T, Device>& psi,
254255 elecstate::ElecState* pes,
256+ const UnitCell& ucell,
255257 double * out_eigenvalues,
256258 const int rank_in_pool_in,
257259 const int nproc_in_pool_in,
@@ -282,7 +284,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
282284 pHamilt->updateHk (ik);
283285
284286#ifdef USE_PAW
285- this ->paw_func_in_kloop (ik);
287+ this ->paw_func_in_kloop (ucell, ik);
286288#endif
287289
288290 // / update psi pointer for each k point
@@ -341,7 +343,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
341343 reinterpret_cast <elecstate::ElecStatePW<T, Device>*>(pes)->psiToRho (psi);
342344
343345#ifdef USE_PAW
344- this ->paw_func_after_kloop (psi, pes);
346+ this ->paw_func_after_kloop (ucell, psi, pes);
345347#endif
346348
347349 ModuleBase::timer::tick (" HSolverPW" , " solve" );
0 commit comments