Skip to content

Commit 08b73dc

Browse files
Fix: conv
1 parent b798359 commit 08b73dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,11 @@ void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int
620620
auto start = std::chrono::high_resolution_clock::now();
621621
exx_helper.set_firstiter(false);
622622
exx_helper.op_exx->first_iter = false;
623+
double dexx = exx_helper.cal_exx_energy(this->kspw_psi);
623624
exx_helper.set_psi(this->kspw_psi);
625+
dexx -= exx_helper.cal_exx_energy(this->kspw_psi);
624626

625-
conv_esolver = exx_helper.exx_after_converge(iter);
627+
conv_esolver = std::abs(dexx) < PARAM.inp.scf_ene_thr || exx_helper.exx_after_converge(iter);
626628

627629
if (!conv_esolver)
628630
{

0 commit comments

Comments
 (0)