@@ -194,8 +194,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
194194 wavefunc* p_wf,
195195 const ModuleBase::realArray& tab_at,
196196 const int & lmaxkb,
197- const int natomwfc,
198- const int lmax_ppwf,
197+ const UnitCell& ucell,
199198 hamilt::Hamilt<std::complex <float >, base_device::DEVICE_CPU>* phm_in)
200199{
201200 // TODO float func
@@ -209,8 +208,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
209208 wavefunc* p_wf,
210209 const ModuleBase::realArray& tab_at,
211210 const int & lmaxkb,
212- const int natomwfc,
213- const int lmax_ppwf,
211+ const UnitCell& ucell,
214212 hamilt::Hamilt<std::complex <double >, base_device::DEVICE_CPU>* phm_in)
215213{
216214 ModuleBase::TITLE (" wavefunc" , " diago_PAO_in_pw_k2" );
@@ -256,7 +254,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
256254 }
257255 }
258256 else if (PARAM.inp .init_wfc == " random"
259- || (PARAM.inp .init_wfc .substr (0 , 6 ) == " atomic" && natomwfc == 0 ))
257+ || (PARAM.inp .init_wfc .substr (0 , 6 ) == " atomic" && ucell. natomwfc == 0 ))
260258 {
261259 p_wf->random (wvf.get_pointer (), 0 , nbands, ik, wfc_basis);
262260
@@ -277,7 +275,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
277275 }
278276 else if (PARAM.inp .init_wfc .substr (0 , 6 ) == " atomic" )
279277 {
280- const int starting_nw = p_wf->get_starting_nw (natomwfc);
278+ const int starting_nw = p_wf->get_starting_nw (ucell. natomwfc );
281279 if (starting_nw == 0 )
282280 {
283281 return ;
@@ -291,9 +289,10 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
291289 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
292290 }
293291
294- p_wf->atomic_wfc (ik,
292+ p_wf->atomic_wfc (ucell,
293+ ik,
295294 current_nbasis,
296- lmax_ppwf,
295+ ucell. lmax_ppwf ,
297296 lmaxkb,
298297 wfc_basis,
299298 wfcatom,
@@ -302,7 +301,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
302301 PARAM.globalv .dq );
303302
304303 if (PARAM.inp .init_wfc == " atomic+random"
305- && starting_nw == natomwfc) // added by qianrui 2021-5-16
304+ && starting_nw == ucell. natomwfc ) // added by qianrui 2021-5-16
306305 {
307306 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
308307 }
@@ -311,7 +310,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
311310 // If not enough atomic wfc are available, complete
312311 // with random wfcs
313312 // ====================================================
314- p_wf->random (wfcatom.c , natomwfc, nbands, ik, wfc_basis);
313+ p_wf->random (wfcatom.c , ucell. natomwfc , nbands, ik, wfc_basis);
315314
316315 // (7) Diago with cg method.
317316 // if(GlobalV::DIAGO_TYPE == "cg") xiaohui modify 2013-09-02
@@ -355,8 +354,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
355354 wavefunc* p_wf,
356355 const ModuleBase::realArray& tab_at,
357356 const int & lmaxkb,
358- const int natomwfc,
359- const int lmax_ppwf,
357+ const UnitCell& ucell,
360358 hamilt::Hamilt<std::complex <float >, base_device::DEVICE_GPU>* phm_in)
361359{
362360 // TODO float
@@ -370,8 +368,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
370368 wavefunc* p_wf,
371369 const ModuleBase::realArray& tab_at,
372370 const int & lmaxkb,
373- const int natomwfc,
374- const int lmax_ppwf,
371+ const UnitCell& ucell,
375372 hamilt::Hamilt<std::complex <double >, base_device::DEVICE_GPU>* phm_in)
376373{
377374 ModuleBase::TITLE (" wavefunc" , " diago_PAO_in_pw_k2" );
@@ -399,7 +396,8 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
399396 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
400397 if (PARAM.inp .init_wfc .substr (0 , 6 ) == " atomic" )
401398 {
402- p_wf->atomic_wfc (ik,
399+ p_wf->atomic_wfc (ucell,
400+ ik,
403401 current_nbasis,
404402 lmax_ppwf,
405403 lmaxkb,
@@ -409,7 +407,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
409407 PARAM.globalv .nqx ,
410408 PARAM.globalv .dq );
411409 if (PARAM.inp .init_wfc == " atomic+random"
412- && starting_nw == natomwfc) // added by qianrui 2021-5-16
410+ && starting_nw == ucell. natomwfc ) // added by qianrui 2021-5-16
413411 {
414412 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
415413 }
@@ -418,7 +416,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
418416 // If not enough atomic wfc are available, complete
419417 // with random wfcs
420418 // ====================================================
421- p_wf->random (wfcatom.c , natomwfc, nbands, ik, wfc_basis);
419+ p_wf->random (wfcatom.c , ucell. natomwfc , nbands, ik, wfc_basis);
422420 }
423421 else if (PARAM.inp .init_wfc == " random" )
424422 {
0 commit comments