66
77// calculate the Hartree part in PW or LCAO base
88template <typename FPTYPE, typename Device>
9- void Stress_Func<FPTYPE, Device>::stress_har(ModuleBase::matrix& sigma, ModulePW::PW_Basis* rho_basis, const bool is_pw, const Charge* const chr)
9+ void Stress_Func<FPTYPE, Device>::stress_har(const UnitCell& ucell,
10+ ModuleBase::matrix& sigma,
11+ ModulePW::PW_Basis* rho_basis,
12+ const bool is_pw,
13+ const Charge* const chr)
1014{
1115 ModuleBase::TITLE (" Stress_Func" ," stress_har" );
1216 ModuleBase::timer::tick (" Stress_Func" ," stress_har" );
@@ -65,10 +69,10 @@ void Stress_Func<FPTYPE, Device>::stress_har(ModuleBase::matrix& sigma, ModulePW
6569 const FPTYPE g2 = rho_basis->gg [ig];
6670 if (g2 < 1e-8 ) { continue ;
6771}
68- // const FPTYPE fac = ModuleBase::e2 * ModuleBase::FOUR_PI / (GlobalC:: ucell.tpiba2 * GlobalC::sf.gg [ig]);
72+ // const FPTYPE fac = ModuleBase::e2 * ModuleBase::FOUR_PI / (ucell.tpiba2 * GlobalC::sf.gg [ig]);
6973 // ehart += ( conj( Porter[j] ) * Porter[j] ).real() * fac;
7074 // vh_g[ig] = fac * Porter[j];
71- FPTYPE shart= ( conj ( aux[ig] ) * aux[ig] ).real ()/(GlobalC:: ucell.tpiba2 * g2);
75+ FPTYPE shart= ( conj ( aux[ig] ) * aux[ig] ).real ()/(ucell.tpiba2 * g2);
7276 for (int l=0 ;l<3 ;l++)
7377 {
7478 for (int m=0 ;m<l+1 ;m++)
@@ -100,7 +104,7 @@ void Stress_Func<FPTYPE, Device>::stress_har(ModuleBase::matrix& sigma, ModulePW
100104 }
101105
102106 // Parallel_Reduce::reduce_pool( ehart );
103- // ehart *= 0.5 * GlobalC:: ucell.omega;
107+ // ehart *= 0.5 * ucell.omega;
104108 // psic(:)=(0.0,0.0)
105109 if (is_pw&&PARAM.globalv .gamma_only_pw )
106110 {
@@ -125,8 +129,8 @@ void Stress_Func<FPTYPE, Device>::stress_har(ModuleBase::matrix& sigma, ModulePW
125129
126130 for (int l=0 ;l<3 ;l++)
127131 {
128- if (is_pw) { sigma (l,l) -= elecstate::H_Hartree_pw::hartree_energy /GlobalC:: ucell.omega ;
129- } else { sigma (l,l) += elecstate::H_Hartree_pw::hartree_energy /GlobalC:: ucell.omega ;
132+ if (is_pw) { sigma (l,l) -= elecstate::H_Hartree_pw::hartree_energy /ucell.omega ;
133+ } else { sigma (l,l) += elecstate::H_Hartree_pw::hartree_energy /ucell.omega ;
130134}
131135 for (int m=0 ;m<l;m++)
132136 {
0 commit comments