Skip to content

Commit 9dc2a36

Browse files
Refactor: in ESolver_KS_PW, calculate deband in iter_finish, not in hamilt2density
1 parent fb8b16f commit 9dc2a36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,6 @@ void ESolver_KS_PW<T, Device>::hamilt2density_single(UnitCell& ucell,
473473
srho.begin(is, this->chr, this->pw_rhod, ucell.symm);
474474
}
475475

476-
// deband is calculated from "output" charge density calculated
477-
// in sum_band
478-
// need 'rho(out)' and 'vr (v_h(in) and v_xc(in))'
479-
this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell);
480-
481476
ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2density_single");
482477
}
483478

@@ -503,6 +498,11 @@ void ESolver_KS_PW<T, Device>::update_pot(UnitCell& ucell, const int istep, cons
503498
template <typename T, typename Device>
504499
void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver)
505500
{
501+
// deband is calculated from "output" charge density calculated
502+
// in sum_band
503+
// need 'rho(out)' and 'vr (v_h(in) and v_xc(in))'
504+
this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell);
505+
506506
// 1) Call iter_finish() of ESolver_KS
507507
ESolver_KS<T, Device>::iter_finish(ucell, istep, iter, conv_esolver);
508508

0 commit comments

Comments
 (0)