Skip to content

Commit 6b9a63e

Browse files
committed
change ucell in pwdft/stress_func_gga.cpp
1 parent 40c7882 commit 6b9a63e

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ void Force_Stress_LCAO<T>::calStressPwPart(const UnitCell& ucell,
10331033
sigmaxc(i, i) = -etxc / ucell.omega;
10341034
}
10351035
// Exchange-correlation for PBE
1036-
sc_pw.stress_gga(sigmaxc, rhopw, chr);
1036+
sc_pw.stress_gga(ucell,sigmaxc, rhopw, chr);
10371037

10381038
return;
10391039
}

source/module_hamilt_pw/hamilt_ofdft/of_stress_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void OF_Stress_PW::cal_stress(ModuleBase::matrix& sigmatot,
7373
{
7474
sigmaxc(i, i) = -(pelec->f_en.etxc - pelec->f_en.vtxc) / ucell.omega;
7575
}
76-
stress_gga(sigmaxc, this->rhopw, pelec->charge);
76+
stress_gga(ucell,sigmaxc, this->rhopw, pelec->charge);
7777

7878
// local contribution
7979
stress_loc(sigmaloc, this->rhopw, locpp.vloc, p_sf, true, pelec->charge);

source/module_hamilt_pw/hamilt_pwdft/stress_func.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ class Stress_Func
126126
int type); // used in nonlinear core correction stress
127127

128128
// 6) the stress from the exchange-correlation functional term
129-
void stress_gga(ModuleBase::matrix& sigma,
129+
void stress_gga(const UnitCell& ucell,
130+
ModuleBase::matrix& sigma,
130131
ModulePW::PW_Basis* rho_basis,
131132
const Charge* const chr); // gga part in both PW and LCAO basis
132133
void stress_mgga(ModuleBase::matrix& sigma,

source/module_hamilt_pw/hamilt_pwdft/stress_func_gga.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
//calculate the GGA stress correction in PW and LCAO
77
template <typename FPTYPE, typename Device>
8-
void Stress_Func<FPTYPE, Device>::stress_gga(ModuleBase::matrix& sigma,
8+
void Stress_Func<FPTYPE, Device>::stress_gga(const UnitCell& ucell,
9+
ModuleBase::matrix& sigma,
910
ModulePW::PW_Basis* rho_basis,
1011
const Charge* const chr)
1112
{
@@ -26,7 +27,7 @@ void Stress_Func<FPTYPE, Device>::stress_gga(ModuleBase::matrix& sigma,
2627
// call gradcorr to evaluate gradient correction to stress
2728
// the first three terms are etxc, vtxc and v, which
2829
// is not used here, so dummy variables are used.
29-
XC_Functional::gradcorr(dum1, dum2, dum3, chr, rho_basis, &GlobalC::ucell, stress_gga, 1);
30+
XC_Functional::gradcorr(dum1, dum2, dum3, chr, rho_basis, &ucell, stress_gga, 1);
3031

3132
for(int l = 0;l< 3;l++)
3233
{

source/module_hamilt_pw/hamilt_pwdft/stress_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void Stress_PW<FPTYPE, Device>::cal_stress(ModuleBase::matrix& sigmatot,
7676
{
7777
sigmaxc(i, i) = -(pelec->f_en.etxc - pelec->f_en.vtxc) / ucell.omega;
7878
}
79-
this->stress_gga(sigmaxc, rho_basis, pelec->charge);
79+
this->stress_gga(ucell,sigmaxc, rho_basis, pelec->charge);
8080
if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5)
8181
{
8282
this->stress_mgga(sigmaxc,

source/module_hamilt_pw/hamilt_stodft/sto_stress_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void Sto_Stress_PW<FPTYPE, Device>::cal_stress(ModuleBase::matrix& sigmatot,
4949
{
5050
sigmaxc(i, i) = -(elec.f_en.etxc - elec.f_en.vtxc) / this->ucell->omega;
5151
}
52-
this->stress_gga(sigmaxc, rho_basis, chr);
52+
this->stress_gga(ucell_in,sigmaxc, rho_basis, chr);
5353

5454
// local contribution
5555
this->stress_loc(sigmaloc, rho_basis, nlpp->vloc, p_sf, true, chr);

0 commit comments

Comments
 (0)