ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
overlap.h
Go to the documentation of this file.
1#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_OPERATOR_LCAO_OVERLAP_H
2#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_OPERATOR_LCAO_OVERLAP_H
9#include <vector>
10
11namespace hamilt
12{
13
14#ifndef __OVERLAPTEMPLATE
15#define __OVERLAPTEMPLATE
16
22template <class T>
23class Overlap : public T
24{
25};
26
27#endif
28
36template <typename TK, typename TR>
37class Overlap<OperatorLCAO<TK, TR>> : public OperatorLCAO<TK, TR>
38{
39 public:
41 const std::vector<ModuleBase::Vector3<double>>& kvec_d_in,
44 const UnitCell* ucell_in,
45 const std::vector<double>& orb_cutoff,
46 const Grid_Driver* GridD_in,
47 const TwoCenterIntegrator* intor);
48
50
51 virtual void contributeHR() override;
52
53 virtual void contributeHk(int ik) override;
54
55 TK* getSk();
56
65 void cal_force_stress(const bool cal_force,
66 const bool cal_stress,
67 const HContainer<double>* dmR,
68 ModuleBase::matrix& force,
69 ModuleBase::matrix& stress);
70
71 private:
72 const UnitCell* ucell = nullptr;
73
74 std::vector<double> orb_cutoff_;
75
77
78 const TwoCenterIntegrator* intor_ = nullptr;
79
80 const Grid_Driver* gridD = nullptr;
81
82 bool SR_fixed_done = false;
83
89 void initialize_SR(const Grid_Driver* GridD_in);
90
97
101 void cal_SR_IJR(const int& iat1,
102 const int& iat2,
103 const Parallel_Orbitals* paraV,
104 const ModuleBase::Vector3<double>& dtau,
105 TR* data_pointer);
106
110 void cal_force_IJR(const int& iat1,
111 const int& iat2,
112 const Parallel_Orbitals* paraV,
113 const std::unordered_map<int, std::vector<double>>& nlm1_all,
114 const std::unordered_map<int, std::vector<double>>& nlm2_all,
115 const hamilt::BaseMatrix<TR>* dmR_pointer,
116 double* force1,
117 double* force2);
118
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 hamilt::BaseMatrix<TR>* dmR_pointer,
128 const ModuleBase::Vector3<double>& dis1,
129 const ModuleBase::Vector3<double>& dis2,
130 double* stress);
131
132 // if k vector is not changed, then do nothing and return
133 // default of kvec_d_old is (-10,-10,-10), which is not a valid k vector
135
136 public:
145 hamilt::HContainer<TR>* calculate_SR_async(const UnitCell& ucell, const double md_dt, const Parallel_Orbitals* paraV);
146
153 void output_SR_async_csr(const int istep, hamilt::HContainer<TR>* SR_async, const int precision = 8);
154};
155
156} // namespace hamilt
157#endif
Definition sltk_grid_driver.h:40
3 elements vector
Definition vector3.h:24
Definition matrix.h:18
Definition parallel_orbitals.h:9
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Definition unitcell.h:15
Definition base_matrix.h:20
Definition hcontainer.h:144
Definition hs_matrix_k.hpp:11
Definition operator_lcao.h:12
void cal_SR_IJR(const int &iat1, const int &iat2, const Parallel_Orbitals *paraV, const ModuleBase::Vector3< double > &dtau, TR *data_pointer)
calculate the SR local matrix of <I,J,R> atom pair
void calculate_SR()
calculate the overlap matrix with specific <I,J,R> atom-pairs nearest neighbor atoms don't need to be...
std::vector< double > orb_cutoff_
Definition overlap.h:74
void initialize_SR(const Grid_Driver *GridD_in)
initialize SR, search the nearest neighbor atoms HContainer is used to store the overlap matrix with ...
void output_SR_async_csr(const int istep, hamilt::HContainer< TR > *SR_async, const int precision=8)
output asynchronous overlap matrix in CSR format
virtual void contributeHk(int ik) override
hamilt::HContainer< TR > * calculate_SR_async(const UnitCell &ucell, const double md_dt, const Parallel_Orbitals *paraV)
calculate asynchronous overlap matrix for Hefei-NAMD Calculates <phi(t-1)|phi(t)> by shifting atom po...
Definition overlap.h:24
#define T
Definition exp.cpp:237
Definition hamilt.h:13