@@ -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 int ik,
32+ const double tpiba)
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+ tpiba,
7273 (const double **)gcar);
7374
7475 std::vector<double >().swap (kpt);
@@ -96,7 +97,10 @@ 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(psi::Psi<T, Device>& psi,
101+ elecstate::ElecState* pes,
102+ const double tpiba,
103+ const int nat)
100104{
101105 if (this ->use_paw )
102106 {
@@ -144,7 +148,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
144148 this ->wfc_basis ->get_ig2iy (ik).data (),
145149 this ->wfc_basis ->get_ig2iz (ik).data (),
146150 (const double **)kpg,
147- GlobalC::ucell. tpiba ,
151+ tpiba,
148152 (const double **)gcar);
149153
150154 std::vector<double >().swap (kpt);
@@ -177,7 +181,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
177181 {
178182 GlobalC::paw_cell.get_rhoijp (rhoijp, rhoijselect, nrhoijsel);
179183
180- for (int iat = 0 ; iat < GlobalC::ucell. nat ; iat++)
184+ for (int iat = 0 ; iat < nat; iat++)
181185 {
182186 GlobalC::paw_cell.set_rhoij (iat,
183187 nrhoijsel[iat],
@@ -189,7 +193,7 @@ void HSolverPW<T, Device>::paw_func_after_kloop(psi::Psi<T, Device>& psi, elecst
189193#else
190194 GlobalC::paw_cell.get_rhoijp (rhoijp, rhoijselect, nrhoijsel);
191195
192- for (int iat = 0 ; iat < GlobalC::ucell. nat ; iat++)
196+ for (int iat = 0 ; iat < nat; iat++)
193197 {
194198 GlobalC::paw_cell.set_rhoij (iat,
195199 nrhoijsel[iat],
@@ -255,7 +259,9 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
255259 double * out_eigenvalues,
256260 const int rank_in_pool_in,
257261 const int nproc_in_pool_in,
258- const bool skip_charge)
262+ const bool skip_charge,
263+ const double tpiba,
264+ const int nat)
259265{
260266 ModuleBase::TITLE (" HSolverPW" , " solve" );
261267 ModuleBase::timer::tick (" HSolverPW" , " solve" );
@@ -282,7 +288,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
282288 pHamilt->updateHk (ik);
283289
284290#ifdef USE_PAW
285- this ->paw_func_in_kloop (ik);
291+ this ->paw_func_in_kloop (ik,tpiba );
286292#endif
287293
288294 // / update psi pointer for each k point
@@ -341,7 +347,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
341347 reinterpret_cast <elecstate::ElecStatePW<T, Device>*>(pes)->psiToRho (psi);
342348
343349#ifdef USE_PAW
344- this ->paw_func_after_kloop (psi, pes);
350+ this ->paw_func_after_kloop (psi, pes,tpiba,nat );
345351#endif
346352
347353 ModuleBase::timer::tick (" HSolverPW" , " solve" );
0 commit comments