@@ -62,13 +62,15 @@ void DFTU::cal_yukawa_lambda(double** rho, const int& nrxx)
6262 return ;
6363}
6464
65- void DFTU::cal_slater_Fk (const int L, const int T)
65+ void DFTU::cal_slater_Fk (const UnitCell& ucell,
66+ const int L,
67+ const int T)
6668{
6769 ModuleBase::TITLE (" DFTU" , " cal_slater_Fk" );
6870
6971 if (Yukawa)
7072 {
71- for (int chi = 0 ; chi < GlobalC:: ucell.atoms [T].l_nchi [L]; chi++)
73+ for (int chi = 0 ; chi < ucell.atoms [T].l_nchi [L]; chi++)
7274 {
7375 // if(chi!=0) continue;
7476 const int mesh = ptr_orb_->Phi [T].PhiLN (L, chi).getNr ();
@@ -110,7 +112,7 @@ void DFTU::cal_slater_Fk(const int L, const int T)
110112 return ;
111113}
112114
113- void DFTU::cal_slater_UJ (double ** rho, const int & nrxx)
115+ void DFTU::cal_slater_UJ (const UnitCell& ucell, double ** rho, const int & nrxx)
114116{
115117 ModuleBase::TITLE (" DFTU" , " cal_slater_UJ" );
116118 if (!Yukawa) {
@@ -119,34 +121,34 @@ void DFTU::cal_slater_UJ(double** rho, const int& nrxx)
119121
120122 this ->cal_yukawa_lambda (rho, nrxx);
121123
122- for (int it = 0 ; it < GlobalC:: ucell.ntype ; it++)
124+ for (int it = 0 ; it < ucell.ntype ; it++)
123125 {
124- const int NL = GlobalC:: ucell.atoms [it].nwl + 1 ;
126+ const int NL = ucell.atoms [it].nwl + 1 ;
125127
126128 for (int l = 0 ; l < NL; l++)
127129 {
128- int N = GlobalC:: ucell.atoms [it].l_nchi [l];
130+ int N = ucell.atoms [it].l_nchi [l];
129131 for (int n = 0 ; n < N; n++)
130132 {
131133 ModuleBase::GlobalFunc::ZEROS (ModuleBase::GlobalFunc::VECTOR_TO_PTR (this ->Fk [it][l][n]), l + 1 );
132134 }
133135 }
134136 }
135137
136- for (int T = 0 ; T < GlobalC:: ucell.ntype ; T++)
138+ for (int T = 0 ; T < ucell.ntype ; T++)
137139 {
138- const int NL = GlobalC:: ucell.atoms [T].nwl + 1 ;
140+ const int NL = ucell.atoms [T].nwl + 1 ;
139141
140142 for (int L = 0 ; L < NL; L++)
141143 {
142- const int N = GlobalC:: ucell.atoms [T].l_nchi [L];
144+ const int N = ucell.atoms [T].l_nchi [L];
143145
144146 if (L >= PARAM.inp .orbital_corr [T] && PARAM.inp .orbital_corr [T] != -1 )
145147 {
146148 if (L != PARAM.inp .orbital_corr [T]) {
147149 continue ;
148150}
149- this ->cal_slater_Fk (L, T);
151+ this ->cal_slater_Fk (ucell, L, T);
150152
151153 for (int n = 0 ; n < N; n++)
152154 {
0 commit comments