@@ -14,7 +14,8 @@ cal_r_overlap_R::~cal_r_overlap_R()
1414{
1515}
1616
17- void cal_r_overlap_R::initialize_orb_table (const LCAO_Orbitals& orb)
17+ void cal_r_overlap_R::initialize_orb_table (const UnitCell& ucell,
18+ const LCAO_Orbitals& orb)
1819{
1920 int Lmax_used = 0 ;
2021 int Lmax = 0 ;
@@ -28,7 +29,7 @@ void cal_r_overlap_R::initialize_orb_table(const LCAO_Orbitals& orb)
2829 for (int it = 0 ; it < ntype; it++)
2930 {
3031 lmax_orb = std::max (lmax_orb, orb.Phi [it].getLmax ());
31- lmax_beta = std::max (lmax_beta, GlobalC:: ucell.infoNL .Beta [it].getLmax ());
32+ lmax_beta = std::max (lmax_beta, ucell.infoNL .Beta [it].getLmax ());
3233 }
3334 const double dr = orb.get_dR ();
3435 const double dk = orb.get_dk ();
@@ -53,7 +54,8 @@ void cal_r_overlap_R::initialize_orb_table(const LCAO_Orbitals& orb)
5354 MGT.init_Gaunt (Lmax);
5455}
5556
56- void cal_r_overlap_R::construct_orbs_and_orb_r (const LCAO_Orbitals& orb)
57+ void cal_r_overlap_R::construct_orbs_and_orb_r (const UnitCell& ucell,
58+ const LCAO_Orbitals& orb)
5759{
5860 int orb_r_ntype = 0 ;
5961 int mat_Nr = orb.Phi [0 ].PhiLN (0 , 0 ).getNr ();
@@ -201,13 +203,13 @@ void cal_r_overlap_R::construct_orbs_and_orb_r(const LCAO_Orbitals& orb)
201203 iw2im.resize (PARAM.globalv .nlocal );
202204
203205 int iw = 0 ;
204- for (int it = 0 ; it < GlobalC:: ucell.ntype ; it++)
206+ for (int it = 0 ; it < ucell.ntype ; it++)
205207 {
206- for (int ia = 0 ; ia < GlobalC:: ucell.atoms [it].na ; ia++)
208+ for (int ia = 0 ; ia < ucell.atoms [it].na ; ia++)
207209 {
208- for (int iL = 0 ; iL < GlobalC:: ucell.atoms [it].nwl + 1 ; iL++)
210+ for (int iL = 0 ; iL < ucell.atoms [it].nwl + 1 ; iL++)
209211 {
210- for (int iN = 0 ; iN < GlobalC:: ucell.atoms [it].l_nchi [iL]; iN++)
212+ for (int iN = 0 ; iN < ucell.atoms [it].l_nchi [iL]; iN++)
211213 {
212214 for (int im = 0 ; im < (2 * iL + 1 ); im++)
213215 {
@@ -224,20 +226,20 @@ void cal_r_overlap_R::construct_orbs_and_orb_r(const LCAO_Orbitals& orb)
224226 }
225227}
226228
227- void cal_r_overlap_R::init (const Parallel_Orbitals& pv, const LCAO_Orbitals& orb)
229+ void cal_r_overlap_R::init (const UnitCell& ucell, const Parallel_Orbitals& pv, const LCAO_Orbitals& orb)
228230{
229231 ModuleBase::TITLE (" cal_r_overlap_R" , " init" );
230232 ModuleBase::timer::tick (" cal_r_overlap_R" , " init" );
231233 this ->ParaV = &pv;
232234
233- initialize_orb_table (orb);
234- construct_orbs_and_orb_r (orb);
235+ initialize_orb_table (ucell, orb);
236+ construct_orbs_and_orb_r (ucell, orb);
235237
236238 ModuleBase::timer::tick (" cal_r_overlap_R" , " init" );
237239 return ;
238240}
239241
240- void cal_r_overlap_R::out_rR (const int & istep)
242+ void cal_r_overlap_R::out_rR (const UnitCell& ucell, const int & istep)
241243{
242244 ModuleBase::TITLE (" cal_r_overlap_R" , " out_rR" );
243245 ModuleBase::timer::tick (" cal_r_overlap_R" , " out_rR" );
@@ -296,7 +298,7 @@ void cal_r_overlap_R::out_rR(const int& istep)
296298 int dRy = R_coor.y ;
297299 int dRz = R_coor.z ;
298300
299- ModuleBase::Vector3<double > R_car = ModuleBase::Vector3<double >(dRx, dRy, dRz) * GlobalC:: ucell.latvec ;
301+ ModuleBase::Vector3<double > R_car = ModuleBase::Vector3<double >(dRx, dRy, dRz) * ucell.latvec ;
300302
301303 int ir, ic;
302304 for (int iw1 = 0 ; iw1 < PARAM.globalv .nlocal ; iw1++)
@@ -331,8 +333,8 @@ void cal_r_overlap_R::out_rR(const int& istep)
331333 int im2 = iw2im[orb_index_col];
332334
333335 ModuleBase::Vector3<double > r_distance
334- = (GlobalC:: ucell.atoms [it2].tau [ia2] - GlobalC:: ucell.atoms [it1].tau [ia1] + R_car)
335- * GlobalC:: ucell.lat0 ;
336+ = (ucell.atoms [it2].tau [ia2] - ucell.atoms [it1].tau [ia1] + R_car)
337+ * ucell.lat0 ;
336338
337339 double overlap_o = center2_orb11[it1][it2][iL1][iN1][iL2].at (iN2).cal_overlap (origin_point,
338340 r_distance,
@@ -365,7 +367,7 @@ void cal_r_overlap_R::out_rR(const int& istep)
365367
366368 ModuleBase::Vector3<double > temp_prp
367369 = ModuleBase::Vector3<double >(overlap_x, overlap_y, overlap_z)
368- + GlobalC:: ucell.atoms [it1].tau [ia1] * GlobalC:: ucell.lat0 * overlap_o;
370+ + ucell.atoms [it1].tau [ia1] * ucell.lat0 * overlap_o;
369371
370372 if (std::abs (temp_prp.x ) > sparse_threshold)
371373 {
@@ -506,7 +508,7 @@ void cal_r_overlap_R::out_rR(const int& istep)
506508 return ;
507509}
508510
509- void cal_r_overlap_R::out_rR_other (const int & istep, const std::set<Abfs::Vector3_Order<int >>& output_R_coor)
511+ void cal_r_overlap_R::out_rR_other (const UnitCell& ucell, const int & istep, const std::set<Abfs::Vector3_Order<int >>& output_R_coor)
510512{
511513 ModuleBase::TITLE (" cal_r_overlap_R" , " out_rR_other" );
512514 ModuleBase::timer::tick (" cal_r_overlap_R" , " out_rR_other" );
@@ -571,7 +573,7 @@ void cal_r_overlap_R::out_rR_other(const int& istep, const std::set<Abfs::Vector
571573 int dRy = R_coor.y ;
572574 int dRz = R_coor.z ;
573575
574- ModuleBase::Vector3<double > R_car = ModuleBase::Vector3<double >(dRx, dRy, dRz) * GlobalC:: ucell.latvec ;
576+ ModuleBase::Vector3<double > R_car = ModuleBase::Vector3<double >(dRx, dRy, dRz) * ucell.latvec ;
575577
576578 int ir = 0 ;
577579 int ic = 0 ;
@@ -607,8 +609,8 @@ void cal_r_overlap_R::out_rR_other(const int& istep, const std::set<Abfs::Vector
607609 int im2 = iw2im[orb_index_col];
608610
609611 ModuleBase::Vector3<double > r_distance
610- = (GlobalC:: ucell.atoms [it2].tau [ia2] - GlobalC:: ucell.atoms [it1].tau [ia1] + R_car)
611- * GlobalC:: ucell.lat0 ;
612+ = (ucell.atoms [it2].tau [ia2] - ucell.atoms [it1].tau [ia1] + R_car)
613+ * ucell.lat0 ;
612614
613615 double overlap_o = center2_orb11[it1][it2][iL1][iN1][iL2].at (iN2).cal_overlap (origin_point,
614616 r_distance,
@@ -641,7 +643,7 @@ void cal_r_overlap_R::out_rR_other(const int& istep, const std::set<Abfs::Vector
641643
642644 ModuleBase::Vector3<double > temp_prp
643645 = ModuleBase::Vector3<double >(overlap_x, overlap_y, overlap_z)
644- + GlobalC:: ucell.atoms [it1].tau [ia1] * GlobalC:: ucell.lat0 * overlap_o;
646+ + ucell.atoms [it1].tau [ia1] * ucell.lat0 * overlap_o;
645647
646648 if (std::abs (temp_prp.x ) > sparse_threshold)
647649 {
0 commit comments