ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_ks_lcao.h
Go to the documentation of this file.
1#ifndef ESOLVER_KS_LCAO_H
2#define ESOLVER_KS_LCAO_H
3
4#include "esolver_ks.h"
5
6// for adjacent atoms
8
9// for NAO basis
11
12// for grid integration
17
18// for DeePKS
19#ifdef __MLALGO
21#endif
22
23// for EXX
24#ifdef __EXX
27#endif
28
29// for RDMFT
31
32#include <memory>
33
34
35// for Linear Response
36namespace LR
37{
38template <typename T, typename TR>
39class ESolver_LR;
40}
41
42//-----------------------------------
43// ESolver for LCAO
44//-----------------------------------
45namespace ModuleESolver
46{
47
48template <typename TK, typename TR>
49class ESolver_KS_LCAO : public ESolver_KS<TK>
50{
51 public:
54
55 void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
56
57 double cal_energy() override;
58
59 void cal_force(UnitCell& ucell, ModuleBase::matrix& force) override;
60
61 void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) override;
62
63 void after_all_runners(UnitCell& ucell) override;
64
65 protected:
66 virtual void before_scf(UnitCell& ucell, const int istep) override;
67
68 virtual void iter_init(UnitCell& ucell, const int istep, const int iter) override;
69
70 virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override;
71
72 virtual void update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) override;
73
74 virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override;
75
76 virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override;
77
78 virtual void others(UnitCell& ucell, const int istep) override;
79
82
85
88
91
94
97
98#ifndef __OLD_GINT
100 std::unique_ptr<ModuleGint::GintInfo> gint_info_;
101#endif
102
105
108
111
112 // Temporarily store the stress to unify the interface with PW,
113 // because it's hard to seperate force and stress calculation in LCAO.
115 bool have_force = false;
116
117#ifdef __MLALGO
119#endif
120
121#ifdef __EXX
122 std::shared_ptr<Exx_LRI_Interface<TK, double>> exd = nullptr;
123 std::shared_ptr<Exx_LRI_Interface<TK, std::complex<double>>> exc = nullptr;
124#endif
125
126 friend class LR::ESolver_LR<double, double>;
127 friend class LR::ESolver_LR<std::complex<double>, double>;
128};
129} // namespace ModuleESolver
130#endif
Definition gint_gamma.h:23
Definition gint_k.h:13
Definition sltk_grid_driver.h:43
Definition grid_technique.h:18
Definition LCAO_deepks.h:52
Definition ORB_read.h:19
Excited State Solver: Linear Response TDDFT (Tamm Dancoff Approximation)
Definition esolver_lrtd_lcao.h:30
Definition matrix.h:19
Definition esolver_ks_lcao.h:50
virtual void update_pot(UnitCell &ucell, const int istep, const int iter, const bool conv_esolver) override
<Temporary> It should be replaced by a function in Hamilt Class
Definition esolver_ks_lcao.cpp:771
Grid_Driver gd
Store information about Adjacent Atoms.
Definition esolver_ks_lcao.h:84
virtual void iter_finish(UnitCell &ucell, const int istep, int &iter, bool &conv_esolver) override
Something to do after hamilt2rho function in each iter loop.
Definition esolver_ks_lcao.cpp:788
void cal_stress(UnitCell &ucell, ModuleBase::matrix &stress) override
Definition esolver_ks_lcao.cpp:384
virtual void others(UnitCell &ucell, const int istep) override
Definition lcao_others.cpp:42
TwoCenterBundle two_center_bundle_
NAO orbitals: two-center integrations.
Definition esolver_ks_lcao.h:104
LCAO_Orbitals orb_
NAO: store related information.
Definition esolver_ks_lcao.h:110
void cal_force(UnitCell &ucell, ModuleBase::matrix &force) override
calcualte forces for the atoms in the given cell
Definition esolver_ks_lcao.cpp:335
ModuleBase::matrix scs
Definition esolver_ks_lcao.h:114
virtual void before_scf(UnitCell &ucell, const int istep) override
Something to do before SCF iterations.
Definition lcao_before_scf.cpp:39
ESolver_KS_LCAO()
Definition esolver_ks_lcao.cpp:76
~ESolver_KS_LCAO()
Definition esolver_ks_lcao.cpp:99
rdmft::RDMFT< TK, TR > rdmft_solver
For RDMFT calculations, added by jghan, 2024-03-16.
Definition esolver_ks_lcao.h:107
Grid_Technique GridT
Grid integration: used to store some basic information.
Definition esolver_ks_lcao.h:96
bool have_force
Definition esolver_ks_lcao.h:115
std::unique_ptr< ModuleGint::GintInfo > gint_info_
GintInfo: used to store some basic infomation about module_gint.
Definition esolver_ks_lcao.h:100
Record_adj RA
Store information about Adjacent Atoms.
Definition esolver_ks_lcao.h:81
Parallel_Orbitals pv
NAO orbitals: 2d block-cyclic distribution info.
Definition esolver_ks_lcao.h:87
Gint_k GK
Grid integration: used for k-point-dependent algorithm.
Definition esolver_ks_lcao.h:90
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Something to do after SCF iterations when SCF is converged or comes to the max iter step.
Definition lcao_after_scf.cpp:8
LCAO_Deepks< TK > ld
Definition esolver_ks_lcao.h:118
void after_all_runners(UnitCell &ucell) override
perform post processing calculations
Definition esolver_ks_lcao.cpp:405
double cal_energy() override
calculate total energy of a given system
Definition esolver_ks_lcao.cpp:327
void before_all_runners(UnitCell &ucell, const Input_para &inp) override
Initialize of the first-principels energy solver.
Definition esolver_ks_lcao.cpp:104
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Definition esolver_ks_lcao.cpp:708
Gint_Gamma GG
Grid integration: used for gamma only algorithms.
Definition esolver_ks_lcao.h:93
virtual void iter_init(UnitCell &ucell, const int istep, const int iter) override
Something to do before hamilt2rho function in each iter loop.
Definition esolver_ks_lcao.cpp:516
Definition esolver_ks.h:25
bool conv_esolver
Definition esolver.h:44
Definition parallel_orbitals.h:9
Definition record_adj.h:11
Definition two_center_bundle.h:11
Definition unitcell.h:16
Definition rdmft.h:43
std::complex< double > complex
Definition diago_cusolver.cpp:13
Definition esolver_ks_lcao.h:37
plane wave basis
Definition opt_test_tools.cpp:93
Definition input_parameter.h:12