|
1 | 1 | #include "elecstate_lcao.h" |
2 | | - |
| 2 | +#include "elecstate_lcao_cal_tau.h" |
3 | 3 | #include "module_base/timer.h" |
4 | 4 |
|
5 | 5 | namespace elecstate |
6 | 6 | { |
7 | 7 |
|
8 | 8 | // calculate the kinetic energy density tau, multi-k case |
9 | | -template <> |
10 | | -void ElecStateLCAO<std::complex<double>>::cal_tau(const psi::Psi<std::complex<double>>& psi) |
| 9 | +void cal_tau_k(Gint_k& gint_k, |
| 10 | + Charge* charge) |
11 | 11 | { |
12 | 12 | ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); |
13 | 13 |
|
14 | 14 | for (int is = 0; is < PARAM.inp.nspin; is++) |
15 | 15 | { |
16 | | - ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); |
| 16 | + ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx); |
17 | 17 | } |
18 | | - Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); |
19 | | - this->gint_k->cal_gint(&inout1); |
| 18 | + Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); |
| 19 | + gint_k->cal_gint(&inout1); |
20 | 20 |
|
21 | 21 | ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); |
22 | 22 | return; |
23 | 23 | } |
24 | 24 |
|
25 | 25 | // calculate the kinetic energy density tau, gamma-only case |
26 | | -template <> |
27 | | -void ElecStateLCAO<double>::cal_tau(const psi::Psi<double>& psi) |
| 26 | +void cal_tau_gamma(Gint_Gamma& gint_gamma, |
| 27 | + Charge& charge) |
28 | 28 | { |
29 | 29 | ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); |
30 | 30 |
|
31 | 31 | for (int is = 0; is < PARAM.inp.nspin; is++) |
32 | 32 | { |
33 | | - ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); |
| 33 | + ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx); |
34 | 34 | } |
35 | | - Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); |
36 | | - this->gint_gamma->cal_gint(&inout1); |
| 35 | + Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin); |
| 36 | + gint_gamma->cal_gint(&inout1); |
37 | 37 |
|
38 | 38 | ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); |
39 | 39 | return; |
|
0 commit comments