@@ -156,13 +156,15 @@ ModuleIO::AngularMomentumCalculator::AngularMomentumCalculator(
156156 ucell.infoNL .get_rcutmax_Beta (),
157157 PARAM .globalv .gamma_only_local );
158158 temp = std::max (temp, search_radius);
159+ std::cout << " search radius for neighbor list: " << temp << std::endl;
159160 this ->neighbor_searcher_ = std::unique_ptr<Grid_Driver>(new Grid_Driver (tdestructor, tgrid));
160161 atom_arrange::search (searchpbc,
161162 *ofs_,
162163 *neighbor_searcher_,
163164 ucell,
164165 temp,
165166 tatom);
167+ std::cout << " neighbored atom num:" << neighbor_searcher_->getAdjacentNum () << std::endl;
166168}
167169
168170void ModuleIO::AngularMomentumCalculator::kernel (
@@ -171,10 +173,12 @@ void ModuleIO::AngularMomentumCalculator::kernel(
171173 const char dir,
172174 const int precision)
173175{
176+ std::cout << " begin kernel" << std::endl;
174177 if (!ofs->is_open ())
175178 {
176179 return ;
177180 }
181+ std::cout << " file check ok" << std::endl;
178182 // an easy sanity check
179183 assert (dir == ' x' || dir == ' y' || dir == ' z' );
180184
@@ -197,8 +201,11 @@ void ModuleIO::AngularMomentumCalculator::kernel(
197201 for (int ia = 0 ; ia < atyp_i.na ; ia++)
198202 {
199203 ri = atyp_i.tau [ia];
200- neighbor_searcher_->Find_atom (ucell, ri, it, ia);
201- for (int ia_adj = 0 ; ia_adj < neighbor_searcher_->getAdjacentNum (); ia_adj++)
204+ AdjacentAtomInfo adjs;
205+ neighbor_searcher_->Find_atom (ucell, ri, it, ia, &adjs);
206+ std::cout << " adjacent num: " << adjs.adj_num << std::endl;
207+ // bug: adj num is 0 here?!
208+ for (int ia_adj = 0 ; ia_adj < adjs.adj_num ; ia_adj++)
202209 {
203210 rj = neighbor_searcher_->getAdjacentTau (ia_adj);
204211 int jt = neighbor_searcher_->getType (ia_adj);
@@ -207,11 +214,14 @@ void ModuleIO::AngularMomentumCalculator::kernel(
207214 dr = (ri - rj) * ucell.lat0 ;
208215 const ModuleBase::Vector3<int > iR = neighbor_searcher_->getBox (ia_adj);
209216 // the two-center-integral
210-
217+ std::cout << " ia=" << ia << " ja=" << ja << " R=(" << iR.x << " ," << iR.y << " ," << iR.z << " )" << std::endl;
218+ std::cout << " nwl_i=" << atyp_i.nwl << " nw_i=" << atyp_i.nw << std::endl;
211219 for (int li = 0 ; li < atyp_i.nwl + 1 ; li++)
212220 {
221+ std::cout << " nchi=" << atyp_i.l_nchi [li] << std::endl;
213222 for (int iz = 0 ; iz < atyp_i.l_nchi [li]; iz++)
214223 {
224+ std::cout << " iz=" << iz << " li=" << li << std::endl;
215225 for (int mi = -li; mi <= li; mi++)
216226 {
217227 for (int lj = 0 ; lj < atyp_j.nwl + 1 ; lj++)
@@ -236,7 +246,11 @@ void ModuleIO::AngularMomentumCalculator::kernel(
236246 val = cal_LzijR (calculator_,
237247 it, ia, li, iz, mi, jt, ja, lj, jz, mj, dr);
238248 }
239-
249+ std::cout << fmt.format (
250+ it, ia, li, iz, mi,
251+ iR.x , iR.y , iR.z ,
252+ jt, ja, lj, jz, mj,
253+ val.real (), val.imag ());
240254 *ofs << fmt.format (
241255 it, ia, li, iz, mi,
242256 iR.x , iR.y , iR.z ,
0 commit comments