From 168e9b93fbb472544ebca110e9416d264ec4c39e Mon Sep 17 00:00:00 2001 From: sunliang98 <1700011430@pku.edu.cn> Date: Sun, 5 Jan 2025 22:14:31 +0800 Subject: [PATCH] Correct the name of eion_elec to elocal_pp, since the nonlocal part is not considered. Delet the output of Ekinetic, since it only works for local pp. --- source/module_elecstate/elecstate_energy.cpp | 2 +- source/module_elecstate/elecstate_energy_terms.cpp | 2 +- source/module_elecstate/elecstate_print.cpp | 6 ++---- source/module_elecstate/fp_energy.h | 2 +- source/module_esolver/esolver_of.cpp | 2 +- source/module_esolver/esolver_of_tool.cpp | 4 ++-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/module_elecstate/elecstate_energy.cpp b/source/module_elecstate/elecstate_energy.cpp index 23b714ee77..bbf88217a9 100644 --- a/source/module_elecstate/elecstate_energy.cpp +++ b/source/module_elecstate/elecstate_energy.cpp @@ -311,7 +311,7 @@ void ElecState::cal_energies(const int type) this->f_en.edftu = get_dftu_energy(); } - this->f_en.eion_elec = get_local_pp_energy(); + this->f_en.e_local_pp = get_local_pp_energy(); #ifdef __DEEPKS // energy from deepks diff --git a/source/module_elecstate/elecstate_energy_terms.cpp b/source/module_elecstate/elecstate_energy_terms.cpp index 8f2b9f1a35..a0551a7bdd 100644 --- a/source/module_elecstate/elecstate_energy_terms.cpp +++ b/source/module_elecstate/elecstate_energy_terms.cpp @@ -41,7 +41,7 @@ double ElecState::get_dftu_energy() double ElecState::get_local_pp_energy() { - double local_pseudopot_energy = 0.; // electron-ion interaction energy + double local_pseudopot_energy = 0.; // electron-ion interaction energy from local pseudopotential for (int is = 0; is < PARAM.inp.nspin; ++is) { local_pseudopot_energy += BlasConnector::dot(this->charge->rhopw->nrxx, this->pot->get_fixed_v(), 1, this->charge->rho[is], 1) diff --git a/source/module_elecstate/elecstate_print.cpp b/source/module_elecstate/elecstate_print.cpp index fcc852c6e4..0951379811 100644 --- a/source/module_elecstate/elecstate_print.cpp +++ b/source/module_elecstate/elecstate_print.cpp @@ -341,10 +341,8 @@ void ElecState::print_etot(const Magnetism& magnet, energies_Ry.push_back(this->f_en.demet); titles.push_back("E_descf"); energies_Ry.push_back(this->f_en.descf); - titles.push_back("E_IonElec"); - energies_Ry.push_back(this->f_en.eion_elec); - titles.push_back("E_Kinetic"); - energies_Ry.push_back(this->f_en.etot - this->f_en.eion_elec - this->f_en.hartree_energy - this->f_en.etxc + this->f_en.etxcc - this->f_en.ewald_energy); + titles.push_back("E_LocalPP"); + energies_Ry.push_back(this->f_en.e_local_pp); std::string vdw_method = PARAM.inp.vdw_method; if (vdw_method == "d2") // Peize Lin add 2014-04, update 2021-03-09 { diff --git a/source/module_elecstate/fp_energy.h b/source/module_elecstate/fp_energy.h index 9c922a3276..adbb3fe3bd 100644 --- a/source/module_elecstate/fp_energy.h +++ b/source/module_elecstate/fp_energy.h @@ -45,7 +45,7 @@ struct fenergy double escon = 0.0; ///< spin constraint energy double ekinetic = 0.0; /// kinetic energy, used in OFDFT - double eion_elec = 0.0; /// ion-electron interaction energy, used in OFDFT + double e_local_pp = 0.0; /// ion-electron interaction energy contributed by local pp, used in OFDFT double calculate_etot(); double calculate_harris(); diff --git a/source/module_esolver/esolver_of.cpp b/source/module_esolver/esolver_of.cpp index 5136477435..1b8fe29bb0 100644 --- a/source/module_esolver/esolver_of.cpp +++ b/source/module_esolver/esolver_of.cpp @@ -571,7 +571,7 @@ double ESolver_OF::cal_energy() } Parallel_Reduce::reduce_all(pseudopot_energy); this->pelec->f_en.ekinetic = kinetic_energy; - this->pelec->f_en.eion_elec = pseudopot_energy; + this->pelec->f_en.e_local_pp = pseudopot_energy; this->pelec->f_en.etot += kinetic_energy + pseudopot_energy; return this->pelec->f_en.etot; } diff --git a/source/module_esolver/esolver_of_tool.cpp b/source/module_esolver/esolver_of_tool.cpp index a22b7a0f0a..0d33ea897a 100644 --- a/source/module_esolver/esolver_of_tool.cpp +++ b/source/module_esolver/esolver_of_tool.cpp @@ -438,8 +438,8 @@ void ESolver_OF::print_info() energies_Ry.push_back(this->pelec->f_en.hartree_energy); titles.push_back("E_xc"); energies_Ry.push_back(this->pelec->f_en.etxc - this->pelec->f_en.etxcc); - titles.push_back("E_IonElec"); - energies_Ry.push_back(this->pelec->f_en.eion_elec); + titles.push_back("E_LocalPP"); + energies_Ry.push_back(this->pelec->f_en.e_local_pp); titles.push_back("E_Ewald"); energies_Ry.push_back(this->pelec->f_en.ewald_energy); if (this->of_kinetic_ == "tf" || this->of_kinetic_ == "tf+" || this->of_kinetic_ == "wt")