@@ -52,7 +52,7 @@ psi::Psi<std::complex<double>>* wavefunc::allocate(const int nkstot, const int n
5252 const int nks2 = nks;
5353
5454 psi::Psi<std::complex <double >>* psi_out = nullptr ;
55- if (PARAM.inp .calculation == " nscf" && this -> mem_saver == 1 )
55+ if (PARAM.inp .calculation == " nscf" && PARAM. inp . mem_saver == 1 )
5656 {
5757 // initial psi rather than evc
5858 psi_out = new psi::Psi<std::complex <double >>(1 , PARAM.inp .nbands , npwx * PARAM.globalv .npol , ngk);
@@ -140,11 +140,11 @@ void wavefunc::wfcinit(psi::Psi<std::complex<double>>* psi_in, ModulePW::PW_Basi
140140
141141int wavefunc::get_starting_nw () const
142142{
143- if (init_wfc == " file" )
143+ if (PARAM. inp . init_wfc == " file" )
144144 {
145145 return PARAM.inp .nbands ;
146146 }
147- else if (init_wfc.substr (0 , 6 ) == " atomic" )
147+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
148148 {
149149 if (GlobalC::ucell.natomwfc >= PARAM.inp .nbands )
150150 {
@@ -164,7 +164,7 @@ int wavefunc::get_starting_nw() const
164164 }
165165 return std::max (GlobalC::ucell.natomwfc , PARAM.inp .nbands );
166166 }
167- else if (init_wfc == " random" )
167+ else if (PARAM. inp . init_wfc == " random" )
168168 {
169169 if (PARAM.inp .test_wf )
170170 {
@@ -196,7 +196,7 @@ void diago_PAO_in_pw_k2(const int& ik,
196196 const int nbands = wvf.get_nbands ();
197197 const int current_nbasis = wfc_basis->npwk [ik];
198198
199- if (p_wf-> init_wfc == " file" )
199+ if (PARAM. inp . init_wfc == " file" )
200200 {
201201 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
202202 std::stringstream filename;
@@ -263,7 +263,7 @@ void diago_PAO_in_pw_k2(const int& ik,
263263 }
264264 */
265265
266- if (p_wf-> init_wfc == " random" || (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
266+ if (PARAM. inp . init_wfc == " random" || (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
267267 {
268268 p_wf->random (wvf.get_pointer (), 0 , nbands, ik, wfc_basis);
269269
@@ -280,7 +280,7 @@ void diago_PAO_in_pw_k2(const int& ik,
280280 }
281281 }
282282 }
283- else if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
283+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
284284 {
285285 ModuleBase::ComplexMatrix wfcatom (starting_nw, nbasis); // added by zhengdy-soc
286286 if (PARAM.inp .test_wf ) {
@@ -296,7 +296,7 @@ void diago_PAO_in_pw_k2(const int& ik,
296296 PARAM.globalv .nqx ,
297297 PARAM.globalv .dq );
298298
299- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
299+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
300300 {
301301 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
302302 }
@@ -355,7 +355,7 @@ void diago_PAO_in_pw_k2(const int& ik,
355355 const int nbands = wvf.get_nbands ();
356356 const int current_nbasis = wfc_basis->npwk [ik];
357357
358- if (p_wf-> init_wfc == " file" )
358+ if (PARAM. inp . init_wfc == " file" )
359359 {
360360 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
361361 std::stringstream filename;
@@ -420,7 +420,7 @@ void diago_PAO_in_pw_k2(const int& ik,
420420 assert (starting_nw > 0 );
421421 std::vector<double > etatom (starting_nw, 0.0 );
422422
423- if (p_wf-> init_wfc == " random" || (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
423+ if (PARAM. inp . init_wfc == " random" || (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
424424 {
425425 p_wf->random (wvf.get_pointer (), 0 , nbands, ik, wfc_basis);
426426 if (PARAM.inp .ks_solver == " cg" ) // xiaohui add 2013-09-02
@@ -436,7 +436,7 @@ void diago_PAO_in_pw_k2(const int& ik,
436436 }
437437 }
438438 }
439- else if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
439+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
440440 {
441441 ModuleBase::ComplexMatrix wfcatom (starting_nw, nbasis); // added by zhengdy-soc
442442 if (PARAM.inp .test_wf )
@@ -453,7 +453,7 @@ void diago_PAO_in_pw_k2(const int& ik,
453453 PARAM.globalv .nqx ,
454454 PARAM.globalv .dq );
455455
456- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
456+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
457457 {
458458 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
459459 }
@@ -534,7 +534,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
534534 int starting_nw = nbands;
535535
536536 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
537- if (p_wf-> init_wfc == " file" )
537+ if (PARAM. inp . init_wfc == " file" )
538538 {
539539 std::stringstream filename;
540540 int ik_tot = K_Vectors::get_ik_global (ik, p_wf->nkstot );
@@ -550,7 +550,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
550550 if (PARAM.inp .test_wf )
551551 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
552552
553- if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
553+ if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
554554 {
555555 p_wf->atomic_wfc (ik,
556556 current_nbasis,
@@ -560,7 +560,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
560560 GlobalC::ppcell.tab_at ,
561561 PARAM.globalv .nqx ,
562562 PARAM.globalv .dq );
563- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
563+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
564564 {
565565 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
566566 }
@@ -571,7 +571,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
571571 // ====================================================
572572 p_wf->random (wfcatom.c , GlobalC::ucell.natomwfc , nbands, ik, wfc_basis);
573573 }
574- else if (p_wf-> init_wfc == " random" )
574+ else if (PARAM. inp . init_wfc == " random" )
575575 {
576576 p_wf->random (wfcatom.c , 0 , nbands, ik, wfc_basis);
577577 }
@@ -638,7 +638,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
638638 int starting_nw = nbands;
639639
640640 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
641- if (p_wf-> init_wfc == " file" )
641+ if (PARAM. inp . init_wfc == " file" )
642642 {
643643 std::stringstream filename;
644644 int ik_tot = K_Vectors::get_ik_global (ik, p_wf->nkstot );
@@ -653,7 +653,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
653653 wfcatom.create (starting_nw, nbasis); // added by zhengdy-soc
654654 if (PARAM.inp .test_wf )
655655 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
656- if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
656+ if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
657657 {
658658 p_wf->atomic_wfc (ik,
659659 current_nbasis,
@@ -663,7 +663,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
663663 GlobalC::ppcell.tab_at ,
664664 PARAM.globalv .nqx ,
665665 PARAM.globalv .dq );
666- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
666+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
667667 {
668668 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
669669 }
@@ -674,7 +674,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
674674 // ====================================================
675675 p_wf->random (wfcatom.c , GlobalC::ucell.natomwfc , nbands, ik, wfc_basis);
676676 }
677- else if (p_wf-> init_wfc == " random" )
677+ else if (PARAM. inp . init_wfc == " random" )
678678 {
679679 p_wf->random (wfcatom.c , 0 , nbands, ik, wfc_basis);
680680 }
0 commit comments