@@ -52,7 +52,7 @@ class MockElecStatePW : public ElecStatePW
5252/* *****************************
5353 * read wavefunction
5454 ******************************/
55- void read_wfc2 (const std::string& fn, ModuleBase::ComplexMatrix* psi, ModuleBase::Vector3<double >* gkk)
55+ void read_wfc2 (const std::string& fn, psi::Psi<std:: complex < double >> & psi, ModuleBase::Vector3<double >* gkk)
5656{
5757 std::string* wfilename;
5858 wfilename = new std::string[GlobalC::kv.nkstot ];
@@ -94,7 +94,7 @@ void read_wfc2(const std::string& fn, ModuleBase::ComplexMatrix* psi, ModuleBase
9494 double realpart;
9595 double imagpart;
9696 ifs >> realpart >> imagpart;
97- psi[ik]( ib, ig) = std::complex <double >(realpart, imagpart);
97+ psi (ik, ib, ig) = std::complex <double >(realpart, imagpart);
9898 }
9999 getline (ifs, tmpstring);
100100 getline (ifs, tmpstring);
@@ -307,7 +307,7 @@ TEST_F(EState,RhoPW)
307307 std::stringstream ssw;
308308 ssw <<GlobalV::global_out_dir<< " WAVEFUNC" ;
309309 // we need to supply out_wfc_pw here
310- read_wfc2 (ssw.str (), GlobalC::wf.evc , GlobalC::pw.gcar );
310+ read_wfc2 (ssw.str (), GlobalC::wf.psi [ 0 ] , GlobalC::pw.gcar );
311311
312312 // copy data from old wf.evc to new evc(an object of Psi)
313313 evc.resize (GlobalC::kv.nks ,GlobalV::NBANDS,GlobalC::wf.npwx );
@@ -316,7 +316,7 @@ TEST_F(EState,RhoPW)
316316 {
317317 for (int j=0 ;j<GlobalC::wf.npwx ;j++)
318318 {
319- evc (i,j)=GlobalC::wf.evc [0 ](i,j);
319+ evc (i,j)=GlobalC::wf.psi [0 ](i,j);
320320 }
321321 }
322322 // using class ElecStatePW to calculate rho
0 commit comments