2323
2424void Charge::init_rho (elecstate::efermi& eferm_iout,
2525 const UnitCell& ucell,
26+ const Parallel_Grid& pgrid,
2627 const ModuleBase::ComplexMatrix& strucFac,
2728 ModuleSymmetry::Symmetry& symm,
2829 const void * klist,
@@ -33,7 +34,8 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
3334 std::cout << " START CHARGE : " << PARAM.inp .init_chg << std::endl;
3435 // here we need to set the omega for the charge density
3536 set_omega (&ucell.omega );
36-
37+ this ->pgrid = &pgrid;
38+
3739 bool read_error = false ;
3840 if (PARAM.inp .init_chg == " file" || PARAM.inp .init_chg == " auto" )
3941 {
@@ -57,7 +59,7 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
5759 {
5860 std::stringstream ssc;
5961 ssc << PARAM.globalv .global_readin_dir << " SPIN" << is + 1 << " _CHG.cube" ;
60- if (ModuleIO::read_vdata_palgrid (GlobalC::Pgrid ,
62+ if (ModuleIO::read_vdata_palgrid (pgrid ,
6163 (PARAM.inp .esolver_type == " sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK),
6264 GlobalV::ofs_running,
6365 ssc.str (),
@@ -107,7 +109,7 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
107109 GlobalV::ofs_running << " try to read kinetic energy density from file : " << ssc.str ()
108110 << std::endl;
109111 // mohan update 2012-02-10, sunliang update 2023-03-09
110- if (ModuleIO::read_vdata_palgrid (GlobalC::Pgrid ,
112+ if (ModuleIO::read_vdata_palgrid (pgrid ,
111113 (PARAM.inp .esolver_type == " sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK),
112114 GlobalV::ofs_running,
113115 ssc.str (),
@@ -170,7 +172,7 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
170172 // try to load from the output of `out_chg`
171173 std::stringstream ssc;
172174 ssc << PARAM.globalv .global_readin_dir << " SPIN" << is + 1 << " _CHG.cube" ;
173- if (ModuleIO::read_vdata_palgrid (GlobalC::Pgrid ,
175+ if (ModuleIO::read_vdata_palgrid (pgrid ,
174176 (PARAM.inp .esolver_type == " sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK),
175177 GlobalV::ofs_running,
176178 ssc.str (),
0 commit comments