Skip to content

Commit d8e4244

Browse files
committed
tmp debug
1 parent 860ce0f commit d8e4244

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

source/source_cell/module_neighbor/sltk_grid_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void Grid_Driver::Find_atom(const UnitCell& ucell,
3434
AdjacentAtomInfo* local_adjs = adjs == nullptr ? &this->adj_info : adjs;
3535
local_adjs->clear();
3636
const std::vector<FAtom*>& all_atom = all_adj_info[ntype][nnumber];
37-
37+
std::cout << "all_atom size: " << all_atom.size() << std::endl;
3838
for (const FAtom* atom: all_atom)
3939
{
4040
local_adjs->ntype.push_back(atom->type);

source/source_esolver/lcao_before_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
5050
orb_.get_rcutmax_Phi(),
5151
ucell.infoNL.get_rcutmax_Beta(),
5252
PARAM.globalv.gamma_only_local);
53-
53+
std::cout << "search radius for neighbor list: " << search_radius << std::endl;
5454
//! 3) use search_radius to search adj atoms
5555
atom_arrange::search(PARAM.globalv.search_pbc,
5656
GlobalV::ofs_running,

source/source_io/cal_pLpR.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

168170
void 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,

source/source_io/ctrl_output_lcao.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void ctrl_output_lcao(UnitCell& ucell,
258258
ModuleIO::AngularMomentumCalculator mylcalculator(
259259
inp.orbital_dir,
260260
ucell,
261-
inp.search_radius,
261+
std::max(inp.search_radius, orb.get_rcutmax_Phi()),
262262
inp.test_deconstructor,
263263
inp.test_grid,
264264
inp.test_atom_input,

0 commit comments

Comments
 (0)