ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
dftu_lcao.h
Go to the documentation of this file.
1#ifndef DFTPLUSU_H
2#define DFTPLUSU_H
3#include "dftu.hpp"
12
13#include <unordered_map>
14
15namespace hamilt
16{
17
25template <typename TK, typename TR>
26class DFTU<OperatorLCAO<TK, TR>> : public OperatorLCAO<TK, TR>
27{
28 public:
30 const std::vector<ModuleBase::Vector3<double>>& kvec_d_in,
32 const UnitCell& ucell_in,
33 const Grid_Driver* gridD_in,
34 const TwoCenterIntegrator* intor,
35 const std::vector<double>& orb_cutoff,
36 ModuleDFTU::DFTU* dftu_in);
38
43 virtual void contributeHR() override;
44
46 void cal_force_stress(const bool cal_force,
47 const bool cal_stress,
48 ModuleBase::matrix& force,
49 ModuleBase::matrix& stress);
50
51 private:
52 const UnitCell* ucell = nullptr;
53
54 ModuleDFTU::DFTU* dftu = nullptr;
55
57
58 const TwoCenterIntegrator* intor_ = nullptr;
59
60 std::vector<double> orb_cutoff_;
61
63 int nspin = 0;
64
70 void initialize_HR(const Grid_Driver* gridD_in);
71
76 void cal_nlm_all(const Parallel_Orbitals* paraV);
77
81 void cal_occ(const int& iat1,
82 const int& iat2,
83 const Parallel_Orbitals* paraV,
84 const std::unordered_map<int, std::vector<double>>& nlm1_all,
85 const std::unordered_map<int, std::vector<double>>& nlm2_all,
86 const double* data_pointer,
87 std::vector<double>& occupations);
88
90 void transfer_vu(std::vector<double>& vu_tmp, std::vector<TR>& vu);
93 void cal_v_of_u(const std::vector<double>& occ, const int m_size, const double u_value, double* vu, double& eu);
94
98 void cal_HR_IJR(const int& iat1,
99 const int& iat2,
100 const Parallel_Orbitals* paraV,
101 const std::unordered_map<int, std::vector<double>>& nlm1_all,
102 const std::unordered_map<int, std::vector<double>>& nlm2_all,
103 const std::vector<TR>& vu_in,
104 TR* data_pointer);
105
109 void cal_force_IJR(const int& iat1,
110 const int& iat2,
111 const Parallel_Orbitals* paraV,
112 const std::unordered_map<int, std::vector<double>>& nlm1_all,
113 const std::unordered_map<int, std::vector<double>>& nlm2_all,
114 const std::vector<double>& vu_in,
115 const hamilt::BaseMatrix<double>** dmR_pointer,
116 const int nspin,
117 double* force1,
118 double* force2);
122 void cal_stress_IJR(const int& iat1,
123 const int& iat2,
124 const Parallel_Orbitals* paraV,
125 const std::unordered_map<int, std::vector<double>>& nlm1_all,
126 const std::unordered_map<int, std::vector<double>>& nlm2_all,
127 const std::vector<double>& vu_in,
128 const hamilt::BaseMatrix<double>** dmR_pointer,
129 const int nspin,
130 const ModuleBase::Vector3<double>& dis1,
131 const ModuleBase::Vector3<double>& dis2,
132 double* stress);
133
134 std::vector<AdjacentAtomInfo> adjs_all;
136 bool precal_nlm_done = false;
138 std::vector<std::vector<std::unordered_map<int, std::vector<double>>>> nlm_tot;
139};
140
141} // namespace hamilt
142#endif
Definition sltk_grid_driver.h:43
3 elements vector
Definition vector3.h:22
Definition matrix.h:19
Definition dftu.h:27
Definition parallel_orbitals.h:9
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Definition unitcell.h:16
Definition base_matrix.h:20
void cal_v_of_u(const std::vector< double > &occ, const int m_size, const double u_value, double *vu, double &eu)
virtual void contributeHR() override
contributeHR() is used to calculate the HR matrix <phi_{\mu, 0}|beta_p1>D_{p1, p2}<beta_p2|phi_{\nu,...
std::vector< double > orb_cutoff_
Definition dftu_lcao.h:60
std::vector< std::vector< std::unordered_map< int, std::vector< double > > > > nlm_tot
the overlap values for all [atoms][nerghbors][orb_index(iw) in NAOs][m of target_l in Projectors]
Definition dftu_lcao.h:138
void initialize_HR(const Grid_Driver *gridD_in)
search the nearest neighbor atoms and save them into this->adjs_all the size of HR will not change in...
std::vector< AdjacentAtomInfo > adjs_all
Definition dftu_lcao.h:134
void cal_occ(const int &iat1, const int &iat2, const Parallel_Orbitals *paraV, const std::unordered_map< int, std::vector< double > > &nlm1_all, const std::unordered_map< int, std::vector< double > > &nlm2_all, const double *data_pointer, std::vector< double > &occupations)
calculate the occ_mm' = \sum_R DMR*<phi_0|alpha^I_m'><alpha^I_m'|phi_R> matrix for each atom to add U
void transfer_vu(std::vector< double > &vu_tmp, std::vector< TR > &vu)
transfer VU format from pauli matrix to normal for non-collinear spin case
void cal_nlm_all(const Parallel_Orbitals *paraV)
calculate the <phi|alpha^I> overlap values and save them in this->nlm_tot it will be reused in the ca...
void cal_HR_IJR(const int &iat1, const int &iat2, const Parallel_Orbitals *paraV, const std::unordered_map< int, std::vector< double > > &nlm1_all, const std::unordered_map< int, std::vector< double > > &nlm2_all, const std::vector< TR > &vu_in, TR *data_pointer)
calculate the HR local matrix of <I,J,R> atom pair
Definition dftu.hpp:13
Definition hcontainer.h:144
Definition hs_matrix_k.hpp:11
Definition operator_lcao.h:12
Definition hamilt.h:12