ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ModuleESolver::ESolver_KS_LCAO< TK, TR > Class Template Reference

#include <esolver_ks_lcao.h>

Inheritance diagram for ModuleESolver::ESolver_KS_LCAO< TK, TR >:
Collaboration diagram for ModuleESolver::ESolver_KS_LCAO< TK, TR >:

Public Member Functions

 ESolver_KS_LCAO ()
 
 ~ESolver_KS_LCAO ()
 
void before_all_runners (UnitCell &ucell, const Input_para &inp) override
 Initialize of the first-principels energy solver.
 
double cal_energy () override
 calculate total energy of a given system
 
void cal_force (UnitCell &ucell, ModuleBase::matrix &force) override
 calcualte forces for the atoms in the given cell
 
void cal_stress (UnitCell &ucell, ModuleBase::matrix &stress) override
 calcualte stress of given cell
 
void after_all_runners (UnitCell &ucell) override
 perform post processing calculations
 
const Record_adjget_RA () const
 
const Grid_Driverget_gd () const
 
const Parallel_Orbitalsget_pv () const
 
const std::unique_ptr< ModuleGint::GintInfo > & get_gint_info () const
 
const TwoCenterBundleget_two_center_bundle () const
 
const rdmft::RDMFT< TK, TR > & get_rdmft_solver () const
 
const LCAO_Orbitalsget_orb () const
 
const ModuleBase::matrixget_scs () const
 
const Setup_DeePKS< TK > & get_deepks () const
 
const Exx_NAO< TK > & get_exx_nao () const
 
- Public Member Functions inherited from ModuleESolver::ESolver_KS< TK >
 ESolver_KS ()
 Constructor.
 
virtual ~ESolver_KS ()
 Deconstructor.
 
virtual void runner (UnitCell &ucell, const int istep) override
 run energy solver
 
- Public Member Functions inherited from ModuleESolver::ESolver_FP
 ESolver_FP ()
 
virtual ~ESolver_FP ()
 
- Public Member Functions inherited from ModuleESolver::ESolver
 ESolver ()
 
virtual ~ESolver ()
 

Protected Member Functions

virtual void before_scf (UnitCell &ucell, const int istep) override
 Something to do before SCF iterations.
 
virtual void iter_init (UnitCell &ucell, const int istep, const int iter) override
 Something to do before hamilt2rho function in each iter loop.
 
virtual void hamilt2rho_single (UnitCell &ucell, const int istep, const int iter, const double ethr) override
 
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.
 
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.
 
virtual void others (UnitCell &ucell, const int istep) override
 
- Protected Member Functions inherited from ModuleESolver::ESolver_KS< TK >
void hamilt2rho (UnitCell &ucell, const int istep, const int iter, const double ethr)
 

Protected Attributes

Record_adj RA
 Store information about Adjacent Atoms.
 
Grid_Driver gd
 Store information about Adjacent Atoms.
 
Parallel_Orbitals pv
 NAO orbitals: 2d block-cyclic distribution info.
 
std::unique_ptr< ModuleGint::GintInfogint_info_
 GintInfo: used to store some basic infomation about module_gint.
 
TwoCenterBundle two_center_bundle_
 NAO orbitals: two-center integrations.
 
LCAO_domain::Setup_DM< TK > dmat
 Add density matrix class, mohan add 2025-10-30.
 
rdmft::RDMFT< TK, TR > rdmft_solver
 For RDMFT calculations, added by jghan, 2024-03-16.
 
LCAO_Orbitals orb_
 NAO: store related information.
 
ModuleBase::matrix scs
 
bool have_force = false
 
Setup_DeePKS< TK > deepks
 
Exx_NAO< TK > exx_nao
 
- Protected Attributes inherited from ModuleESolver::ESolver_KS< TK >
hamilt::Hamilt< TK, base_device::DEVICE_CPU > * p_hamilt
 Hamiltonian.
 
ModulePW::PW_Basis_Kpw_wfc
 PW for wave functions, only used in KSDFT, not in OFDFT.
 
Charge_Mixingp_chgmix
 Charge mixing method.
 
pseudopot_cell_vnl ppcell
 nonlocal pseudopotentials
 
psi::Psi< TK > * psi
 Electronic wavefunctions.
 
std::string basisname
 
double esolver_KS_ne
 esolver_ks_lcao.cpp
 
double diag_ethr
 number of electrons
 
double scf_thr
 the threshold for diagonalization
 
double scf_ene_thr
 scf density threshold
 
double drho
 scf energy threshold
 
double hsolver_error
 the difference between rho_in (before HSolver) and rho_out (After HSolver)
 
int maxniter
 the error of HSolver
 
int niter
 maximum iter steps for scf
 
bool oscillate_esolver
 iter steps actually used in scf
 
bool scf_nmax_flag
 
- Protected Attributes inherited from ModuleESolver::ESolver_FP
elecstate::ElecStatepelec = nullptr
 These pointers will be deleted in the free_pointers() function every ion step.
 
K_Vectors kv
 K points in Brillouin zone.
 
Charge chr
 Electorn charge density.
 
ModulePW::PW_Basispw_rho
 
ModulePW::PW_Basispw_rhod
 
ModulePW::PW_Basis_Bigpw_big
 dense grid for USPP
 
Parallel_Grid Pgrid
 parallel for rho grid
 
Structure_Factor sf
 Structure factors that used with plane-wave basis set.
 
pseudopot_cell_vl locpp
 local pseudopotentials
 
Charge_Extra CE
 charge extrapolation method
 
surchem solvent
 solvent model
 
bool pw_rho_flag = false
 flag for pw_rho, 0: not initialized, 1: initialized
 
double iter_time
 the start time of scf iteration
 

Friends

class LR::ESolver_LR< double, double >
 
class LR::ESolver_LR< std::complex< double >, double >
 

Additional Inherited Members

- Public Attributes inherited from ModuleESolver::ESolver
bool conv_esolver = true
 
std::string classname
 

Constructor & Destructor Documentation

◆ ESolver_KS_LCAO()

template<typename TK , typename TR >
ModuleESolver::ESolver_KS_LCAO< TK, TR >::ESolver_KS_LCAO ( )

◆ ~ESolver_KS_LCAO()

template<typename TK , typename TR >
ModuleESolver::ESolver_KS_LCAO< TK, TR >::~ESolver_KS_LCAO ( )

Member Function Documentation

◆ after_all_runners()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::after_all_runners ( UnitCell ucell)
overridevirtual

perform post processing calculations

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ after_scf()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::after_scf ( UnitCell ucell,
const int  istep,
const bool  conv_esolver 
)
overrideprotectedvirtual

Something to do after SCF iterations when SCF is converged or comes to the max iter step.

1) call after_scf() of ESolver_KS

2) output of lcao every few ionic steps

3) Clean up RA, which is used to serach for adjacent atoms

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Reimplemented in ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >.

Here is the call graph for this function:

◆ before_all_runners()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::before_all_runners ( UnitCell ucell,
const Input_para inp 
)
overridevirtual

Initialize of the first-principels energy solver.

read psi from file

1) setup "before_all_runniers" in ESolver_FP

2) setup some parameters

3) setup charge mixing

4) setup Exc for the first element '0' (all elements have same exc)

5) setup the charge mixing parameters

6) symmetry analysis should be performed every time the cell is changed

7) setup k points in the Brillouin zone according to symmetry.

8) print information

9) setup plane wave for electronic wave functions

10) parallel of FFT grid

11) calculate the structure factor

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Reimplemented in ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >.

Here is the caller graph for this function:

◆ before_scf()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::before_scf ( UnitCell ucell,
const int  istep 
)
overrideprotectedvirtual

Something to do before SCF iterations.

1) call before_scf() of ESolver_KS.

2) find search radius

3) use search_radius to search adj atoms

4) initialize NAO basis set

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Reimplemented in ModuleESolver::ESolver_DoubleXC< TK, TR >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_energy()

template<typename TK , typename TR >
double ModuleESolver::ESolver_KS_LCAO< TK, TR >::cal_energy ( )
overridevirtual

calculate total energy of a given system

Implements ModuleESolver::ESolver.

◆ cal_force()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::cal_force ( UnitCell ucell,
ModuleBase::matrix force 
)
overridevirtual

calcualte forces for the atoms in the given cell

Implements ModuleESolver::ESolver.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_stress()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::cal_stress ( UnitCell ucell,
ModuleBase::matrix stress 
)
overridevirtual

calcualte stress of given cell

Implements ModuleESolver::ESolver.

Here is the call graph for this function:

◆ get_deepks()

template<typename TK , typename TR >
const Setup_DeePKS< TK > & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_deepks ( ) const
inline

◆ get_exx_nao()

template<typename TK , typename TR >
const Exx_NAO< TK > & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_exx_nao ( ) const
inline

◆ get_gd()

template<typename TK , typename TR >
const Grid_Driver & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_gd ( ) const
inline

◆ get_gint_info()

template<typename TK , typename TR >
const std::unique_ptr< ModuleGint::GintInfo > & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_gint_info ( ) const
inline

◆ get_orb()

template<typename TK , typename TR >
const LCAO_Orbitals & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_orb ( ) const
inline

◆ get_pv()

template<typename TK , typename TR >
const Parallel_Orbitals & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_pv ( ) const
inline

◆ get_RA()

template<typename TK , typename TR >
const Record_adj & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_RA ( ) const
inline

◆ get_rdmft_solver()

template<typename TK , typename TR >
const rdmft::RDMFT< TK, TR > & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_rdmft_solver ( ) const
inline

◆ get_scs()

template<typename TK , typename TR >
const ModuleBase::matrix & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_scs ( ) const
inline

◆ get_two_center_bundle()

template<typename TK , typename TR >
const TwoCenterBundle & ModuleESolver::ESolver_KS_LCAO< TK, TR >::get_two_center_bundle ( ) const
inline

◆ hamilt2rho_single()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::hamilt2rho_single ( UnitCell ucell,
const int  istep,
const int  iter,
const double  ethr 
)
overrideprotectedvirtual

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Reimplemented in ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >.

Here is the call graph for this function:

◆ iter_finish()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::iter_finish ( UnitCell ucell,
const int  istep,
int &  iter,
bool &  conv_esolver 
)
overrideprotectedvirtual

Something to do after hamilt2rho function in each iter loop.

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Reimplemented in ModuleESolver::ESolver_DoubleXC< TK, TR >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iter_init()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::iter_init ( UnitCell ucell,
const int  istep,
const int  iter 
)
overrideprotectedvirtual

Something to do before hamilt2rho function in each iter loop.

Reimplemented from ModuleESolver::ESolver_KS< TK >.

Here is the call graph for this function:

◆ others()

template<typename TK , typename TR >
void ModuleESolver::ESolver_KS_LCAO< TK, TR >::others ( UnitCell ucell,
const int  istep 
)
overrideprotectedvirtual

deal with exx and other calculation than scf/md/relax/cell-relax: such as nscf, get_wf and get_pchg

Reimplemented from ModuleESolver::ESolver.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ LR::ESolver_LR< double, double >

template<typename TK , typename TR >
friend class LR::ESolver_LR< double, double >
friend

◆ LR::ESolver_LR< std::complex< double >, double >

template<typename TK , typename TR >
friend class LR::ESolver_LR< std::complex< double >, double >
friend

Member Data Documentation

◆ deepks

template<typename TK , typename TR >
Setup_DeePKS<TK> ModuleESolver::ESolver_KS_LCAO< TK, TR >::deepks
protected

◆ dmat

template<typename TK , typename TR >
LCAO_domain::Setup_DM<TK> ModuleESolver::ESolver_KS_LCAO< TK, TR >::dmat
protected

Add density matrix class, mohan add 2025-10-30.

◆ exx_nao

template<typename TK , typename TR >
Exx_NAO<TK> ModuleESolver::ESolver_KS_LCAO< TK, TR >::exx_nao
protected

◆ gd

template<typename TK , typename TR >
Grid_Driver ModuleESolver::ESolver_KS_LCAO< TK, TR >::gd
protected

Store information about Adjacent Atoms.

◆ gint_info_

template<typename TK , typename TR >
std::unique_ptr<ModuleGint::GintInfo> ModuleESolver::ESolver_KS_LCAO< TK, TR >::gint_info_
protected

GintInfo: used to store some basic infomation about module_gint.

◆ have_force

template<typename TK , typename TR >
bool ModuleESolver::ESolver_KS_LCAO< TK, TR >::have_force = false
protected

◆ orb_

template<typename TK , typename TR >
LCAO_Orbitals ModuleESolver::ESolver_KS_LCAO< TK, TR >::orb_
protected

NAO: store related information.

◆ pv

template<typename TK , typename TR >
Parallel_Orbitals ModuleESolver::ESolver_KS_LCAO< TK, TR >::pv
protected

NAO orbitals: 2d block-cyclic distribution info.

◆ RA

template<typename TK , typename TR >
Record_adj ModuleESolver::ESolver_KS_LCAO< TK, TR >::RA
protected

Store information about Adjacent Atoms.

◆ rdmft_solver

template<typename TK , typename TR >
rdmft::RDMFT<TK, TR> ModuleESolver::ESolver_KS_LCAO< TK, TR >::rdmft_solver
protected

For RDMFT calculations, added by jghan, 2024-03-16.

◆ scs

template<typename TK , typename TR >
ModuleBase::matrix ModuleESolver::ESolver_KS_LCAO< TK, TR >::scs
protected

◆ two_center_bundle_

template<typename TK , typename TR >
TwoCenterBundle ModuleESolver::ESolver_KS_LCAO< TK, TR >::two_center_bundle_
protected

NAO orbitals: two-center integrations.


The documentation for this class was generated from the following files: