ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Exx_Helper< T, Device > Struct Template Reference

#include <exx_helper.h>

Inheritance diagram for Exx_Helper< T, Device >:
Collaboration diagram for Exx_Helper< T, Device >:

Public Types

using Real = typename GetTypeReal<T>::type
using OperatorEXX = hamilt::OperatorEXXPW<T, Device>

Public Member Functions

 Exx_Helper ()=default
virtual ~Exx_Helper ()=default
void init (const UnitCell &ucell, const Input_para &inp, const ModuleBase::matrix &wg, const General_Exx_Info &exx_info) override
void before_scf (void *p_hamilt, void *psi, const Input_para &inp, const General_Exx_Info &exx_info) override
bool iter_finish (void *p_elec, Charge *p_charge, void *psi, UnitCell &ucell, const Input_para &inp, bool &conv_esolver, int iter) override
void set_firstiter (bool flag=true) override
void set_wg (const ModuleBase::matrix *wg_) override
void set_psi (void *psi_) override
void iter_inc () override
void set_op () override
bool exx_after_converge (int iter, bool ene_conv) override
 Decide whether EXX has converged and SCF should rerun.
double cal_exx_energy (void *psi_) override
bool get_op_first_iter () const override
void set_op_first_iter (bool flag) override
void set_op_exx (void *op) override
Public Member Functions inherited from Exx_HelperBase
 Exx_HelperBase ()=default
virtual ~Exx_HelperBase ()=default

Public Attributes

OperatorEXX * op_exx = nullptr

Private Attributes

bool first_iter = false
psi::Psi< T, Device > * psi = nullptr
const ModuleBase::matrix * wg = nullptr
int exx_iter = 0

Member Typedef Documentation

◆ OperatorEXX

template<typename T, typename Device>
using Exx_Helper< T, Device >::OperatorEXX = hamilt::OperatorEXXPW<T, Device>

◆ Real

template<typename T, typename Device>
using Exx_Helper< T, Device >::Real = typename GetTypeReal<T>::type

Constructor & Destructor Documentation

◆ Exx_Helper()

template<typename T, typename Device>
Exx_Helper< T, Device >::Exx_Helper ( )
default

◆ ~Exx_Helper()

template<typename T, typename Device>
virtual Exx_Helper< T, Device >::~Exx_Helper ( )
virtualdefault

Member Function Documentation

◆ before_scf()

template<typename T, typename Device>
void Exx_Helper< T, Device >::before_scf ( void * p_hamilt,
void * psi,
const Input_para & inp,
const General_Exx_Info & exx_info )
overridevirtual

Return if not a valid calculation type

Return if EXX is not enabled or not PW basis

Set EXX helper to Hamiltonian

Set psi for EXX calculation

Implements Exx_HelperBase.

Here is the call graph for this function:

◆ cal_exx_energy()

template<typename T, typename Device>
double Exx_Helper< T, Device >::cal_exx_energy ( void * psi_)
overridevirtual

Implements Exx_HelperBase.

Here is the caller graph for this function:

◆ exx_after_converge()

template<typename T, typename Device>
bool Exx_Helper< T, Device >::exx_after_converge ( int iter,
bool ene_conv )
overridevirtual

Decide whether EXX has converged and SCF should rerun.

Note
iter is taken by value: EXX no longer mutates the caller's iteration counter. SCF rerun is requested via the return value (false = not converged, rerun SCF) and the caller (ESolver_KS_PW) sets ESolver_KS::scf_rerun_ to trigger the restart at iter=1 in ESolver_KS::runner.

Implements Exx_HelperBase.

Here is the caller graph for this function:

◆ get_op_first_iter()

template<typename T, typename Device>
bool Exx_Helper< T, Device >::get_op_first_iter ( ) const
inlineoverridevirtual

Implements Exx_HelperBase.

◆ init()

template<typename T, typename Device>
void Exx_Helper< T, Device >::init ( const UnitCell & ucell,
const Input_para & inp,
const ModuleBase::matrix & wg,
const General_Exx_Info & exx_info )
overridevirtual

Implements Exx_HelperBase.

Here is the call graph for this function:

◆ iter_finish()

template<typename T, typename Device>
bool Exx_Helper< T, Device >::iter_finish ( void * p_elec,
Charge * p_charge,
void * psi,
UnitCell & ucell,
const Input_para & inp,
bool & conv_esolver,
int iter )
overridevirtual

Return if EXX is not enabled

Handle separate_loop mode

Implements Exx_HelperBase.

Here is the call graph for this function:

◆ iter_inc()

template<typename T, typename Device>
void Exx_Helper< T, Device >::iter_inc ( )
inlineoverridevirtual

Implements Exx_HelperBase.

Here is the caller graph for this function:

◆ set_firstiter()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_firstiter ( bool flag = true)
inlineoverridevirtual

Implements Exx_HelperBase.

Here is the caller graph for this function:

◆ set_op()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_op ( )
inlineoverridevirtual

Implements Exx_HelperBase.

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

◆ set_op_exx()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_op_exx ( void * op)
inlineoverridevirtual

Implements Exx_HelperBase.

◆ set_op_first_iter()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_op_first_iter ( bool flag)
inlineoverridevirtual

Implements Exx_HelperBase.

◆ set_psi()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_psi ( void * psi_)
overridevirtual

Implements Exx_HelperBase.

Here is the caller graph for this function:

◆ set_wg()

template<typename T, typename Device>
void Exx_Helper< T, Device >::set_wg ( const ModuleBase::matrix * wg_)
inlineoverridevirtual

Implements Exx_HelperBase.

Here is the caller graph for this function:

Member Data Documentation

◆ exx_iter

template<typename T, typename Device>
int Exx_Helper< T, Device >::exx_iter = 0
private

◆ first_iter

template<typename T, typename Device>
bool Exx_Helper< T, Device >::first_iter = false
private

◆ op_exx

template<typename T, typename Device>
OperatorEXX* Exx_Helper< T, Device >::op_exx = nullptr

◆ psi

template<typename T, typename Device>
psi::Psi<T, Device>* Exx_Helper< T, Device >::psi = nullptr
private

◆ wg

template<typename T, typename Device>
const ModuleBase::matrix* Exx_Helper< T, Device >::wg = nullptr
private

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