ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleESolver::ESolver_DFPT_PW Class Reference

#include <esolver_dfpt_pw.h>

Inheritance diagram for ModuleESolver::ESolver_DFPT_PW:
Collaboration diagram for ModuleESolver::ESolver_DFPT_PW:

Public Member Functions

 ESolver_DFPT_PW ()
 ~ESolver_DFPT_PW ()
void before_all_runners (BaseCell &basecell, const Input_para &inp) override
 Initialize of the first-principels energy solver.
void runner (BaseCell &basecell, const int istep) override
 run energy solver
void after_all_runners (BaseCell &basecell) override
 perform post processing calculations
Public Member Functions inherited from ModuleESolver::ESolver_KS_PW< std::complex< double >, base_device::DEVICE_CPU >
 ESolver_KS_PW ()
 ~ESolver_KS_PW ()
void before_all_runners (BaseCell &basecell, 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 (BaseCell &basecell, ModuleBase::matrix &force) override
 calcualte forces for the atoms in the given cell
void cal_stress (BaseCell &basecell, ModuleBase::matrix &stress) override
 calcualte stress of given cell
void after_all_runners (BaseCell &basecell) override
 perform post processing calculations
Public Member Functions inherited from ModuleESolver::ESolver_KS
 ESolver_KS ()
 Constructor.
virtual ~ESolver_KS ()
 Deconstructor.
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

void run_gs (UnitCell &ucell)
void init_dfpt (UnitCell &ucell)
void run_post_process (UnitCell &ucell)
Protected Member Functions inherited from ModuleESolver::ESolver_KS_PW< std::complex< double >, base_device::DEVICE_CPU >
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 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 (BaseCell &basecell, const int istep) override
virtual void hamilt2rho_single (UnitCell &ucell, const int istep, const int iter, const double ethr) override
virtual void allocate_hamilt (const UnitCell &ucell)
virtual void prepare_init_hamilt (const UnitCell &ucell)
 Let RT-TDDFT bind its endpoint field before wavefunction initialization uses H; ordinary DFT does nothing.
Protected Member Functions inherited from ModuleESolver::ESolver_KS
virtual int scf_iter_limit (const int istep) const
 Maximum SCF iterations for the current electronic step.
bool scf_loop (UnitCell &ucell, int istep, int iter_limit)
 Run SCF iterations without preparing or committing a physical endpoint.
void record_iteration (const UnitCell &ucell, double duration)
 Record an accepted iteration in JSON without changing its convergence status.
void write_iter_bands ()
 Write current band expectations when iterative band output is requested.
virtual DensityStage density_stage (const int istep, const int iter) const
 Identify mandatory predictor stages before mixing and convergence checks.
virtual bool defer_iter_output (const int istep) const
 Whether KS iterations defer output until the final state is accepted.
void hamilt2rho (UnitCell &ucell, const int istep, const int iter, const double ethr)
virtual std::string diag_policy (const int istep) const
 Select the diagonalization threshold and error-control policy for the current stage.
Protected Member Functions inherited from ModuleESolver::ESolver_FP
const vdw::VdwResult * get_vdw_result () const

Protected Attributes

ModuleDFPT::DFPT_PW * dfpt_ = nullptr
ModuleDFPT::XC_First_Order * xc_adapter_ = nullptr
bool gs_done_ = false
bool dfpt_wired_ = false
int nspin_ = 1
double nelec_ = 0.0
double ecutwfc_ = 0.0
bool dft_plus_u_ = false
bool domag_ = false
bool domag_z_ = false
Protected Attributes inherited from ModuleESolver::ESolver_KS_PW< std::complex< double >, base_device::DEVICE_CPU >
int istep_
Setup_Psi_pw stp
VSep * vsep_cell
Protected Attributes inherited from ModuleESolver::ESolver_KS
hamilt::HamiltBase * p_hamilt = nullptr
 Hamiltonian (base class pointer, actual type determined at runtime).
ModulePW::PW_Basis_K * pw_wfc = nullptr
 PW for wave functions, only used in KSDFT, not in OFDFT.
Charge_Mixing * p_chgmix = nullptr
 Charge mixing method.
pseudopot_cell_vnl ppcell
 nonlocal pseudopotentials
std::unique_ptr< Plus_U_Base > dftu_
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)
double ds_rms_ = -1.0
int maxniter
int niter
 maximum iter steps for scf
bool oscillate_esolver = false
 iter steps actually used in scf
bool scf_nmax_flag = false
bool scf_rerun_ = false
General_Exx_Info general_exx_info_
 General EXX info owned by ESolver, initialized from input parameters.
Protected Attributes inherited from ModuleESolver::ESolver_FP
std::unique_ptr< const vdw::VdwResult > vdw_result_
 vdW correction evaluated once for the current ionic configuration.
elecstate::ElecState * pelec = 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_Basis * pw_rho = nullptr
ModulePW::PW_Basis * pw_rhod = nullptr
ModulePW::PW_Basis_Big * pw_big = nullptr
 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
module_charge::Charge_Extra CE
 charge extrapolation method
surchem solvent
 solvent model
bool pw_rho_flag = false
 flag for pw_rho, 0: not initialized, 1: initialized
ModuleBase::TimePoint iter_time
 the start time of scf iteration
Protected Attributes inherited from ModuleESolver::ESolver
const Input_para * inp_ = nullptr
 Bound in before_all_runners; members use inp_->xxx instead of PARAM.inp.xxx.

Additional Inherited Members

Public Attributes inherited from ModuleESolver::ESolver_KS_PW< std::complex< double >, base_device::DEVICE_CPU >
Exx_HelperBase * exx_helper
Public Attributes inherited from ModuleESolver::ESolver
bool conv_esolver = true
std::string classname
Protected Types inherited from ModuleESolver::ESolver_KS
enum class  DensityStage { standard , predictor }
 Select whether the density is an endpoint predictor or an SCF iterate. More...

Constructor & Destructor Documentation

◆ ESolver_DFPT_PW()

ModuleESolver::ESolver_DFPT_PW::ESolver_DFPT_PW ( )

◆ ~ESolver_DFPT_PW()

ModuleESolver::ESolver_DFPT_PW::~ESolver_DFPT_PW ( )

Member Function Documentation

◆ after_all_runners()

void ModuleESolver::ESolver_DFPT_PW::after_all_runners ( BaseCell & cell)
overridevirtual

perform post processing calculations

Reimplemented from ModuleESolver::ESolver_KS.

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

◆ before_all_runners()

void ModuleESolver::ESolver_DFPT_PW::before_all_runners ( BaseCell & basecell,
const Input_para & inp )
overridevirtual

Initialize of the first-principels energy solver.

1) read pseudopotentials

2) setup pw_rho, pw_rhod, pw_big, sf, and read_pseudopotentials

3) setup structure factors

4) init charge extrapolation

5) 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) parallel of FFT grid

10) calculate the structure factor

11) initialize the charge density, we need to first set xc_type,

Reimplemented from ModuleESolver::ESolver_KS.

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

◆ init_dfpt()

void ModuleESolver::ESolver_DFPT_PW::init_dfpt ( UnitCell & ucell)
protected

wires DFPT_PW with the converged ground state; called after run_gs (the injected veff/XC reference data only exist once the GS SCF is done)

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

◆ run_gs()

void ModuleESolver::ESolver_DFPT_PW::run_gs ( UnitCell & ucell)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_post_process()

void ModuleESolver::ESolver_DFPT_PW::run_post_process ( UnitCell & ucell)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ runner()

void ModuleESolver::ESolver_DFPT_PW::runner ( BaseCell & cell,
const int istep )
overridevirtual

run energy solver

Reimplemented from ModuleESolver::ESolver_KS.

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

Member Data Documentation

◆ dfpt_

ModuleDFPT::DFPT_PW* ModuleESolver::ESolver_DFPT_PW::dfpt_ = nullptr
protected

first-order XC kernel adapter over elecstate::PotXC_FDM (C7), owned here so module_dfpt stays free of pot_xc_fdm.h dependencies

◆ dfpt_wired_

bool ModuleESolver::ESolver_DFPT_PW::dfpt_wired_ = false
protected

ground-state scalars captured from Input_para in before_all_runners (rule 1: passed explicitly instead of re-reading the global record in init_dfpt)

◆ dft_plus_u_

bool ModuleESolver::ESolver_DFPT_PW::dft_plus_u_ = false
protected

magnetization flags derived from (nspin, noncolin) with the exact switch of ReadInput::set_globalv; consumed by the FDM XC kernel fallback adapter (replaces the former global-record reads)

◆ domag_

bool ModuleESolver::ESolver_DFPT_PW::domag_ = false
protected

◆ domag_z_

bool ModuleESolver::ESolver_DFPT_PW::domag_z_ = false
protected

◆ ecutwfc_

double ModuleESolver::ESolver_DFPT_PW::ecutwfc_ = 0.0
protected

◆ gs_done_

bool ModuleESolver::ESolver_DFPT_PW::gs_done_ = false
protected

◆ nelec_

double ModuleESolver::ESolver_DFPT_PW::nelec_ = 0.0
protected

◆ nspin_

int ModuleESolver::ESolver_DFPT_PW::nspin_ = 1
protected

◆ xc_adapter_

ModuleDFPT::XC_First_Order* ModuleESolver::ESolver_DFPT_PW::xc_adapter_ = nullptr
protected

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