Skip to content

Commit 9c771c9

Browse files
committed
updatea func for cal_tau
1 parent 077be37 commit 9c771c9

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

source/module_elecstate/elecstate_lcao.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void ElecStateLCAO<std::complex<double>>::psiToRho(const psi::Psi<std::complex<d
6565

6666
if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5)
6767
{
68-
elecstate::cal_tau_k(gint_k, this->charge);
68+
elecstate::lcao_cal_tau_k(gint_k, this->charge);
6969
}
7070

7171
this->charge->renormalize_rho();

source/module_elecstate/elecstate_lcao_cal_tau.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace elecstate
77

88
// calculate the kinetic energy density tau, multi-k case
99
void lcao_cal_tau_k(Gint_k* gint_k,
10-
Charge* charge)
10+
Charge* charge)
1111
{
1212
ModuleBase::timer::tick("ElecStateLCAO", "cal_tau");
1313

@@ -38,18 +38,17 @@ void lcao_cal_tau_gamma(Gint_Gamma* gint_gamma,
3838
ModuleBase::timer::tick("ElecStateLCAO", "cal_tau");
3939
return;
4040
}
41-
template <double>
42-
void lcao_cal_tau(Gint_Gamma* gint_gamma,
41+
template <>
42+
void lcao_cal_tau<double>(Gint_Gamma* gint_gamma,
4343
Gint_k* gint_k,
4444
Charge* charge)
4545
{
4646
lcao_cal_tau_gamma(gint_gamma, charge);
4747
}
48-
template <complex<double>>
49-
void lcao_cal_tau(Gint_Gamma* gint_gamma,
48+
template <>
49+
void lcao_cal_tau<complex<double>>(Gint_Gamma* gint_gamma,
5050
Gint_k* gint_k,
51-
Charge* charge,
52-
const std::complex<double>* flag)
51+
Charge* charge)
5352
{
5453
lcao_cal_tau_k(gint_k, charge);
5554
}

source/module_elecstate/elecstate_lcao_cal_tau.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef ELECSTATE_LCAO_CAL_TAU_H
22
#define ELECSTATE_LCAO_CAL_TAU_H
3-
3+
#include "module_elecstate/module_charge/charge.h"
4+
#include "module_hamilt_lcao/module_gint/gint_gamma.h"
5+
#include "module_hamilt_lcao/module_gint/gint_k.h"
46
namespace elecstate
57
{
68

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "module_base/global_function.h"
3535
#include "module_cell/module_neighbor/sltk_grid_driver.h"
3636
#include "module_elecstate/cal_ux.h"
37+
#include "module_elecstate/elecstate_lcao_cal_tau.h"
3738
#include "module_elecstate/module_charge/symmetry_rho.h"
3839
#include "module_elecstate/occupy.h"
3940
#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" // need divide_HS_in_frag
@@ -927,9 +928,9 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
927928
// 1) calculate the kinetic energy density tau, sunliang 2024-09-18
928929
if (PARAM.inp.out_elf[0] > 0)
929930
{
930-
elecstate::lcao_cal_tau<double>(this->GK,
931-
this->GG,
932-
this->pelec->charge);
931+
elecstate::lcao_cal_tau<TK>(&(this->GG),
932+
&(this->GK),
933+
this->pelec->charge);
933934
}
934935

935936
//! 2) call after_scf() of ESolver_KS

source/module_rdmft/update_state_rdmft.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "module_elecstate/module_dm/cal_dm_psi.h"
99
#include "module_elecstate/module_dm/density_matrix.h"
1010
#include "module_elecstate/module_charge/symmetry_rho.h"
11-
11+
#include "module_elecstate/elecstate_lcao_cal_tau.h"
1212

1313
namespace rdmft
1414
{
@@ -118,7 +118,7 @@ void RDMFT<TK, TR>::update_charge(UnitCell& ucell)
118118
// }
119119
// Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau);
120120
// GG->cal_gint(&inout1);
121-
this->pelec->cal_tau(wfc);
121+
elecstate::lcao_cal_tau_gamma(GG, charge);
122122
}
123123

124124
charge->renormalize_rho();
@@ -148,7 +148,7 @@ void RDMFT<TK, TR>::update_charge(UnitCell& ucell)
148148
// }
149149
// Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau);
150150
// GK->cal_gint(&inout1);
151-
this->pelec->cal_tau(wfc);
151+
elecstate::lcao_cal_tau_k(GK, charge);
152152
}
153153

154154
charge->renormalize_rho();

0 commit comments

Comments
 (0)