|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
The First-Principles (FP) Energy Solver Class. More...
Classes | |
| class | ESolver |
| class | ESolver_DM2rho |
| class | ESolver_DoubleXC |
| class | ESolver_DP |
| class | ESolver_FP |
| class | ESolver_GetS |
| class | ESolver_KS |
| class | ESolver_KS_LCAO |
| class | ESolver_KS_LCAO_TDDFT |
| class | ESolver_KS_LIP |
| class | ESolver_KS_PW |
| class | ESolver_LJ |
| class | ESolver_NEP |
| class | ESolver_OF |
| class | ESolver_OF_TDDFT |
| class | ESolver_SDFT_PW |
Functions | |
| std::string | determine_type () |
| A subrutine called in init_esolver() This function returns type of ESolver Based on PARAM.inp.basis_type and PARAM.inp.esolver_type. | |
| ESolver * | init_esolver (const Input_para &inp, UnitCell &ucell) |
| Determine and initialize an ESolver based on input information. | |
| template<typename TK > | |
| void | init_dftu_lcao (const int istep, const int iter, const Input_para &inp, void *dftu, void *dm, const UnitCell &ucell, double **rho, const int nrxx) |
| Initialize DFT+U for LCAO method in iter_init. | |
| template<typename TK > | |
| void | finish_dftu_lcao (const int iter, const bool conv_esolver, const Input_para &inp, void *dftu, const UnitCell &ucell, const std::vector< std::vector< TK > > &dm_vec, const K_Vectors &kv, const double mixing_beta, void *hamilt_lcao) |
| Finish DFT+U calculation for LCAO method in iter_finish. | |
| template void | init_dftu_lcao< double > (const int istep, const int iter, const Input_para &inp, void *dftu, void *dm, const UnitCell &ucell, double **rho, const int nrxx) |
| Template instantiation. | |
| template void | init_dftu_lcao< std::complex< double > > (const int istep, const int iter, const Input_para &inp, void *dftu, void *dm, const UnitCell &ucell, double **rho, const int nrxx) |
| template void | finish_dftu_lcao< double > (const int iter, const bool conv_esolver, const Input_para &inp, void *dftu, const UnitCell &ucell, const std::vector< std::vector< double > > &dm_vec, const K_Vectors &kv, const double mixing_beta, void *hamilt_lcao) |
| template void | finish_dftu_lcao< std::complex< double > > (const int iter, const bool conv_esolver, const Input_para &inp, void *dftu, const UnitCell &ucell, const std::vector< std::vector< std::complex< double > > > &dm_vec, const K_Vectors &kv, const double mixing_beta, void *hamilt_lcao) |
| template<typename TK > | |
| void | init_deltaspin_lcao (const UnitCell &ucell, const Input_para &inp, void *pv, const K_Vectors &kv, void *p_hamilt, void *psi, void *dm, void *pelec) |
| Initialize DeltaSpin for LCAO method. | |
| template<typename TK > | |
| void | cal_mi_lcao_wrapper (const int iter, const Input_para &inp) |
| Calculate magnetic moments for DeltaSpin in LCAO method. | |
| template<typename TK > | |
| bool | run_deltaspin_lambda_loop_lcao (const int iter, const double drho, const Input_para &inp) |
| Run DeltaSpin lambda loop for LCAO method. | |
| template void | init_deltaspin_lcao< double > (const UnitCell &ucell, const Input_para &inp, void *pv, const K_Vectors &kv, void *p_hamilt, void *psi, void *dm, void *pelec) |
| Template instantiation. | |
| template void | init_deltaspin_lcao< std::complex< double > > (const UnitCell &ucell, const Input_para &inp, void *pv, const K_Vectors &kv, void *p_hamilt, void *psi, void *dm, void *pelec) |
| template void | cal_mi_lcao_wrapper< double > (const int iter, const Input_para &inp) |
| template void | cal_mi_lcao_wrapper< std::complex< double > > (const int iter, const Input_para &inp) |
| template bool | run_deltaspin_lambda_loop_lcao< double > (const int iter, const double drho, const Input_para &inp) |
| template bool | run_deltaspin_lambda_loop_lcao< std::complex< double > > (const int iter, const double drho, const Input_para &inp) |
The First-Principles (FP) Energy Solver Class.
This class represents components that needed in first-principles energy solver, such as the plane wave basis, the structure factors, and the k points.
| void ModuleESolver::cal_mi_lcao_wrapper | ( | const int | iter, |
| const Input_para & | inp | ||
| ) |
Calculate magnetic moments for DeltaSpin in LCAO method.
This function calculates the magnetic moments for each atom in the DeltaSpin method.
| iter | Current iteration number |
| inp | Input parameters |
| template void ModuleESolver::cal_mi_lcao_wrapper< double > | ( | const int | iter, |
| const Input_para & | inp | ||
| ) |
| template void ModuleESolver::cal_mi_lcao_wrapper< std::complex< double > > | ( | const int | iter, |
| const Input_para & | inp | ||
| ) |
| std::string ModuleESolver::determine_type | ( | ) |
A subrutine called in init_esolver() This function returns type of ESolver Based on PARAM.inp.basis_type and PARAM.inp.esolver_type.
| void ModuleESolver::finish_dftu_lcao | ( | const int | iter, |
| const bool | conv_esolver, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| const UnitCell & | ucell, | ||
| const std::vector< std::vector< TK > > & | dm_vec, | ||
| const K_Vectors & | kv, | ||
| const double | mixing_beta, | ||
| void * | hamilt_lcao | ||
| ) |
Finish DFT+U calculation for LCAO method in iter_finish.
This function handles the DFT+U finalization during the SCF iteration. It calculates the occupation matrix and energy correction if needed.
| iter | Current SCF iteration |
| conv_esolver | Whether ESolver has converged |
| inp | Input parameters |
| dftu | DFT+U object |
| ucell | Unit cell |
| dm_vec | Density matrix vector |
| kv | K-vectors |
| mixing_beta | Mixing beta parameter |
| hamilt_lcao | Hamiltonian LCAO object |
old DFT+U method calculates energy correction in esolver, new DFT+U method calculates energy in Hamiltonian
use the converged occupation matrix for next MD/Relax SCF calculation
| template void ModuleESolver::finish_dftu_lcao< double > | ( | const int | iter, |
| const bool | conv_esolver, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| const UnitCell & | ucell, | ||
| const std::vector< std::vector< double > > & | dm_vec, | ||
| const K_Vectors & | kv, | ||
| const double | mixing_beta, | ||
| void * | hamilt_lcao | ||
| ) |
| template void ModuleESolver::finish_dftu_lcao< std::complex< double > > | ( | const int | iter, |
| const bool | conv_esolver, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| const UnitCell & | ucell, | ||
| const std::vector< std::vector< std::complex< double > > > & | dm_vec, | ||
| const K_Vectors & | kv, | ||
| const double | mixing_beta, | ||
| void * | hamilt_lcao | ||
| ) |
| void ModuleESolver::init_deltaspin_lcao | ( | const UnitCell & | ucell, |
| const Input_para & | inp, | ||
| void * | pv, | ||
| const K_Vectors & | kv, | ||
| void * | p_hamilt, | ||
| void * | psi, | ||
| void * | dm, | ||
| void * | pelec | ||
| ) |
Initialize DeltaSpin for LCAO method.
This function initializes the DeltaSpin calculation by setting up the SpinConstrain object with input parameters.
| ucell | Unit cell |
| inp | Input parameters |
| pv | Parallel orbitals |
| kv | K-vectors |
| p_hamilt | Pointer to Hamiltonian |
| psi | Pointer to wave functions |
| dm | Density matrix |
| pelec | Pointer to electronic state |
| template void ModuleESolver::init_deltaspin_lcao< double > | ( | const UnitCell & | ucell, |
| const Input_para & | inp, | ||
| void * | pv, | ||
| const K_Vectors & | kv, | ||
| void * | p_hamilt, | ||
| void * | psi, | ||
| void * | dm, | ||
| void * | pelec | ||
| ) |
Template instantiation.
| template void ModuleESolver::init_deltaspin_lcao< std::complex< double > > | ( | const UnitCell & | ucell, |
| const Input_para & | inp, | ||
| void * | pv, | ||
| const K_Vectors & | kv, | ||
| void * | p_hamilt, | ||
| void * | psi, | ||
| void * | dm, | ||
| void * | pelec | ||
| ) |
| void ModuleESolver::init_dftu_lcao | ( | const int | istep, |
| const int | iter, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| void * | dm, | ||
| const UnitCell & | ucell, | ||
| double ** | rho, | ||
| const int | nrxx | ||
| ) |
Initialize DFT+U for LCAO method in iter_init.
This function handles the DFT+U initialization during the SCF iteration. It sets the density matrix and calculates Slater integrals if needed.
| istep | Current ionic step |
| iter | Current SCF iteration |
| inp | Input parameters |
| dftu | DFT+U object |
| dm | Density matrix |
| ucell | Unit cell |
| rho | Charge density |
| nrxx | Number of real space grid points |
Calculate U and J if Yukawa potential is used
| template void ModuleESolver::init_dftu_lcao< double > | ( | const int | istep, |
| const int | iter, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| void * | dm, | ||
| const UnitCell & | ucell, | ||
| double ** | rho, | ||
| const int | nrxx | ||
| ) |
Template instantiation.
| template void ModuleESolver::init_dftu_lcao< std::complex< double > > | ( | const int | istep, |
| const int | iter, | ||
| const Input_para & | inp, | ||
| void * | dftu, | ||
| void * | dm, | ||
| const UnitCell & | ucell, | ||
| double ** | rho, | ||
| const int | nrxx | ||
| ) |
| ESolver * ModuleESolver::init_esolver | ( | const Input_para & | inp, |
| UnitCell & | ucell | ||
| ) |
Determine and initialize an ESolver based on input information.
This function determines the type of ESolver to create based on input information and initializes the corresponding ESolver child class. It supports various ESolver types including ksdft_pw, ksdft_lcao, ksdft_lcao_tddft, sdft_pw, ofdft, lj_pot, and dp_pot.
| bool ModuleESolver::run_deltaspin_lambda_loop_lcao | ( | const int | iter, |
| const double | drho, | ||
| const Input_para & | inp | ||
| ) |
Run DeltaSpin lambda loop for LCAO method.
This function handles the lambda loop optimization for the DeltaSpin method in LCAO calculations. It determines whether to skip the Hamiltonian solve based on the convergence status of magnetic moments.
| iter | Current iteration number |
| drho | Charge density convergence criterion |
| inp | Input parameters |
optimize lambda to get target magnetic moments, but the lambda is not near target
optimize lambda to get target magnetic moments, but the lambda is not near target
| template bool ModuleESolver::run_deltaspin_lambda_loop_lcao< double > | ( | const int | iter, |
| const double | drho, | ||
| const Input_para & | inp | ||
| ) |
| template bool ModuleESolver::run_deltaspin_lambda_loop_lcao< std::complex< double > > | ( | const int | iter, |
| const double | drho, | ||
| const Input_para & | inp | ||
| ) |