88#include " module_base/blas_connector.h"
99#include " module_base/timer.h"
1010#include " module_base/array_pool.h"
11+ #include " module_base/vector3.h"
1112// #include <mkl_cblas.h>
1213
1314#ifdef _OPENMP
@@ -40,18 +41,14 @@ void Gint::cal_meshball_vlocal(
4041 const int bcell1 = mcell_index + ia1;
4142 const int iat1 = this ->gridt ->which_atom [bcell1];
4243 const int id1 = this ->gridt ->which_unitcell [bcell1];
43- const int r1x = this ->gridt ->ucell_index2x [id1];
44- const int r1y = this ->gridt ->ucell_index2y [id1];
45- const int r1z = this ->gridt ->ucell_index2z [id1];
44+ const ModuleBase::Vector3<int > r1 = this ->gridt ->get_ucell_coords (id1);
4645
4746 for (int ia2=0 ; ia2<na_grid; ++ia2)
4847 {
4948 const int bcell2 = mcell_index + ia2;
5049 const int iat2= this ->gridt ->which_atom [bcell2];
5150 const int id2 = this ->gridt ->which_unitcell [bcell2];
52- const int r2x = this ->gridt ->ucell_index2x [id2];
53- const int r2y = this ->gridt ->ucell_index2y [id2];
54- const int r2z = this ->gridt ->ucell_index2z [id2];
51+ const ModuleBase::Vector3<int > r2 = this ->gridt ->get_ucell_coords (id2);
5552
5653 if (iat1<=iat2)
5754 {
@@ -76,12 +73,7 @@ void Gint::cal_meshball_vlocal(
7673 const int ib_length = last_ib-first_ib;
7774 if (ib_length<=0 ) { continue ; }
7875
79- // calculate the BaseMatrix of <iat1, iat2, R> atom-pair
80- const int dRx = r1x - r2x;
81- const int dRy = r1y - r2y;
82- const int dRz = r1z - r2z;
83-
84- const auto tmp_matrix = hR->find_matrix (iat1, iat2, dRx, dRy, dRz);
76+ const auto tmp_matrix = hR->find_matrix (iat1, iat2, r1-r2);
8577 if (tmp_matrix == nullptr )
8678 {
8779 continue ;
0 commit comments