|
8 | 8 |
|
9 | 9 | #ifdef __DEEPKS |
10 | 10 |
|
11 | | -#include "LCAO_deepks.h" |
| 11 | +#include "deepks_phialpha.h" |
| 12 | + |
12 | 13 | #include "module_base/timer.h" |
13 | 14 | #include "module_base/vector3.h" |
14 | 15 | #include "module_parameter/parameter.h" |
15 | 16 |
|
16 | | -void LCAO_Deepks::allocate_phialpha(const bool& cal_deri, |
17 | | - const UnitCell& ucell, |
18 | | - const LCAO_Orbitals& orb, |
19 | | - const Grid_Driver& GridD) |
| 17 | +void DeePKS_domain::allocate_phialpha(const bool& cal_deri, |
| 18 | + const UnitCell& ucell, |
| 19 | + const LCAO_Orbitals& orb, |
| 20 | + const Grid_Driver& GridD, |
| 21 | + const Parallel_Orbitals* pv, |
| 22 | + std::vector<hamilt::HContainer<double>*>& phialpha) |
20 | 23 | { |
21 | | - ModuleBase::TITLE("LCAO_Deepks", "allocate_phialpha"); |
| 24 | + ModuleBase::TITLE("DeePKS_domain", "allocate_phialpha"); |
22 | 25 |
|
23 | | - this->phialpha.resize(cal_deri ? 4 : 1); |
| 26 | + phialpha.resize(cal_deri ? 4 : 1); |
24 | 27 |
|
25 | | - this->phialpha[0] = new hamilt::HContainer<double>(pv); // phialpha is always real |
| 28 | + phialpha[0] = new hamilt::HContainer<double>(pv); // phialpha is always real |
26 | 29 | // Do not use fix_gamma, since it may find wrong matrix for gamma-only case in DeePKS |
27 | 30 |
|
28 | 31 | // cutoff for alpha is same for all types of atoms |
@@ -63,31 +66,33 @@ void LCAO_Deepks::allocate_phialpha(const bool& cal_deri, |
63 | 66 | hamilt::AtomPair<double> pair(iat, ibt, R_index, pv); |
64 | 67 | // Notice: in AtomPair, the usage is set_size(ncol, nrow) |
65 | 68 | pair.set_size(nw_alpha, atom1->nw * PARAM.globalv.npol); |
66 | | - this->phialpha[0]->insert_pair(pair); |
| 69 | + phialpha[0]->insert_pair(pair); |
67 | 70 | } |
68 | 71 | } |
69 | 72 | } |
70 | 73 |
|
71 | | - this->phialpha[0]->allocate(nullptr, true); |
| 74 | + phialpha[0]->allocate(nullptr, true); |
72 | 75 | // whether to calculate the derivative of phialpha |
73 | 76 | if (cal_deri) |
74 | 77 | { |
75 | 78 | for (int i = 1; i < 4; ++i) |
76 | 79 | { |
77 | | - this->phialpha[i] = new hamilt::HContainer<double>(*this->phialpha[0], nullptr); // copy constructor |
| 80 | + phialpha[i] = new hamilt::HContainer<double>(*phialpha[0], nullptr); // copy constructor |
78 | 81 | } |
79 | 82 | } |
80 | 83 | return; |
81 | 84 | } |
82 | 85 |
|
83 | | -void LCAO_Deepks::build_phialpha(const bool& cal_deri, |
84 | | - const UnitCell& ucell, |
85 | | - const LCAO_Orbitals& orb, |
86 | | - const Grid_Driver& GridD, |
87 | | - const TwoCenterIntegrator& overlap_orb_alpha) |
| 86 | +void DeePKS_domain::build_phialpha(const bool& cal_deri, |
| 87 | + const UnitCell& ucell, |
| 88 | + const LCAO_Orbitals& orb, |
| 89 | + const Grid_Driver& GridD, |
| 90 | + const Parallel_Orbitals* pv, |
| 91 | + const TwoCenterIntegrator& overlap_orb_alpha, |
| 92 | + std::vector<hamilt::HContainer<double>*>& phialpha) |
88 | 93 | { |
89 | | - ModuleBase::TITLE("LCAO_Deepks", "build_phialpha"); |
90 | | - ModuleBase::timer::tick("LCAO_Deepks", "build_phialpha"); |
| 94 | + ModuleBase::TITLE("DeePKS_domain", "build_phialpha"); |
| 95 | + ModuleBase::timer::tick("DeePKS_domain", "build_phialpha"); |
91 | 96 |
|
92 | 97 | // cutoff for alpha is same for all types of atoms |
93 | 98 | const double Rcut_Alpha = orb.Alpha[0].getRcut(); |
@@ -126,13 +131,13 @@ void LCAO_Deepks::build_phialpha(const bool& cal_deri, |
126 | 131 | continue; |
127 | 132 | } |
128 | 133 |
|
129 | | - double* data_pointer = this->phialpha[0]->data(iat, ibt, R); |
| 134 | + double* data_pointer = phialpha[0]->data(iat, ibt, R); |
130 | 135 | std::vector<double*> grad_pointer(3); |
131 | 136 | if (cal_deri) |
132 | 137 | { |
133 | 138 | for (int i = 0; i < 3; ++i) |
134 | 139 | { |
135 | | - grad_pointer[i] = this->phialpha[i + 1]->data(iat, ibt, R); |
| 140 | + grad_pointer[i] = phialpha[i + 1]->data(iat, ibt, R); |
136 | 141 | } |
137 | 142 | } |
138 | 143 |
|
@@ -192,17 +197,19 @@ void LCAO_Deepks::build_phialpha(const bool& cal_deri, |
192 | 197 | } |
193 | 198 | } |
194 | 199 |
|
195 | | - ModuleBase::timer::tick("LCAO_Deepks", "build_phialpha"); |
| 200 | + ModuleBase::timer::tick("DeePKS_domain", "build_phialpha"); |
196 | 201 | return; |
197 | 202 | } |
198 | 203 |
|
199 | | -void LCAO_Deepks::check_phialpha(const bool& cal_deri, |
200 | | - const UnitCell& ucell, |
201 | | - const LCAO_Orbitals& orb, |
202 | | - const Grid_Driver& GridD) |
| 204 | +void DeePKS_domain::check_phialpha(const bool& cal_deri, |
| 205 | + const UnitCell& ucell, |
| 206 | + const LCAO_Orbitals& orb, |
| 207 | + const Grid_Driver& GridD, |
| 208 | + const Parallel_Orbitals* pv, |
| 209 | + std::vector<hamilt::HContainer<double>*>& phialpha) |
203 | 210 | { |
204 | | - ModuleBase::TITLE("LCAO_Deepks", "check_phialpha"); |
205 | | - ModuleBase::timer::tick("LCAO_Deepks", "check_phialpha"); |
| 211 | + ModuleBase::TITLE("DeePKS_domain", "check_phialpha"); |
| 212 | + ModuleBase::timer::tick("DeePKS_domain", "check_phialpha"); |
206 | 213 |
|
207 | 214 | const double Rcut_Alpha = orb.Alpha[0].getRcut(); |
208 | 215 | // same for all types of atoms |
@@ -280,13 +287,13 @@ void LCAO_Deepks::check_phialpha(const bool& cal_deri, |
280 | 287 | ofs_z << "R : " << R[0] << " " << R[1] << " " << R[2] << std::endl; |
281 | 288 | } |
282 | 289 |
|
283 | | - const double* data_pointer = this->phialpha[0]->data(iat, ibt, R); |
| 290 | + const double* data_pointer = phialpha[0]->data(iat, ibt, R); |
284 | 291 | std::vector<double*> grad_pointer(3, nullptr); |
285 | 292 | if (cal_deri) |
286 | 293 | { |
287 | | - grad_pointer[0] = this->phialpha[1]->data(iat, ibt, R); |
288 | | - grad_pointer[1] = this->phialpha[2]->data(iat, ibt, R); |
289 | | - grad_pointer[2] = this->phialpha[3]->data(iat, ibt, R); |
| 294 | + grad_pointer[0] = phialpha[1]->data(iat, ibt, R); |
| 295 | + grad_pointer[1] = phialpha[2]->data(iat, ibt, R); |
| 296 | + grad_pointer[2] = phialpha[3]->data(iat, ibt, R); |
290 | 297 | } |
291 | 298 |
|
292 | 299 | for (int iw1 = 0; iw1 < nw1_tot; ++iw1) |
@@ -334,7 +341,7 @@ void LCAO_Deepks::check_phialpha(const bool& cal_deri, |
334 | 341 | } // end I0 |
335 | 342 | } // end T0 |
336 | 343 |
|
337 | | - ModuleBase::timer::tick("LCAO_Deepks", "check_phialpha"); |
| 344 | + ModuleBase::timer::tick("DeePKS_domain", "check_phialpha"); |
338 | 345 | return; |
339 | 346 | } |
340 | 347 |
|
|
0 commit comments