|
14 | 14 | #include "module_elecstate/magnetism.h" |
15 | 15 | #include "module_hamilt_pw/hamilt_pwdft/global.h" |
16 | 16 | #include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" |
17 | | -#include "module_io/rho_io.h" |
| 17 | +#include "module_io/cube_io.h" |
18 | 18 | #include "module_io/rhog_io.h" |
19 | 19 | #include "module_io/read_wfc_to_rho.h" |
20 | 20 | #ifdef USE_PAW |
@@ -54,24 +54,22 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, |
54 | 54 | std::stringstream ssc; |
55 | 55 | ssc << PARAM.globalv.global_readin_dir << "SPIN" << is + 1 << "_CHG.cube"; |
56 | 56 | double& ef_tmp = eferm_iout.get_ef(is); |
57 | | - if (ModuleIO::read_rho( |
| 57 | + if (ModuleIO::read_cube( |
58 | 58 | #ifdef __MPI |
59 | | - &(GlobalC::Pgrid), |
| 59 | + & (GlobalC::Pgrid), |
60 | 60 | #endif |
61 | | - GlobalV::MY_RANK, |
62 | | - PARAM.inp.esolver_type, |
63 | | - GlobalV::RANK_IN_STOGROUP, |
64 | | - is, |
65 | | - GlobalV::ofs_running, |
66 | | - PARAM.inp.nspin, |
67 | | - ssc.str(), |
68 | | - this->rho[is], |
69 | | - this->rhopw->nx, |
70 | | - this->rhopw->ny, |
71 | | - this->rhopw->nz, |
72 | | - ef_tmp, |
73 | | - &(GlobalC::ucell), |
74 | | - this->prenspin)) |
| 61 | + (PARAM.inp.esolver_type == "sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK), |
| 62 | + is, |
| 63 | + GlobalV::ofs_running, |
| 64 | + PARAM.inp.nspin, |
| 65 | + ssc.str(), |
| 66 | + this->rho[is], |
| 67 | + this->rhopw->nx, |
| 68 | + this->rhopw->ny, |
| 69 | + this->rhopw->nz, |
| 70 | + ef_tmp, |
| 71 | + & (GlobalC::ucell), |
| 72 | + this->prenspin)) |
75 | 73 | { |
76 | 74 | GlobalV::ofs_running << " Read in the charge density: " << ssc.str() << std::endl; |
77 | 75 | } |
@@ -129,24 +127,22 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, |
129 | 127 | GlobalV::ofs_running << " try to read kinetic energy density from file : " << ssc.str() |
130 | 128 | << std::endl; |
131 | 129 | // mohan update 2012-02-10, sunliang update 2023-03-09 |
132 | | - if (ModuleIO::read_rho( |
| 130 | + if (ModuleIO::read_cube( |
133 | 131 | #ifdef __MPI |
134 | | - &(GlobalC::Pgrid), |
| 132 | + & (GlobalC::Pgrid), |
135 | 133 | #endif |
136 | | - GlobalV::MY_RANK, |
137 | | - PARAM.inp.esolver_type, |
138 | | - GlobalV::RANK_IN_STOGROUP, |
139 | | - is, |
140 | | - GlobalV::ofs_running, |
141 | | - PARAM.inp.nspin, |
142 | | - ssc.str(), |
143 | | - this->kin_r[is], |
144 | | - this->rhopw->nx, |
145 | | - this->rhopw->ny, |
146 | | - this->rhopw->nz, |
147 | | - eferm_iout.ef, |
148 | | - &(GlobalC::ucell), |
149 | | - this->prenspin)) |
| 134 | + (PARAM.inp.esolver_type == "sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK), |
| 135 | + is, |
| 136 | + GlobalV::ofs_running, |
| 137 | + PARAM.inp.nspin, |
| 138 | + ssc.str(), |
| 139 | + this->kin_r[is], |
| 140 | + this->rhopw->nx, |
| 141 | + this->rhopw->ny, |
| 142 | + this->rhopw->nz, |
| 143 | + eferm_iout.ef, |
| 144 | + & (GlobalC::ucell), |
| 145 | + this->prenspin)) |
150 | 146 | { |
151 | 147 | GlobalV::ofs_running << " Read in the kinetic energy density: " << ssc.str() << std::endl; |
152 | 148 | } |
|
0 commit comments