Skip to content

Commit 5e17d47

Browse files
Life Savior (#6938)
1 parent 2c7ebf0 commit 5e17d47

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@ void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int
307307
if (PARAM.inp.exx_thr_type == "energy")
308308
{
309309
dexx = exx_helper.cal_exx_energy(this->stp.psi_t);
310-
}
311-
exx_helper.set_psi(this->stp.psi_t);
312-
if (PARAM.inp.exx_thr_type == "energy")
313-
{
310+
exx_helper.set_psi(this->stp.psi_t);
314311
dexx -= exx_helper.cal_exx_energy(this->stp.psi_t);
315312
// std::cout << "dexx = " << dexx << std::endl;
316313
}
@@ -319,6 +316,10 @@ void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int
319316
conv_esolver = exx_helper.exx_after_converge(iter, conv_ene);
320317
if (!conv_esolver)
321318
{
319+
if (PARAM.inp.exx_thr_type != "energy")
320+
{
321+
exx_helper.set_psi(this->stp.psi_t);
322+
}
322323
auto duration = std::chrono::high_resolution_clock::now() - start;
323324
std::cout << " Setting Psi for EXX PW Inner Loop took "
324325
<< std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() / 1000.0 << "s"

0 commit comments

Comments
 (0)