@@ -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);
@@ -129,11 +129,11 @@ void wavefunc::wfcinit(psi::Psi<std::complex<double>>* psi_in, ModulePW::PW_Basi
129129
130130int wavefunc::get_starting_nw () const
131131{
132- if (init_wfc == " file" )
132+ if (PARAM. inp . init_wfc == " file" )
133133 {
134134 return PARAM.inp .nbands ;
135135 }
136- else if (init_wfc.substr (0 , 6 ) == " atomic" )
136+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
137137 {
138138 if (GlobalC::ucell.natomwfc >= PARAM.inp .nbands )
139139 {
@@ -153,7 +153,7 @@ int wavefunc::get_starting_nw() const
153153 }
154154 return std::max (GlobalC::ucell.natomwfc , PARAM.inp .nbands );
155155 }
156- else if (init_wfc == " random" )
156+ else if (PARAM. inp . init_wfc == " random" )
157157 {
158158 if (PARAM.inp .test_wf )
159159 {
@@ -185,7 +185,7 @@ void diago_PAO_in_pw_k2(const int& ik,
185185 const int nbands = wvf.get_nbands ();
186186 const int current_nbasis = wfc_basis->npwk [ik];
187187
188- if (p_wf-> init_wfc == " file" )
188+ if (PARAM. inp . init_wfc == " file" )
189189 {
190190 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
191191 std::stringstream filename;
@@ -252,7 +252,7 @@ void diago_PAO_in_pw_k2(const int& ik,
252252 }
253253 */
254254
255- if (p_wf-> init_wfc == " random" || (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
255+ if (PARAM. inp . init_wfc == " random" || (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
256256 {
257257 p_wf->random (wvf.get_pointer (), 0 , nbands, ik, wfc_basis);
258258
@@ -269,7 +269,7 @@ void diago_PAO_in_pw_k2(const int& ik,
269269 }
270270 }
271271 }
272- else if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
272+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
273273 {
274274 ModuleBase::ComplexMatrix wfcatom (starting_nw, nbasis); // added by zhengdy-soc
275275 if (PARAM.inp .test_wf ) {
@@ -285,7 +285,7 @@ void diago_PAO_in_pw_k2(const int& ik,
285285 PARAM.globalv .nqx ,
286286 PARAM.globalv .dq );
287287
288- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
288+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
289289 {
290290 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
291291 }
@@ -344,7 +344,7 @@ void diago_PAO_in_pw_k2(const int& ik,
344344 const int nbands = wvf.get_nbands ();
345345 const int current_nbasis = wfc_basis->npwk [ik];
346346
347- if (p_wf-> init_wfc == " file" )
347+ if (PARAM. inp . init_wfc == " file" )
348348 {
349349 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
350350 std::stringstream filename;
@@ -409,7 +409,7 @@ void diago_PAO_in_pw_k2(const int& ik,
409409 assert (starting_nw > 0 );
410410 std::vector<double > etatom (starting_nw, 0.0 );
411411
412- if (p_wf-> init_wfc == " random" || (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
412+ if (PARAM. inp . init_wfc == " random" || (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" && GlobalC::ucell.natomwfc == 0 ))
413413 {
414414 p_wf->random (wvf.get_pointer (), 0 , nbands, ik, wfc_basis);
415415 if (PARAM.inp .ks_solver == " cg" ) // xiaohui add 2013-09-02
@@ -425,7 +425,7 @@ void diago_PAO_in_pw_k2(const int& ik,
425425 }
426426 }
427427 }
428- else if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
428+ else if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
429429 {
430430 ModuleBase::ComplexMatrix wfcatom (starting_nw, nbasis); // added by zhengdy-soc
431431 if (PARAM.inp .test_wf )
@@ -442,7 +442,7 @@ void diago_PAO_in_pw_k2(const int& ik,
442442 PARAM.globalv .nqx ,
443443 PARAM.globalv .dq );
444444
445- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
445+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
446446 {
447447 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
448448 }
@@ -523,7 +523,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
523523 int starting_nw = nbands;
524524
525525 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
526- if (p_wf-> init_wfc == " file" )
526+ if (PARAM. inp . init_wfc == " file" )
527527 {
528528 std::stringstream filename;
529529 int ik_tot = K_Vectors::get_ik_global (ik, p_wf->nkstot );
@@ -539,7 +539,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
539539 if (PARAM.inp .test_wf )
540540 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
541541
542- if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
542+ if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
543543 {
544544 p_wf->atomic_wfc (ik,
545545 current_nbasis,
@@ -549,7 +549,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
549549 GlobalC::ppcell.tab_at ,
550550 PARAM.globalv .nqx ,
551551 PARAM.globalv .dq );
552- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
552+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
553553 {
554554 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
555555 }
@@ -560,7 +560,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
560560 // ====================================================
561561 p_wf->random (wfcatom.c , GlobalC::ucell.natomwfc , nbands, ik, wfc_basis);
562562 }
563- else if (p_wf-> init_wfc == " random" )
563+ else if (PARAM. inp . init_wfc == " random" )
564564 {
565565 p_wf->random (wfcatom.c , 0 , nbands, ik, wfc_basis);
566566 }
@@ -627,7 +627,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
627627 int starting_nw = nbands;
628628
629629 ModuleBase::ComplexMatrix wfcatom (nbands, nbasis);
630- if (p_wf-> init_wfc == " file" )
630+ if (PARAM. inp . init_wfc == " file" )
631631 {
632632 std::stringstream filename;
633633 int ik_tot = K_Vectors::get_ik_global (ik, p_wf->nkstot );
@@ -642,7 +642,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
642642 wfcatom.create (starting_nw, nbasis); // added by zhengdy-soc
643643 if (PARAM.inp .test_wf )
644644 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " starting_nw" , starting_nw);
645- if (p_wf-> init_wfc .substr (0 , 6 ) == " atomic" )
645+ if (PARAM. inp . init_wfc .substr (0 , 6 ) == " atomic" )
646646 {
647647 p_wf->atomic_wfc (ik,
648648 current_nbasis,
@@ -652,7 +652,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
652652 GlobalC::ppcell.tab_at ,
653653 PARAM.globalv .nqx ,
654654 PARAM.globalv .dq );
655- if (p_wf-> init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
655+ if (PARAM. inp . init_wfc == " atomic+random" && starting_nw == GlobalC::ucell.natomwfc ) // added by qianrui 2021-5-16
656656 {
657657 p_wf->atomicrandom (wfcatom, 0 , starting_nw, ik, wfc_basis);
658658 }
@@ -663,7 +663,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
663663 // ====================================================
664664 p_wf->random (wfcatom.c , GlobalC::ucell.natomwfc , nbands, ik, wfc_basis);
665665 }
666- else if (p_wf-> init_wfc == " random" )
666+ else if (PARAM. inp . init_wfc == " random" )
667667 {
668668 p_wf->random (wfcatom.c , 0 , nbands, ik, wfc_basis);
669669 }
0 commit comments