@@ -315,33 +315,32 @@ ModuleBase::Vector3<double> Grid_Driver::Calculate_adjacent_site
315315 return adjacent_site;
316316}
317317
318- #include " ../src_pw/global.h"
319- std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>> Grid_Driver::get_adjs (const size_t &iat)
318+ std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>> Grid_Driver::get_adjs (const UnitCell_pseudo& ucell_in, const size_t &iat)
320319{
321- const int it = GlobalC::ucell .iat2it [iat];
322- const int ia = GlobalC::ucell .iat2ia [iat];
323- const ModuleBase::Vector3<double > &tau = GlobalC::ucell .atoms [it].tau [ia];
320+ const int it = ucell_in .iat2it [iat];
321+ const int ia = ucell_in .iat2ia [iat];
322+ const ModuleBase::Vector3<double > &tau = ucell_in .atoms [it].tau [ia];
324323
325324 std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>> adjs;
326- GlobalC::GridD. Find_atom (GlobalC::ucell , tau, it, ia);
327- for (int ad=0 ; ad<GlobalC::GridD. getAdjacentNum ()+1 ; ad++)
325+ this -> Find_atom (ucell_in , tau, it, ia);
326+ for (int ad=0 ; ad<this -> getAdjacentNum ()+1 ; ad++)
328327 {
329- const size_t it_ad = GlobalC::GridD. getType (ad);
330- const size_t ia_ad = GlobalC::GridD. getNatom (ad);
331- const ModuleBase::Vector3<int > box_ad = GlobalC::GridD. getBox (ad);
332- const ModuleBase::Vector3<double > tau_ad = GlobalC::GridD. getAdjacentTau (ad);
328+ const size_t it_ad = this -> getType (ad);
329+ const size_t ia_ad = this -> getNatom (ad);
330+ const ModuleBase::Vector3<int > box_ad = this -> getBox (ad);
331+ const ModuleBase::Vector3<double > tau_ad = this -> getAdjacentTau (ad);
333332
334333 adjs.push_back (std::make_tuple (it_ad, ia_ad, box_ad, tau_ad));
335334 }
336335 return adjs;
337336}
338337
339- std::vector<std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>>> Grid_Driver::get_adjs ()
338+ std::vector<std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>>> Grid_Driver::get_adjs (const UnitCell_pseudo& ucell_in )
340339{
341- std::vector<std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>>> adjs (GlobalC::ucell .nat );
342- for (size_t iat=0 ; iat<GlobalC::ucell .nat ; iat++)
340+ std::vector<std::vector<std::tuple<int , int , ModuleBase::Vector3<int >, ModuleBase::Vector3<double >>>> adjs (ucell_in .nat );
341+ for (size_t iat=0 ; iat<ucell_in .nat ; iat++)
343342 {
344- adjs[iat] = Grid_Driver::get_adjs (iat);
343+ adjs[iat] = Grid_Driver::get_adjs (ucell_in, iat);
345344 }
346345 return adjs;
347346}
0 commit comments