Skip to content

Commit

Permalink
fix the output value of ediff in abaucs.json (#3787)
Browse files Browse the repository at this point in the history
  • Loading branch information
pxlxingliang committed Mar 25, 2024
1 parent bdf0a59 commit e2bdb53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/module_elecstate/elecstate_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void ElecState::print_etot(const bool converged,
{
this->f_en.etot_old = this->f_en.etot;
}
this->f_en.etot_delta = this->f_en.etot - this->f_en.etot_old;

// mohan update 2011-02-26
std::stringstream ss;
Expand Down Expand Up @@ -374,7 +375,7 @@ void ElecState::print_etot(const bool converged,
}
std::cout << std::setprecision(6);
std::cout << std::setw(15) << this->f_en.etot * ModuleBase::Ry_to_eV;
std::cout << std::setw(15) << (this->f_en.etot - this->f_en.etot_old) * ModuleBase::Ry_to_eV;
std::cout << std::setw(15) << this->f_en.etot_delta * ModuleBase::Ry_to_eV;
std::cout << std::setprecision(3);
std::cout << std::setw(11) << scf_thr;
if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5)
Expand Down
1 change: 1 addition & 0 deletions source/module_elecstate/fp_energy.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct fenergy
{
double etot = 0.0; ///< the total free energy
double etot_old = 0.0; ///< old total free energy
double etot_delta = 0.0; // the difference of total energy between two steps = etot - etot_old

double eband = 0.0; ///< the band energy
double deband = 0.0; ///< correction for variational energy
Expand Down
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ namespace ModuleESolver
Json::add_output_scf_mag(
GlobalC::ucell.magnet.tot_magnetization, GlobalC::ucell.magnet.abs_magnetization,
this->pelec->f_en.etot * ModuleBase::Ry_to_eV,
(this->pelec->f_en.etot - this->pelec->f_en.etot_old) * ModuleBase::Ry_to_eV,
this->pelec->f_en.etot_delta * ModuleBase::Ry_to_eV,
drho,
duration
);
Expand Down

0 comments on commit e2bdb53

Please sign in to comment.