ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Attributes | List of all members
ModuleESolver::ESolver_SDFT_PW< T, Device > Class Template Reference

#include <esolver_sdft_pw.h>

Inheritance diagram for ModuleESolver::ESolver_SDFT_PW< T, Device >:
Collaboration diagram for ModuleESolver::ESolver_SDFT_PW< T, Device >:

Public Member Functions

 ESolver_SDFT_PW ()
 
 ~ESolver_SDFT_PW ()
 
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
 
- Public Member Functions inherited from ModuleESolver::ESolver_KS_PW< T, Device >
 ESolver_KS_PW ()
 
 ~ESolver_KS_PW ()
 
- Public Member Functions inherited from ModuleESolver::ESolver_KS< T, Device >
 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 ()
 Constructor.
 
virtual ~ESolver_FP ()
 Deconstructor.
 
- Public Member Functions inherited from ModuleESolver::ESolver
 ESolver ()
 
virtual ~ESolver ()
 

Public Attributes

Stochastic_WF< T, Device > stowf
 
StoChe< Real, Device > stoche
 
hamilt::HamiltSdftPW< T, Device > * p_hamilt_sto = nullptr
 
- Public Attributes inherited from ModuleESolver::ESolver_KS_PW< T, Device >
Exx_Helper< T, Device > exx_helper
 
- Public Attributes inherited from ModuleESolver::ESolver
bool conv_esolver = true
 
std::string classname
 

Protected Member Functions

virtual void before_scf (UnitCell &ucell, const int istep) override
 Something to do before SCF iterations.
 
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 after_all_runners (UnitCell &ucell) override
 perform post processing calculations
 
- Protected Member Functions inherited from ModuleESolver::ESolver_KS_PW< T, Device >
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 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
 
virtual void others (UnitCell &ucell, const int istep) override
 
virtual void allocate_hamilt (const UnitCell &ucell)
 
virtual void deallocate_hamilt ()
 
- Protected Member Functions inherited from ModuleESolver::ESolver_KS< T, Device >
void hamilt2rho (UnitCell &ucell, const int istep, const int iter, const double ethr)
 

Private Types

using Real = typename GetTypeReal< T >::type
 

Private Attributes

int nche_sto
 norder of Chebyshev
 
int method_sto
 method of SDFT
 

Additional Inherited Members

- Protected Types inherited from ModuleESolver::ESolver_KS_PW< T, Device >
using castmem_2d_d2h_op = base_device::memory::cast_memory_op< std::complex< double >, T, base_device::DEVICE_CPU, Device >
 
- Protected Attributes inherited from ModuleESolver::ESolver_KS_PW< T, Device >
psi::Psi< std::complex< double >, base_device::DEVICE_CPU > * psi = nullptr
 hide the psi in ESolver_KS for tmp use
 
psi::PSIInit< T, Device > * p_psi_init = nullptr
 
Device * ctx = {}
 
base_device::AbacusDevice_t device = {}
 
psi::Psi< T, Device > * kspw_psi = nullptr
 
psi::Psi< std::complex< double >, Device > * __kspw_psi = nullptr
 
bool already_initpsi = false
 
- Protected Attributes inherited from ModuleESolver::ESolver_KS< T, Device >
hamilt::Hamilt< T, Device > * p_hamilt = nullptr
 Hamiltonian.
 
ModulePW::PW_Basis_Kpw_wfc = nullptr
 PW for wave functions, only used in KSDFT, not in OFDFT.
 
Charge_Mixingp_chgmix = nullptr
 Charge mixing method.
 
pseudopot_cell_vnl ppcell
 nonlocal pseudopotentials
 
psi::Psi< T > * psi = nullptr
 Electronic wavefunctions.
 
std::string basisname
 
double esolver_KS_ne = 0.0
 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 = false
 iter steps actually used in scf
 
- Protected Attributes inherited from ModuleESolver::ESolver_FP
elecstate::ElecStatepelec = nullptr
 Electronic states.
 
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
 
int pw_rho_flag = false
 flag for pw_rho, 0: not initialized, 1: initialized
 
double iter_time
 the start time of scf iteration
 

Member Typedef Documentation

◆ Real

template<typename T , typename Device = base_device::DEVICE_CPU>
using ModuleESolver::ESolver_SDFT_PW< T, Device >::Real = typename GetTypeReal<T>::type
private

Constructor & Destructor Documentation

◆ ESolver_SDFT_PW()

template<typename T , typename Device >
ModuleESolver::ESolver_SDFT_PW< T, Device >::ESolver_SDFT_PW ( )

◆ ~ESolver_SDFT_PW()

template<typename T , typename Device >
ModuleESolver::ESolver_SDFT_PW< T, Device >::~ESolver_SDFT_PW ( )

Member Function Documentation

◆ after_all_runners()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::after_all_runners ( UnitCell ucell)
overrideprotectedvirtual

perform post processing calculations

1) after_all_runners in ESolver_KS

2) Compute density of states (DOS)

3) Compute LDOS

4) Calculate the spillage value, which are used to generate numerical atomic orbitals

5) Print out electronic wave functions in real space

6) Use Kubo-Greenwood method to compute conductivities

7) generate training data for ML-KEDF

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ after_scf()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::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.

5) calculate Wannier functions in pw basis

6) calculate Berry phase polarization in pw basis

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ before_all_runners()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::before_all_runners ( UnitCell ucell,
const Input_para inp 
)
overridevirtual

Initialize of the first-principels energy solver.

SDFT only supports double precision currently

set the cell volume variable in pelec

3) inititlize the charge density.

4) initialize the potential.

5) Initalize local pseudopotential

6) Initalize non-local pseudopotential

7) Allocate and initialize psi

8) setup occupations

1) initialize "before_all_runniers" in ESolver_FP


charge mixing

3) it has been established that

4) setup the charge mixing parameters

5) ESolver depends on the Symmetry module

6) Setup the k points according to symmetry.

7) print information

8) setup plane wave for electronic wave functions

9) initialize the real-space uniform grid for FFT and parallel distribution of plane waves

10) calculate the structure factor

1) read pseudopotentials

2) initialie the plane wave basis for rho

3) initialize the double grid (for uspp) if necessary

4) print some information

5) initialize the charge extrapolation method if necessary

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ before_scf()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::before_scf ( UnitCell ucell,
const int  istep 
)
overrideprotectedvirtual

Something to do before SCF iterations.

1) Call before_scf() of ESolver_KS

2) Init variables (cell changed)

3) init Hamiltonian (cell changed)

Operators in HamiltPW should be reallocated once cell changed delete Hamilt if not first scf

4) Exx calculations

5) Renew local pseudopotential

6) Symmetrize the charge density (rho)

Symmetry_rho should behind init_scf, because charge should be initialized first. liuyu comment: Symmetry_rho should be located between init_rho and v_of_rho?

7) Calculate the effective potential with rho

liuyu move here 2023-10-09 D in uspp need vloc, thus behind init_scf() calculate the effective coefficient matrix for non-local pseudopotential projectors

8) Onsite projectors

9) Spin-constrained algorithms

10) DFT+U algorithm

10) Initialize wave functions

11) Exx calculations

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ cal_energy()

template<typename T , typename Device >
double ModuleESolver::ESolver_SDFT_PW< T, Device >::cal_energy ( )
overridevirtual

calculate total energy of a given system

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

◆ cal_force()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::cal_force ( UnitCell ucell,
ModuleBase::matrix force 
)
overridevirtual

calcualte forces for the atoms in the given cell

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ cal_stress()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::cal_stress ( UnitCell ucell,
ModuleBase::matrix stress 
)
overridevirtual

calcualte stress of given cell

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ hamilt2rho_single()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::hamilt2rho_single ( UnitCell ucell,
const int  istep,
const int  iter,
const double  ethr 
)
overrideprotectedvirtual

the 5th function of ESolver_KS: hamilt2rho_single mohan add 2024-05-11

Reimplemented from ModuleESolver::ESolver_KS_PW< T, Device >.

Here is the call graph for this function:

◆ iter_finish()

template<typename T , typename Device >
void ModuleESolver::ESolver_SDFT_PW< T, Device >::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_PW< T, Device >.

Here is the call graph for this function:

Member Data Documentation

◆ method_sto

template<typename T , typename Device = base_device::DEVICE_CPU>
int ModuleESolver::ESolver_SDFT_PW< T, Device >::method_sto
private

method of SDFT

◆ nche_sto

template<typename T , typename Device = base_device::DEVICE_CPU>
int ModuleESolver::ESolver_SDFT_PW< T, Device >::nche_sto
private

norder of Chebyshev

◆ p_hamilt_sto

template<typename T , typename Device = base_device::DEVICE_CPU>
hamilt::HamiltSdftPW<T, Device>* ModuleESolver::ESolver_SDFT_PW< T, Device >::p_hamilt_sto = nullptr

◆ stoche

template<typename T , typename Device = base_device::DEVICE_CPU>
StoChe<Real, Device> ModuleESolver::ESolver_SDFT_PW< T, Device >::stoche

◆ stowf

template<typename T , typename Device = base_device::DEVICE_CPU>
Stochastic_WF<T, Device> ModuleESolver::ESolver_SDFT_PW< T, Device >::stowf

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