From 419386410c2bf6536364f816c903349e0357bcf5 Mon Sep 17 00:00:00 2001 From: maki49 <1579492865@qq.com> Date: Sat, 13 Jul 2024 13:46:45 +0800 Subject: [PATCH] fix: init exd/exc in begin_all_runners rather than beforescf --- source/module_esolver/esolver_ks_lcao.cpp | 2 ++ source/module_esolver/esolver_ks_lcao_elec.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index f1acab2934..d3e14c3211 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -177,11 +177,13 @@ void ESolver_KS_LCAO::before_all_runners(Input& inp, UnitCell& ucell) { this->exx_lri_double = std::make_shared>(GlobalC::exx_info.info_ri); this->exx_lri_double->init(MPI_COMM_WORLD, this->kv); + this->exd = std::make_shared>(exx_lri_double); } else { this->exx_lri_complex = std::make_shared>>(GlobalC::exx_info.info_ri); this->exx_lri_complex->init(MPI_COMM_WORLD, this->kv); + this->exc = std::make_shared>>(exx_lri_complex); } } } diff --git a/source/module_esolver/esolver_ks_lcao_elec.cpp b/source/module_esolver/esolver_ks_lcao_elec.cpp index 0bed54ff71..3699a53c7a 100644 --- a/source/module_esolver/esolver_ks_lcao_elec.cpp +++ b/source/module_esolver/esolver_ks_lcao_elec.cpp @@ -284,12 +284,10 @@ void ESolver_KS_LCAO::before_scf(const int istep) #ifdef __EXX // set xc type before the first cal of xc in pelec->init_scf if (GlobalC::exx_info.info_ri.real_number) { - this->exd = std::make_shared>(exx_lri_double); this->exd->exx_beforescf(this->kv, *this->p_chgmix); } else { - this->exc = std::make_shared>>(exx_lri_complex); this->exc->exx_beforescf(this->kv, *this->p_chgmix); } #endif // __EXX