1#ifndef ESOLVER_KS_LCAO_H
2#define ESOLVER_KS_LCAO_H
27template <
typename T,
typename TR>
31template <
typename TK,
typename TR>
80 virtual void iter_init(
UnitCell &ucell,
const int istep,
const int iter)
override;
87 const double ethr)
override;
100 virtual void others(
BaseCell &basecell,
const int istep)
override;
Canonical atom-major flattening of the LCAO basis hierarchy.
Definition basis_flattened_indexing.h:40
Definition setup_exx.h:21
Definition gint_prec_ctrl.h:9
Grid_Driver class for neighbor search interface.
Definition sltk_grid_driver.h:63
Grid_Driver gd
Search for adjacent atoms and provide their positions and cell indices.
Definition esolver_ks_lcao.h:109
virtual void iter_finish(UnitCell &ucell, const int istep, int &iter, bool &conv_esolver) override
Finish an SCF iteration with energy corrections, mixing, convergence checks, and output.
Definition esolver_ks_lcao.cpp:579
TwoCenterBundle two_center_bundle_
NAO orbitals: two-center integrations.
Definition esolver_ks_lcao.h:124
LCAO_Orbitals orb_
Store NAO orbitals and their radial tables.
Definition esolver_ks_lcao.h:121
void cal_force(BaseCell &basecell, ModuleBase::matrix &force) override
Calculate the requested forces and stress, caching the stress for cal_stress().
Definition esolver_ks_lcao.cpp:303
ModuleBase::matrix scs
Cache the stress computed by cal_force() for the separate cal_stress() interface.
Definition esolver_ks_lcao.h:147
virtual TD_info * get_td_info() const
Optional solver-owned RT state passed to LCAO consumers.
Definition esolver_ks_lcao.h:57
module_dm::Setup_DM< TK > dmat
Own the density matrix, mohan add 2025-10-30.
Definition esolver_ks_lcao.h:127
virtual void before_scf(UnitCell &ucell, const int istep) override
Prepare an ionic step using istep for both initialization and initial-state output.
Definition esolver_ks_lcao.cpp:163
void cal_stress(BaseCell &basecell, ModuleBase::matrix &stress) override
Return the cached stress, calling cal_force() first when needed.
Definition esolver_ks_lcao.cpp:335
void before_all_runners(BaseCell &basecell, const Input_para &inp) override
Initialize the LCAO basis, electronic state, and potentials before all steps.
Definition esolver_ks_lcao.cpp:87
int istep_
Definition esolver_ks_lcao.h:68
bool final_electronic_step_
Whether the current after_scf() call ends the final electronic step of the run.
Definition esolver_ks_lcao.h:77
ESolver_KS_LCAO()
Initialize the solver identity and DFT+U storage.
Definition esolver_ks_lcao.cpp:72
GintPrecisionController gint_precision_controller_
Control grid-integration precision and its switching during SCF iterations.
Definition esolver_ks_lcao.h:152
Setup_DeePKS< TK > deepks
For DeePKS calculations, mohan add 2025-10-08.
Definition esolver_ks_lcao.h:130
~ESolver_KS_LCAO()
Release the electronic wave functions.
Definition esolver_ks_lcao.cpp:80
rdmft::RDMFT< TK, TR > rdmft_solver
For RDMFT calculations, added by jghan, 2024-03-16.
Definition esolver_ks_lcao.h:139
Exx_Info exx_info_
Full EXX info for LCAO (includes info_ri, info_opt_abfs, info_lip).
Definition esolver_ks_lcao.h:133
bool have_force
Track whether cal_force() has run since the last cal_stress() call.
Definition esolver_ks_lcao.h:149
std::unique_ptr< ModuleGint::GintInfo > gint_info_
GintInfo: used to store basic grid-integration information for module_gint.
Definition esolver_ks_lcao.h:118
Record_adj RA
Store information about adjacent atoms for the distributed matrix layout.
Definition esolver_ks_lcao.h:106
std::unique_ptr< BasisFlattenedIndexing > basis_index_
Canonical global ordering and atom slices of the LCAO basis.
Definition esolver_ks_lcao.h:115
Parallel_Orbitals pv
NAO orbitals: 2D block-cyclic distribution info.
Definition esolver_ks_lcao.h:112
Exx_NAO< TK > exx_nao
For exact-exchange calculations, mohan add 2025-10-08.
Definition esolver_ks_lcao.h:136
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Write the SCF results and release adjacency records when forces and stress are not requested.
Definition esolver_ks_lcao.cpp:688
void after_all_runners(BaseCell &basecell) override
Perform final LCAO output and postprocessing after all steps.
Definition esolver_ks_lcao.cpp:357
virtual void others(BaseCell &basecell, const int istep) override
Run specialized LCAO calculations outside the standard SCF workflow.
Definition lcao_others.cpp:34
double cal_energy() override
Return the electronic total energy in Ry.
Definition esolver_ks_lcao.cpp:297
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Solve the Hamiltonian and update the charge density and energy terms.
Definition esolver_ks_lcao.cpp:484
virtual void iter_init(UnitCell &ucell, const int istep, const int iter) override
Prepare charge mixing and Hamiltonian updates for an SCF iteration.
Definition esolver_ks_lcao.cpp:382
ESolver_KS()
Constructor.
Definition esolver_ks.cpp:29
Forward declaration for the linear-response solver.
Definition esolver_lr_lcao_tddft.h:44
bool conv_esolver
Definition esolver.h:46
Definition parallel_orbitals.h:16
Definition record_adj.h:15
Definition setup_deepks.h:23
Definition two_center_bundle.h:11
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition dm_holder.h:10
#define complex
Definition elpa_new.h:28
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
Definition diag_lcao.h:14