Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ These variables are used to control general system parameters.
- get_wf: Envelope function for LCAO basis. Please see the explanation for variable `nbands_istate`
- md: molecular dynamics
- test_memory : checks memory required for the calculation. The number is not quite reliable, please use it with care
- test_neighbour : only performs neighbouring atom search
- test_neighbour : only performs neighbouring atom search, please specify a positive [search_radius](#search_radius) manually.
- gen_bessel : generates projectors (a series of Bessel functions) for DeePKS; see also keywords bessel_descriptor_lmax, bessel_descriptor_rcut and bessel_descriptor_tolerence. A file named `jle.orb` will be generated which contains the projectors. An example is provided in examples/H2O-deepks-pw
- get_S : only works for multi-k calculation with LCAO basis. Generates and writes the overlap matrix to a file named `SR.csr` in the working directory. The format of the file will be the same as that generated by [out_mat_hs2](#out_mat_hs2)
- **Default**: scf
Expand Down Expand Up @@ -825,6 +825,7 @@ These variables are used to control the numerical atomic orbitals related parame
- **Type**: Real
- **Description**: Searching radius in finding the neighbouring atoms. By default the radius will be automatically determined by the cutoffs of orbitals and nonlocal beta projectors.
- **Default**: -1
- **Unit**: Bohr

### search_pbc

Expand Down
49 changes: 27 additions & 22 deletions source/module_cell/module_neighbor/sltk_atom_arrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,33 @@ void atom_arrange::search(
if(test_only)
{
ofs_in << " " << std::setw(5) << "Type" << std::setw(5) << "Atom" << std::setw(8) << "AdjNum" << std::endl;
for (int it = 0;it < ucell.ntype;it++)
{
for (int ia = 0;ia < ucell.atoms[it].na;ia++)
{
grid_d.Find_atom(ucell, ucell.atoms[it].tau[ia], it, ia);

ofs_in << " " << std::setw(5) << it << std::setw(5) << ia << std::setw(8) << grid_d.getAdjacentNum()+1 << std::endl;

for(int ad=0; ad < grid_d.getAdjacentNum()+1; ad++)
{
ModuleBase::Vector3<double> tau = grid_d.getAdjacentTau(ad);
ModuleBase::Vector3<int> box = grid_d.getBox(ad);
std::cout << std::setw(15) << tau.x << " " << std::setw(15) << tau.y << " " << std::setw(15) << tau.z << " "
<< std::setw(8) << box.x << std::setw(8) << box.y << std::setw(8) << box.z << std::endl;
}
}
}
ofs_in << "search neighboring atoms done." << std::endl;
}

ModuleBase::timer::tick("atom_arrange","search");
return;
std::cout << std::setw(8) << "Labels" << std::setw(15) << "tau.x" << std::setw(15) << "tau.y" << std::setw(15)
<< "tau.z" << std::setw(8) << "box.x" << std::setw(8) << "box.y" << std::setw(8) << "box.z"
<< std::endl;
for (int it = 0; it < ucell.ntype; it++)
{
for (int ia = 0; ia < ucell.atoms[it].na; ia++)
{
grid_d.Find_atom(ucell, ucell.atoms[it].tau[ia], it, ia);

ofs_in << " " << std::setw(5) << it << std::setw(5) << ia << std::setw(8) << grid_d.getAdjacentNum() + 1
<< std::endl;

for (int ad = 0; ad < grid_d.getAdjacentNum() + 1; ad++)
{
ModuleBase::Vector3<double> tau = grid_d.getAdjacentTau(ad);
ModuleBase::Vector3<int> box = grid_d.getBox(ad);
std::cout << std::setw(8) << ucell.atoms[it].label + std::to_string(ia + 1) << std::setw(15)
<< tau.x << " " << std::setw(15) << tau.y << " " << std::setw(15) << tau.z << " "
<< std::setw(8) << box.x << std::setw(8) << box.y << std::setw(8) << box.z << std::endl;
}
}
}
ofs_in << "search neighboring atoms done." << std::endl;
}

ModuleBase::timer::tick("atom_arrange", "search");
return;
}


Expand Down
10 changes: 5 additions & 5 deletions source/module_esolver/esolver_ks_lcao_elec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ void ESolver_KS_LCAO<TK, TR>::othercalculation(const int istep)
if (GlobalV::CALCULATION == "test_neighbour")
{
// test_search_neighbor();
GlobalV::SEARCH_RADIUS = atom_arrange::set_sr_NL(GlobalV::ofs_running,
GlobalV::OUT_LEVEL,
GlobalC::ORB.get_rcutmax_Phi(),
GlobalC::ucell.infoNL.get_rcutmax_Beta(),
GlobalV::GAMMA_ONLY_LOCAL);
if (GlobalV::SEARCH_RADIUS < 0)
{
std::cout << " SEARCH_RADIUS : " << GlobalV::SEARCH_RADIUS << std::endl;
std::cout << " please make sure search_radius > 0" << std::endl;
}

atom_arrange::search(GlobalV::SEARCH_PBC,
GlobalV::ofs_running,
Expand Down