Skip to content

Commit 12c9ce9

Browse files
committed
fix a bug
1 parent e472b8f commit 12c9ce9

File tree

1 file changed

+10
-8
lines changed
  • source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao

1 file changed

+10
-8
lines changed

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,21 @@ void Veff<OperatorLCAO<std::complex<double>, double>>::contributeHR()
114114
double* vofk_eff1 = this->pot->get_effective_vofk(this->current_spin);
115115

116116
#ifndef __NEW_GINT
117+
// if you change the place of the following code,
118+
// rememeber to delete the #include
117119
if(XC_Functional::get_ked_flag())
118120
{
119-
Gint_inout inout(vr_eff1, vofk_eff1, Gint_Tools::job_type::vlocal_meta);
120-
this->GG->cal_vlocal(&inout, this->new_e_iteration);
121+
Gint_inout inout(vr_eff1, vofk_eff1, 0, Gint_Tools::job_type::vlocal_meta);
122+
this->GK->cal_gint(&inout);
121123
}
122124
else
123125
{
124-
Gint_inout inout(vr_eff1, Gint_Tools::job_type::vlocal);
125-
this->GG->cal_vlocal(&inout, this->new_e_iteration);
126+
// vlocal = Vh[rho] + Vxc[rho] + Vl(pseudo)
127+
Gint_inout inout(vr_eff1, 0, Gint_Tools::job_type::vlocal);
128+
this->GK->cal_gint(&inout);
126129
}
127-
this->GG->transfer_pvpR(this->hR,this->ucell);
128-
this->new_e_iteration = false;
130+
131+
this->GK->transfer_pvpR(this->hR,this->ucell,this->gd);
129132
#else
130133
if(XC_Functional::get_ked_flag())
131134
{
@@ -146,9 +149,8 @@ void Veff<OperatorLCAO<std::complex<double>, double>>::contributeHR()
146149
return;
147150
}
148151

149-
// special case of gamma-only
150152
template<>
151-
void Veff<OperatorLCAO<std::complex<double>, std::complex<double>>>::contributeHR(void)
153+
void Veff<OperatorLCAO<std::complex<double>, std::complex<double>>>::contributeHR()
152154
{
153155
ModuleBase::TITLE("Veff", "contributeHR");
154156
ModuleBase::timer::tick("Veff", "contributeHR");

0 commit comments

Comments
 (0)