Skip to content

Commit

Permalink
Correct the name of eion_elec to elocal_pp, since the nonlocal part i…
Browse files Browse the repository at this point in the history
…s not considered.

Delet the output of Ekinetic, since it only works for local pp.
  • Loading branch information
sunliang98 committed Jan 5, 2025
1 parent 6213fdf commit 168e9b9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/module_elecstate/elecstate_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/elecstate_energy_terms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions source/module_elecstate/elecstate_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/fp_energy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_of.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions source/module_esolver/esolver_of_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 168e9b9

Please sign in to comment.