11#include " elecstate_lcao.h"
2-
2+ # include " elecstate_lcao_cal_tau.h "
33#include " module_base/timer.h"
44
55namespace elecstate
66{
77
88// 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 lcao_cal_tau_k (Gint_k* gint_k,
10+ Charge* charge )
1111{
1212 ModuleBase::timer::tick (" ElecStateLCAO" , " cal_tau" );
1313
1414 for (int is = 0 ; is < PARAM.inp .nspin ; is++)
1515 {
16- ModuleBase::GlobalFunc::ZEROS (this -> charge ->kin_r [is], this -> charge ->nrxx );
16+ ModuleBase::GlobalFunc::ZEROS (charge->kin_r [is], charge->nrxx );
1717 }
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);
2020
2121 ModuleBase::timer::tick (" ElecStateLCAO" , " cal_tau" );
2222 return ;
2323}
2424
2525// calculate the kinetic energy density tau, gamma-only case
26- template <>
27- void ElecStateLCAO< double >::cal_tau( const psi::Psi< double >& psi )
26+ void lcao_cal_tau_gamma (Gint_Gamma* gint_gamma,
27+ Charge* charge )
2828{
2929 ModuleBase::timer::tick (" ElecStateLCAO" , " cal_tau" );
3030
3131 for (int is = 0 ; is < PARAM.inp .nspin ; is++)
3232 {
33- ModuleBase::GlobalFunc::ZEROS (this -> charge ->kin_r [is], this -> charge ->nrxx );
33+ ModuleBase::GlobalFunc::ZEROS (charge->kin_r [is], charge->nrxx );
3434 }
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);
3737
3838 ModuleBase::timer::tick (" ElecStateLCAO" , " cal_tau" );
3939 return ;
4040}
41- }
41+ template <>
42+ void lcao_cal_tau<double >(Gint_Gamma* gint_gamma,
43+ Gint_k* gint_k,
44+ Charge* charge)
45+ {
46+ lcao_cal_tau_gamma (gint_gamma, charge);
47+ }
48+ template <>
49+ void lcao_cal_tau<complex <double >>(Gint_Gamma* gint_gamma,
50+ Gint_k* gint_k,
51+ Charge* charge)
52+ {
53+ lcao_cal_tau_k (gint_k, charge);
54+ }
55+
56+ } // namespace elecstate
0 commit comments