diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index db5c5b613a..9efa0794f6 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -473,11 +473,6 @@ void ESolver_KS_PW::hamilt2density_single(UnitCell& ucell, srho.begin(is, this->chr, this->pw_rhod, ucell.symm); } - // deband is calculated from "output" charge density calculated - // in sum_band - // need 'rho(out)' and 'vr (v_h(in) and v_xc(in))' - this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); - ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2density_single"); } @@ -503,6 +498,11 @@ void ESolver_KS_PW::update_pot(UnitCell& ucell, const int istep, cons template void ESolver_KS_PW::iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) { + // deband is calculated from "output" charge density calculated + // in sum_band + // need 'rho(out)' and 'vr (v_h(in) and v_xc(in))' + this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); + // 1) Call iter_finish() of ESolver_KS ESolver_KS::iter_finish(ucell, istep, iter, conv_esolver);