99
1010void ModuleIO::read_wf2rho_pw (const ModulePW::PW_Basis_K* pw_wfc,
1111 ModuleSymmetry::Symmetry& symm,
12- const int * ik2iktot,
12+ const std::vector< int > & ik2iktot,
1313 const int nkstot,
14- const std::vector<int >& isk,
15- Charge& chg)
14+ const std::vector<int > &isk,
15+ Charge& chg,
16+ std::ofstream &ofs_running)
1617{
1718 ModuleBase::TITLE (" ModuleIO" , " read_wf2rho_pw" );
1819 ModuleBase::timer::tick (" ModuleIO" , " read_wf2rho_pw" );
1920
21+ ofs_running << " READING WAVE FUNCTIONS" << std::endl;
22+ ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
23+ " >>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
24+ ofs_running << " | "
25+ " |" << std::endl;
26+ ofs_running << " | Reading electronic wave functions in plane wave basis set and |" << std::endl;
27+ ofs_running << " | evaluate charge density based on these wave functions |" << std::endl;
28+ ofs_running << " | "
29+ " |" << std::endl;
30+ ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
31+ " >>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
32+
2033 const int kpar = GlobalV::KPAR;
2134 const int my_pool = GlobalV::MY_POOL;
2235 const int my_rank = GlobalV::MY_RANK;
@@ -39,8 +52,20 @@ void ModuleIO::read_wf2rho_pw(const ModulePW::PW_Basis_K* pw_wfc,
3952 {
4053 std::string filename = PARAM.globalv .global_readin_dir + " istate.info" ;
4154 std::ifstream ifs (filename);
55+
56+ if (!ifs)
57+ {
58+ std::stringstream sss;
59+ sss << " Cannot find file " << filename;
60+ ModuleBase::WARNING_QUIT (" ModuleIO::read_wf2rho_pw" , sss.str ());
61+ }
62+ else
63+ {
64+ ofs_running << " Find file containing weights of wave function: " << filename << std::endl;
65+ }
66+
4267 std::string useless;
43- if (PARAM. inp . nspin == 2 )
68+ if (nspin == 2 )
4469 {
4570 const int nkstot_np = nkstot / 2 ;
4671 for (int iktot_np = 0 ; iktot_np < nkstot_np; ++iktot_np)
@@ -82,7 +107,7 @@ void ModuleIO::read_wf2rho_pw(const ModulePW::PW_Basis_K* pw_wfc,
82107 const int ikstot = ik2iktot[ik];
83108 filename << PARAM.globalv .global_readin_dir << " WAVEFUNC" << ikstot + 1 << " .dat" ;
84109 ModuleIO::read_wfc_pw (filename.str (), pw_wfc, ik, ikstot, nkstot, wfc_tmp);
85- if (PARAM. inp . nspin == 4 )
110+ if (nspin == 4 )
86111 {
87112 std::vector<std::complex <double >> rho_tmp2 (nrxx);
88113 for (int ib = 0 ; ib < nbands; ++ib)
0 commit comments