|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <esolver_ks.h>
Public Member Functions | |
| ESolver_KS () | |
| Constructor. | |
| virtual | ~ESolver_KS () |
| Deconstructor. | |
| virtual void | before_all_runners (UnitCell &ucell, const Input_para &inp) override |
| Initialize of the first-principels energy solver. | |
| virtual void | runner (UnitCell &ucell, const int istep) override |
| run energy solver | |
| virtual void | after_all_runners (UnitCell &ucell) override |
| perform post processing calculations | |
Public Member Functions inherited from ModuleESolver::ESolver_FP | |
| ESolver_FP () | |
| virtual | ~ESolver_FP () |
Public Member Functions inherited from ModuleESolver::ESolver | |
| ESolver () | |
| virtual | ~ESolver () |
| virtual void | others (UnitCell &ucell, const int istep) |
| virtual double | cal_energy ()=0 |
| calculate total energy of a given system | |
| virtual void | cal_force (UnitCell &ucell, ModuleBase::matrix &force)=0 |
| calcualte forces for the atoms in the given cell | |
| virtual void | cal_stress (UnitCell &ucell, ModuleBase::matrix &stress)=0 |
| calcualte stress of given cell | |
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) |
| 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 | hamilt2rho_single (UnitCell &ucell, const int istep, const int iter, const double ethr) |
| void | hamilt2rho (UnitCell &ucell, const int istep, const int iter, const double ethr) |
| 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. | |
Protected Attributes | |
| hamilt::Hamilt< T, Device > * | p_hamilt = nullptr |
| Hamiltonian. | |
| 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 | |
| psi::Psi< T > * | psi = nullptr |
| Electronic wavefunctions. | |
| Plus_U | dftu |
| DFT+U method, mohan add 2025-11-07. | |
| 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 | |
| bool | scf_nmax_flag = false |
Protected Attributes inherited from ModuleESolver::ESolver_FP | |
| 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 |
| ModulePW::PW_Basis * | pw_rhod |
| ModulePW::PW_Basis_Big * | pw_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 | |
Additional Inherited Members | |
Public Attributes inherited from ModuleESolver::ESolver | |
| bool | conv_esolver = true |
| std::string | classname |
| ModuleESolver::ESolver_KS< T, Device >::ESolver_KS | ( | ) |
Constructor.
|
virtual |
Deconstructor.
|
overridevirtual |
perform post processing calculations
Reimplemented from ModuleESolver::ESolver_FP.
Reimplemented in ModuleESolver::ESolver_DM2rho< TK, TR >, ModuleESolver::ESolver_GetS, ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
overrideprotectedvirtual |
Something to do after SCF iterations when SCF is converged or comes to the max iter step.
Reimplemented from ModuleESolver::ESolver_FP.
Reimplemented in ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
overridevirtual |
Initialize of the first-principels energy solver.
1) setup "before_all_runniers" in ESolver_FP
2) setup some parameters
3) setup charge mixing
4) setup plane wave for electronic wave functions
5) read in charge density, mohan add 2025-11-28 Inititlize the charge density.
1) read pseudopotentials
2) setup pw_rho, pw_rhod, pw_big, sf, and read_pseudopotentials
3) setup structure factors
4) write geometry file
5) init charge extrapolation
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) parallel of FFT grid
10) calculate the structure factor
11) setup the xc functional
11) initialize the charge density, we need to first set xc_type,
Reimplemented from ModuleESolver::ESolver_FP.
Reimplemented in ModuleESolver::ESolver_DM2rho< TK, TR >, ModuleESolver::ESolver_DoubleXC< TK, TR >, ModuleESolver::ESolver_GetS, ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
overrideprotectedvirtual |
Something to do before SCF iterations.
Reimplemented from ModuleESolver::ESolver_FP.
Reimplemented in ModuleESolver::ESolver_DoubleXC< TK, TR >, ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
protected |
|
protectedvirtual |
Reimplemented in ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
overrideprotectedvirtual |
Something to do after hamilt2rho function in each iter loop.
Reimplemented from ModuleESolver::ESolver_FP.
Reimplemented in ModuleESolver::ESolver_DoubleXC< TK, TR >, ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >, and ModuleESolver::ESolver_SDFT_PW< T, Device >.
|
protectedvirtual |
Something to do before hamilt2rho function in each iter loop.
Reimplemented in ModuleESolver::ESolver_KS_LCAO< TK, TR >, ModuleESolver::ESolver_KS_LCAO< std::complex< double >, TR >, ModuleESolver::ESolver_KS_LIP< T >, ModuleESolver::ESolver_KS_PW< T, Device >, and ModuleESolver::ESolver_KS_PW< T, base_device::DEVICE_CPU >.
|
overridevirtual |
run energy solver
Implements ModuleESolver::ESolver.
Reimplemented in ModuleESolver::ESolver_KS_LCAO_TDDFT< TR, Device >, ModuleESolver::ESolver_DM2rho< TK, TR >, and ModuleESolver::ESolver_GetS.
|
protected |
|
protected |
DFT+U method, mohan add 2025-11-07.
|
protected |
number of electrons
|
protected |
scf energy threshold
|
protected |
|
protected |
the difference between rho_in (before HSolver) and rho_out (After HSolver)
|
protected |
the error of HSolver
|
protected |
maximum iter steps for scf
|
protected |
iter steps actually used in scf
|
protected |
Charge mixing method.
|
protected |
Hamiltonian.
|
protected |
nonlocal pseudopotentials
|
protected |
Electronic wavefunctions.
|
protected |
PW for wave functions, only used in KSDFT, not in OFDFT.
|
protected |
scf density threshold
|
protected |
|
protected |
the threshold for diagonalization