@@ -126,6 +126,7 @@ void DFTU::fold_dSR_gamma(
126126}
127127
128128void DFTU::folding_matrix_k (
129+ const UnitCell &ucell,
129130 ForceStressArrays &fsr,
130131 const Parallel_Orbitals &pv,
131132 const int ik,
@@ -153,26 +154,26 @@ void DFTU::folding_matrix_k(
153154 ModuleBase::Vector3<double > dtau2;
154155 ModuleBase::Vector3<double > tau0;
155156
156- for (int T1 = 0 ; T1 < GlobalC:: ucell.ntype ; ++T1)
157+ for (int T1 = 0 ; T1 < ucell.ntype ; ++T1)
157158 {
158- Atom* atom1 = &GlobalC:: ucell.atoms [T1];
159+ Atom* atom1 = &ucell.atoms [T1];
159160 for (int I1 = 0 ; I1 < atom1->na ; ++I1)
160161 {
161162 tau1 = atom1->tau [I1];
162- GlobalC::GridD.Find_atom (GlobalC:: ucell, tau1, T1, I1);
163- Atom* atom1 = &GlobalC:: ucell.atoms [T1];
164- const int start1 = GlobalC:: ucell.itiaiw2iwt (T1, I1, 0 );
163+ GlobalC::GridD.Find_atom (ucell, tau1, T1, I1);
164+ Atom* atom1 = &ucell.atoms [T1];
165+ const int start1 = ucell.itiaiw2iwt (T1, I1, 0 );
165166
166167 // (2) search among all adjacent atoms.
167168 for (int ad = 0 ; ad < GlobalC::GridD.getAdjacentNum () + 1 ; ++ad)
168169 {
169170 const int T2 = GlobalC::GridD.getType (ad);
170171 const int I2 = GlobalC::GridD.getNatom (ad);
171- Atom* atom2 = &GlobalC:: ucell.atoms [T2];
172+ Atom* atom2 = &ucell.atoms [T2];
172173
173174 tau2 = GlobalC::GridD.getAdjacentTau (ad);
174175 dtau = tau2 - tau1;
175- double distance = dtau.norm () * GlobalC:: ucell.lat0 ;
176+ double distance = dtau.norm () * ucell.lat0 ;
176177 double rcut = orb_cutoff_[T1] + orb_cutoff_[T2];
177178
178179 bool adj = false ;
@@ -192,11 +193,11 @@ void DFTU::folding_matrix_k(
192193 dtau1 = tau0 - tau1;
193194 dtau2 = tau0 - tau2;
194195
195- double distance1 = dtau1.norm () * GlobalC:: ucell.lat0 ;
196- double distance2 = dtau2.norm () * GlobalC:: ucell.lat0 ;
196+ double distance1 = dtau1.norm () * ucell.lat0 ;
197+ double distance2 = dtau2.norm () * ucell.lat0 ;
197198
198- double rcut1 = orb_cutoff_[T1] + GlobalC:: ucell.infoNL .Beta [T0].get_rcut_max ();
199- double rcut2 = orb_cutoff_[T2] + GlobalC:: ucell.infoNL .Beta [T0].get_rcut_max ();
199+ double rcut1 = orb_cutoff_[T1] + ucell.infoNL .Beta [T0].get_rcut_max ();
200+ double rcut2 = orb_cutoff_[T2] + ucell.infoNL .Beta [T0].get_rcut_max ();
200201
201202 if (distance1 < rcut1 && distance2 < rcut2)
202203 {
@@ -209,7 +210,7 @@ void DFTU::folding_matrix_k(
209210 if (adj)
210211 {
211212 // (3) calculate the nu of atom (T2, I2)
212- const int start2 = GlobalC:: ucell.itiaiw2iwt (T2, I2, 0 );
213+ const int start2 = ucell.itiaiw2iwt (T2, I2, 0 );
213214 // ------------------------------------------------
214215 // exp(k dot dR)
215216 // dR is the index of box in Crystal coordinates
0 commit comments