11#include " esolver_fp.h"
22
3- // #include "source_base/global_variable.h"
43#include " source_estate/cal_ux.h"
54#include " source_estate/module_charge/symmetry_rho.h"
65#include " source_estate/read_pseudo.h"
76#include " source_hamilt/module_ewald/H_Ewald_pw.h"
87#include " source_hamilt/module_vdw/vdw.h"
9- // #include "source_pw/module_pwdft/global.h"
108#include " source_io/cif_io.h"
119#include " source_io/cube_io.h" // use write_vdata_palgrid
1210#include " source_io/json_output/init_info.h"
1513#include " source_io/print_info.h"
1614#include " source_io/rhog_io.h"
1715#include " source_io/module_parameter/parameter.h"
18- // #include "source_cell/k_vector_utils.h"
1916#include " source_io/ctrl_output_fp.h"
2017
2118#include " source_pw/module_pwdft/setup_pwrho.h" // mohan 20251005
@@ -73,16 +70,16 @@ void ESolver_FP::after_scf(UnitCell& ucell, const int istep, const bool conv_eso
7370{
7471 ModuleBase::TITLE (" ESolver_FP" , " after_scf" );
7572
76- // 1) output convergence information
73+ // ! Output convergence information
7774 ModuleIO::output_convergence_after_scf (conv_esolver, this ->pelec ->f_en .etot );
7875
79- // 2) write fermi energy
76+ // ! Write Fermi energy
8077 ModuleIO::output_efermi (conv_esolver, this ->pelec ->eferm .ef );
8178
82- // 3) update delta_rho for charge extrapolation
79+ // ! Update delta_rho for charge extrapolation
8380 CE.update_delta_rho (ucell, &(this ->chr ), &(this ->sf ));
8481
85- // 4) print out charge density, potential, elf, etc.
82+ // ! print out charge density, potential, elf, etc.
8683 ModuleIO::ctrl_output_fp (ucell, this ->pelec , this ->pw_big , this ->pw_rhod ,
8784 this ->chr , this ->solvent , this ->Pgrid , istep);
8885
@@ -127,9 +124,7 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep)
127124 ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " INIT K-POINTS" );
128125 }
129126
130- // ----------------------------------------------------------
131127 // charge extrapolation
132- // ----------------------------------------------------------
133128 if (ucell.ionic_position_updated )
134129 {
135130 this ->CE .update_all_dis (ucell);
@@ -141,18 +136,14 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep)
141136 GlobalV::ofs_warning);
142137 }
143138
144- // ----------------------------------------------------------
145139 // ! calculate D2 or D3 vdW
146- // ----------------------------------------------------------
147140 auto vdw_solver = vdw::make_vdw (ucell, PARAM.inp , &(GlobalV::ofs_running));
148141 if (vdw_solver != nullptr )
149142 {
150143 this ->pelec ->f_en .evdw = vdw_solver->get_energy ();
151144 }
152145
153- // ----------------------------------------------------------
154146 // ! calculate ewald energy
155- // ----------------------------------------------------------
156147 if (!PARAM.inp .test_skip_ewald )
157148 {
158149 this ->pelec ->f_en .ewald_energy = H_Ewald_pw::compute_ewald (ucell, this ->pw_rhod , this ->sf .strucFac );
@@ -190,9 +181,7 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep)
190181 }
191182 }
192183
193- // ----------------------------------------------------------
194184 // ! output total local potential of the initial charge density
195- // ----------------------------------------------------------
196185 if (PARAM.inp .out_pot == 3 )
197186 {
198187 for (int is = 0 ; is < nspin; is++)
@@ -227,7 +216,7 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep)
227216
228217void ESolver_FP::iter_finish (UnitCell& ucell, const int istep, int & iter, bool & conv_esolver)
229218{
230- // ! output charge density
219+ // ! output charge density in G-space, or if available, kinetic energy density in G-space
231220 if (PARAM.inp .out_chg [0 ] != -1 )
232221 {
233222 if (iter % PARAM.inp .out_freq_elec == 0 || iter == PARAM.inp .scf_nmax || conv_esolver)
@@ -271,6 +260,7 @@ void ESolver_FP::iter_finish(UnitCell& ucell, const int istep, int& iter, bool&
271260
272261void ESolver_FP::after_all_runners (UnitCell& ucell)
273262{
263+ // print out the final total energy
274264 GlobalV::ofs_running << " \n --------------------------------------------" << std::endl;
275265 GlobalV::ofs_running << std::setprecision (16 );
276266 GlobalV::ofs_running << " !FINAL_ETOT_IS " << this ->pelec ->f_en .etot * ModuleBase::Ry_to_eV << " eV" << std::endl;
0 commit comments