@@ -58,7 +58,8 @@ void pseudopot_cell_vnl::initgradq_vnl(const UnitCell &cell)
5858
5959}
6060
61- void pseudopot_cell_vnl::getgradq_vnl (const int ik)
61+ void pseudopot_cell_vnl::getgradq_vnl (const UnitCell& ucell,
62+ const int ik)
6263{
6364 if (PARAM.inp .test_pp ) ModuleBase::TITLE (" pseudopot_cell_vnl" ," getvnl" );
6465 ModuleBase::timer::tick (" pp_cell_vnl" ," getvnl" );
@@ -91,11 +92,11 @@ void pseudopot_cell_vnl::getgradq_vnl(const int ik)
9192 ModuleBase::YlmReal::grad_Ylm_Real (x1, npw, gk, ylm, dylm[0 ], dylm[1 ], dylm[2 ]);
9293
9394 int jkb = 0 ;
94- for (int it = 0 ;it < GlobalC:: ucell.ntype ;it++)
95+ for (int it = 0 ;it < ucell.ntype ;it++)
9596 {
9697 // calculate beta in G-space using an interpolation table
97- const int nbeta = GlobalC:: ucell.atoms [it].ncpp .nbeta ;
98- const int nh = GlobalC:: ucell.atoms [it].ncpp .nh ;
98+ const int nbeta = ucell.atoms [it].ncpp .nbeta ;
99+ const int nh = ucell.atoms [it].ncpp .nh ;
99100 int nb0 = -1 ;
100101 for ( int ih = 0 ; ih < nh; ++ih)
101102 {
@@ -104,7 +105,7 @@ void pseudopot_cell_vnl::getgradq_vnl(const int ik)
104105 {
105106 for (int ig = 0 ;ig < npw;++ig)
106107 {
107- const double gnorm = gk[ig].norm () * GlobalC:: ucell.tpiba ;
108+ const double gnorm = gk[ig].norm () * ucell.tpiba ;
108109 vq [ig] = ModuleBase::PolyInt::Polynomial_Interpolation (
109110 this ->tab , it, nb, PARAM.globalv .nqx , PARAM.globalv .dq , gnorm );
110111 dvq[ig] =ModuleBase::PolyInt::Polynomial_Interpolation (
@@ -146,7 +147,7 @@ void pseudopot_cell_vnl::getgradq_vnl(const int ik)
146147
147148 // vkb1 contains all betas including angular part for type nt
148149 // now add the structure factor and factor (-i)^l
149- for (int ia=0 ; ia<GlobalC:: ucell.atoms [it].na ; ia++)
150+ for (int ia=0 ; ia<ucell.atoms [it].na ; ia++)
150151 {
151152 std::complex <double > *sk = this ->psf ->get_sk (ik, it, ia, this ->wfcpw );
152153
@@ -161,7 +162,7 @@ void pseudopot_cell_vnl::getgradq_vnl(const int ik)
161162 {
162163 std::complex <double > skig = sk[ig];
163164 pvkb[ig] = tmpvkb (ih, ig) * skig * pref;
164- // std::complex<double> dskig = ModuleBase::NEG_IMAG_UNIT * (GlobalC:: ucell.atoms[it].tau[ia][id] * this->wfcpw->lat0) * skig;
165+ // std::complex<double> dskig = ModuleBase::NEG_IMAG_UNIT * (ucell.atoms[it].tau[ia][id] * this->wfcpw->lat0) * skig;
165166 // pgvkb[ig] = tmpgradvkb(id, ih, ig) * skig * pref + tmpvkb(ih, ig) * dskig * pref;
166167 // The second term will be eliminate when doing <psi|beta>Dij<beta|psi> or we can say (\nabla_q+\nabla_q')S(q'-q) = 0
167168 pgvkb[ig] = tmpgradvkb (id, ih, ig) * skig * pref;
0 commit comments