@@ -128,6 +128,14 @@ void wavefunc::allocate(const int nks)
128128 std::cout << " MEMORY FOR PSI (MB) : " <<
129129 ModuleBase::Memory::record (" wavefunc" ," evc" ,nks2*GlobalV::NBANDS*(prefactor*npwx)," complexmatrix" ) << std::endl;
130130 }
131+ else if (GlobalV::CALCULATION.substr (0 ,3 ) == " sto" )
132+ {
133+ this ->evc = new ModuleBase::ComplexMatrix [nks2];
134+ for (int ik = 0 ; ik < nks2; ik++)
135+ {
136+ this ->evc [ik].create (GlobalV::NBANDS, npwx * GlobalV::NPOL);// added by zhengdy-soc
137+ }
138+ }
131139 else
132140 {
133141 // initial psi rather than evc
@@ -359,7 +367,14 @@ void wavefunc::wfcinit_k(void)
359367 // get the wave functions
360368 // by first diagolize PAO
361369 // wave functions.
362- this ->diago_PAO_in_pw_k (ik, this ->psi [0 ]);
370+ if (GlobalV::CALCULATION.substr (0 ,3 ) == " sto" )
371+ {
372+ this ->diago_PAO_in_pw_k (ik, this ->evc [ik]);
373+ }
374+ else
375+ {
376+ this ->diago_PAO_in_pw_k (ik, this ->psi [0 ]);
377+ }
363378 }
364379#ifdef __LCAO
365380 else if (GlobalV::BASIS_TYPE==" lcao_in_pw" )
@@ -823,6 +838,15 @@ void wavefunc::init_after_vc(const int nks)
823838}
824839
825840// temporary function for nscf
841+ void wavefunc::diago_PAO_in_pw_k (const int &ik, ModuleBase::ComplexMatrix &wvf)
842+ {
843+ ModuleBase::TITLE (" wavefunc" ," diago_PAO_in_pw_k" );
844+
845+ GlobalC::hm.hpw .init_k (ik);
846+ this ->diago_PAO_in_pw_k2 (ik, wvf);
847+
848+ return ;
849+ }
826850void wavefunc::diago_PAO_in_pw_k2 (const int &ik, ModuleBase::ComplexMatrix &wvf)
827851{
828852 ModuleBase::TITLE (" wavefunc" ," diago_PAO_in_pw_k2" );
0 commit comments