|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <exx_lri_interface.h>
Classes | |
| struct | Flag_Finish |
Public Types | |
| using | TA = int |
| using | TC = std::array<int, 3> |
| using | TAC = std::pair<TA, TC> |
Public Member Functions | |
| Exx_LRI_Interface (const Exx_Info_RI &info_ri, const Exx_Info_Global &info_global) | |
| Constructor for Exx_LRI_Interface. | |
| Exx_LRI_Interface ()=delete | |
| void | set_gpu (const bool use_gpu) |
| std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > & | get_Hexxs () const |
| double & | get_Eexx () const |
| ModuleBase::matrix & | get_force () const |
| ModuleBase::matrix & | get_stress () const |
| int | get_two_level_step () const |
| void | init (const MPI_Comm &mpi_comm, const UnitCell &ucell, const K_Vectors &kv, const LCAO_Orbitals &orb, const bool use_gpu) |
| in init: Exx_LRI::init() | |
| void | cal_exx_ions (const UnitCell &ucell, const bool write_cv=false) |
| : in cal_exx_ions: Exx_LRI::cal_exx_ions() | |
| void | cal_exx_elec (const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Ds, const UnitCell &ucell, const Parallel_Orbitals &pv, const ModuleSymmetry::Symmetry_rotation *p_symrot=nullptr) |
| : in cal_exx_elec: Exx_LRI::cal_exx_elec() | |
| void | cal_exx_force (const int &nat) |
| : in cal_exx_force: Exx_LRI::cal_exx_force() | |
| void | cal_exx_stress (const double &omega, const double &lat0) |
| : in cal_exx_stress: Exx_LRI::cal_exx_stress() | |
| void | exx_before_all_runners (const K_Vectors &kv, const UnitCell &ucell, const Parallel_Blkcyclic &pv) |
| Initialize EXX symmetry before the first ionic step. | |
| void | refresh_symmetry (const K_Vectors &kv, const UnitCell &ucell, const Parallel_Blkcyclic &pv) |
| Discard old atom mappings, lattice returns and rotation caches before rebuilding. | |
| void | exx_beforescf (const int istep, const K_Vectors &kv, const Charge_Mixing &chgmix, const UnitCell &ucell, const LCAO_Orbitals &orb, const Parallel_Blkcyclic &pv, const bool update_symmetry, const bool use_gpu) |
| in beforescf: set xc type, opt_orb, do DM mixing | |
| void | exx_eachiterinit (const int istep, const UnitCell &ucell, const module_dm::DensityMatrix< T, double > &dm, const K_Vectors &kv, const Parallel_Orbitals &pv, const int &iter, const elecstate::ElecState &elec) |
| in eachiterinit: do DM mixing and calculate Hexx when entering 2nd SCF | |
| void | exx_hamilt2rho (elecstate::ElecState &elec, const Parallel_Orbitals &pv, const int iter) |
| in hamilt2rho: calculate Hexx and Eexx | |
| void | exx_iter_finish (const K_Vectors &kv, const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, elecstate::ElecState &elec, module_dm::DensityMatrix< T, double > *dm, const Parallel_Orbitals &pv, Charge_Mixing &chgmix, const double &scf_ene_thr, int &iter, const int istep, bool &conv_esolver) |
| in iter_finish: write Hexx, do something according to whether SCF is converged | |
| bool | exx_after_converge (const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, const module_dm::DensityMatrix< T, double > &dm, const K_Vectors &kv, const Parallel_Orbitals &pv, const int &nspin, int &iter, const int &istep, const double &etot, const double &scf_ene_thr, const elecstate::TDFieldManager *field) |
| : in do_after_converge: add exx operators; do DM mixing if seperate loop | |
| size_t | hybrid_step () const |
| void | set_hybrid_step (size_t s) |
Public Attributes | |
| int | two_level_step = 0 |
| the step of the outer loop. nullptr: no dependence on the number of two_level_step, contributeHk will do enerything normally. 0: the first outer loop. If restart, contributeHk will directly add Hexx to Hloc. else, do nothing. >0: not the first outer loop. contributeHk will do enerything normally. | |
| double | etot_last_outer_loop = 0.0 |
| module_dm::DensityMatrix< T, double > * | dm_last_step |
| std::shared_ptr< Exx_LRI< Tdata > > | exx_ptr |
Private Member Functions | |
| std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > | prepare_exx_density (const std::vector< std::vector< T > > &dmk, const UnitCell &ucell, const K_Vectors &kv, const Parallel_Orbitals &pv, const int nspin, const bool restart, const ModuleBase::Vector3< double > *source_A) |
| void | mix_common_density (RI_2D_Comm::HybridGaugeComplexDensity &density, const UnitCell &ucell, const ModuleBase::Vector3< double > &source_A, const bool restart) |
| void | mix_common_density (std::vector< std::map< TA, std::map< TAC, RI::Tensor< double > > > > &density, const UnitCell &ucell, const ModuleBase::Vector3< double > &source_A, const bool restart) |
Private Attributes | |
| Mix_DMk_2D< T > | mix_DMk_2D |
| Mix_DMk_2D< std::complex< double > > | mix_common_density_ |
| RI_2D_Comm::HybridDensityLayout | common_density_layout_ |
| Exx_Info_Global | info_global |
| size_t | hybrid_step_ = 1 |
| const Charge_Mixing * | p_chgmix_ = nullptr |
| const void * | last_borrowed_mixing_ = nullptr |
| bool | exx_spacegroup_symmetry = false |
| ModuleSymmetry::Symmetry_rotation | symrot_ |
| Flag_Finish | flag_finish |
| using Exx_LRI_Interface< T, Tdata >::TA = int |
| using Exx_LRI_Interface< T, Tdata >::TC = std::array<int, 3> |
|
inline |
Constructor for Exx_LRI_Interface.
|
delete |
| void Exx_LRI_Interface< T, Tdata >::cal_exx_elec | ( | const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > & | Ds, |
| const UnitCell & | ucell, | ||
| const Parallel_Orbitals & | pv, | ||
| const ModuleSymmetry::Symmetry_rotation * | p_symrot = nullptr ) |
: in cal_exx_elec: Exx_LRI::cal_exx_elec()
| void Exx_LRI_Interface< T, Tdata >::cal_exx_force | ( | const int & | nat | ) |
| void Exx_LRI_Interface< T, Tdata >::cal_exx_ions | ( | const UnitCell & | ucell, |
| const bool | write_cv = false ) |
: in cal_exx_ions: Exx_LRI::cal_exx_ions()
| void Exx_LRI_Interface< T, Tdata >::cal_exx_stress | ( | const double & | omega, |
| const double & | lat0 ) |
| bool Exx_LRI_Interface< T, Tdata >::exx_after_converge | ( | const UnitCell & | ucell, |
| hamilt::Hamilt< T > & | hamilt, | ||
| const module_dm::DensityMatrix< T, double > & | dm, | ||
| const K_Vectors & | kv, | ||
| const Parallel_Orbitals & | pv, | ||
| const int & | nspin, | ||
| int & | iter, | ||
| const int & | istep, | ||
| const double & | etot, | ||
| const double & | scf_ene_thr, | ||
| const elecstate::TDFieldManager * | field ) |
: in do_after_converge: add exx operators; do DM mixing if seperate loop
| dm | double should be Tdata if complex-PBE-DM is supported |
| void Exx_LRI_Interface< T, Tdata >::exx_before_all_runners | ( | const K_Vectors & | kv, |
| const UnitCell & | ucell, | ||
| const Parallel_Blkcyclic & | pv ) |
Initialize EXX symmetry before the first ionic step.
| void Exx_LRI_Interface< T, Tdata >::exx_beforescf | ( | const int | istep, |
| const K_Vectors & | kv, | ||
| const Charge_Mixing & | chgmix, | ||
| const UnitCell & | ucell, | ||
| const LCAO_Orbitals & | orb, | ||
| const Parallel_Blkcyclic & | pv, | ||
| const bool | update_symmetry, | ||
| const bool | use_gpu ) |
in beforescf: set xc type, opt_orb, do DM mixing
| void Exx_LRI_Interface< T, Tdata >::exx_eachiterinit | ( | const int | istep, |
| const UnitCell & | ucell, | ||
| const module_dm::DensityMatrix< T, double > & | dm, | ||
| const K_Vectors & | kv, | ||
| const Parallel_Orbitals & | pv, | ||
| const int & | iter, | ||
| const elecstate::ElecState & | elec ) |
in eachiterinit: do DM mixing and calculate Hexx when entering 2nd SCF
| dm | double should be Tdata if complex-PBE-DM is supported |
| void Exx_LRI_Interface< T, Tdata >::exx_hamilt2rho | ( | elecstate::ElecState & | elec, |
| const Parallel_Orbitals & | pv, | ||
| const int | iter ) |
in hamilt2rho: calculate Hexx and Eexx
| void Exx_LRI_Interface< T, Tdata >::exx_iter_finish | ( | const K_Vectors & | kv, |
| const UnitCell & | ucell, | ||
| hamilt::Hamilt< T > & | hamilt, | ||
| elecstate::ElecState & | elec, | ||
| module_dm::DensityMatrix< T, double > * | dm, | ||
| const Parallel_Orbitals & | pv, | ||
| Charge_Mixing & | chgmix, | ||
| const double & | scf_ene_thr, | ||
| int & | iter, | ||
| const int | istep, | ||
| bool & | conv_esolver ) |
in iter_finish: write Hexx, do something according to whether SCF is converged
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Exx_LRI_Interface< T, Tdata >::init | ( | const MPI_Comm & | mpi_comm, |
| const UnitCell & | ucell, | ||
| const K_Vectors & | kv, | ||
| const LCAO_Orbitals & | orb, | ||
| const bool | use_gpu ) |
|
private |
|
private |
|
private |
| void Exx_LRI_Interface< T, Tdata >::refresh_symmetry | ( | const K_Vectors & | kv, |
| const UnitCell & | ucell, | ||
| const Parallel_Blkcyclic & | pv ) |
Discard old atom mappings, lattice returns and rotation caches before rebuilding.
|
inline |
|
inline |
|
private |
| module_dm::DensityMatrix<T, double>* Exx_LRI_Interface< T, Tdata >::dm_last_step |
| double Exx_LRI_Interface< T, Tdata >::etot_last_outer_loop = 0.0 |
| std::shared_ptr<Exx_LRI<Tdata> > Exx_LRI_Interface< T, Tdata >::exx_ptr |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| int Exx_LRI_Interface< T, Tdata >::two_level_step = 0 |
the step of the outer loop. nullptr: no dependence on the number of two_level_step, contributeHk will do enerything normally. 0: the first outer loop. If restart, contributeHk will directly add Hexx to Hloc. else, do nothing. >0: not the first outer loop. contributeHk will do enerything normally.