|
1 | 1 | #include "esolver_ks_lcao_tddft.h" |
2 | 2 |
|
3 | 3 | //----------------IO----------------- |
4 | | -#include "source_io/module_ctrl/ctrl_output_td.h" |
5 | 4 | #include "source_io/dipole_io.h" |
| 5 | +#include "source_io/module_ctrl/ctrl_output_td.h" |
| 6 | +#include "source_io/module_current/td_current_io.h" |
6 | 7 | #include "source_io/module_output/output_log.h" |
7 | 8 | #include "source_io/module_wf/read_wfc_nao.h" |
8 | | -#include "source_io/module_current/td_current_io.h" |
9 | 9 | //------LCAO HSolver ElecState------- |
10 | 10 | #include "source_estate/elecstate_tools.h" |
11 | 11 | #include "source_estate/module_charge/symmetry_rho.h" |
@@ -203,7 +203,7 @@ void ESolver_KS_LCAO_TDDFT<TR, Device>::runner(UnitCell& ucell, const int istep) |
203 | 203 | } |
204 | 204 | } |
205 | 205 |
|
206 | | - if(PARAM.inp.td_stype != 1 && TD_info::out_current == 1) |
| 206 | + if (PARAM.inp.td_stype != 1 && TD_info::out_current == 1) |
207 | 207 | { |
208 | 208 | delete velocity_mat; |
209 | 209 | } |
@@ -336,7 +336,9 @@ void ESolver_KS_LCAO_TDDFT<TR, Device>::iter_finish(UnitCell& ucell, |
336 | 336 | ESolver_KS_LCAO<std::complex<double>, TR>::iter_finish(ucell, istep, iter, conv_esolver); |
337 | 337 |
|
338 | 338 | // Store wave function, Hamiltonian and Overlap matrix, to be used in next time step |
339 | | - this->store_h_s_psi(ucell, istep, iter, conv_esolver); |
| 339 | + // Store when converged or reach max iteration |
| 340 | + bool force_save = conv_esolver || (iter == this->maxniter); |
| 341 | + this->store_h_s_psi(ucell, istep, iter, force_save); |
340 | 342 |
|
341 | 343 | // Calculate energy-density matrix for RT-TDDFT |
342 | 344 | if (conv_esolver && estep == estep_max - 1 && istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) |
@@ -496,8 +498,7 @@ void ESolver_KS_LCAO_TDDFT<TR, Device>::after_scf(UnitCell& ucell, const int ist |
496 | 498 | hamilt_lcao, |
497 | 499 | this->RA, |
498 | 500 | this->td_p, |
499 | | - this->exx_nao |
500 | | - ); |
| 501 | + this->exx_nao); |
501 | 502 |
|
502 | 503 | ModuleBase::timer::tick(this->classname, "after_scf"); |
503 | 504 | } |
|
0 commit comments