Grid_Driver class for neighbor search interface.
More...
#include <sltk_grid_driver.h>
|
| | Grid_Driver () |
| | Default constructor.
|
| | Grid_Driver (const int &test_d_in, const int &test_grid_in) |
| | Constructor with test flags.
|
| | ~Grid_Driver () |
| | Destructor.
|
| Grid_Driver & | operator= (Grid_Driver &&)=default |
| void | Find_atom (const UnitCell &ucell, const int ntype, const int nnumber, AdjacentAtomInfo *adjs=nullptr) const |
| | Find adjacent atoms for a given atom.
|
| void | Find_atom (const UnitCell &ucell, const ModuleBase::Vector3< double > &cartesian_posi, const int &ntype, const int &nnumber, AdjacentAtomInfo *adjs=nullptr) const |
| | Find adjacent atoms for a given cartesian position (deprecated).
|
| const int & | getAdjacentNum () const |
| | Get the number of adjacent atoms.
|
| const int & | getType (const int i) const |
| | Get the type of an adjacent atom.
|
| const int & | getNatom (const int i) const |
| | Get the index of an adjacent atom.
|
| const ModuleBase::Vector3< double > & | getAdjacentTau (const int i) const |
| | Get the position of an adjacent atom.
|
| const ModuleBase::Vector3< int > & | getBox (const int i) const |
| | Get the box indices of an adjacent atom.
|
| const AdjacentAtomInfo & | getAdjacentInfo () const |
| | Get the whole adjacent atom information.
|
| | Grid () |
| | Default constructor.
|
| | Grid (const int &test_grid_in) |
| | Constructor with test flag.
|
| virtual | ~Grid () |
| | Destructor.
|
| Grid & | operator= (Grid &&)=default |
| void | init (std::ofstream &ofs, const UnitCell &ucell, const double radius_in, const bool boundary=true) |
| | Initialize the grid.
|
| void | getBox (int &bx, int &by, int &bz, const double &x, const double &y, const double &z) |
| | Get box indices for given coordinates.
|
| void | clear_atoms () |
| | Clear all atoms and adjacent information.
|
| void | clear_adj_info () |
| | Clear adjacent information only.
|
| int | getGlayerX () const |
| int | getGlayerY () const |
| int | getGlayerZ () const |
| int | getGlayerX_minus () const |
| int | getGlayerY_minus () const |
| int | getGlayerZ_minus () const |
|
| bool | pbc =false |
| | Data.
|
| double | sradius2 =0.0 |
| | searching radius squared (unit:lat0)
|
| double | sradius =0.0 |
| | searching radius (unit:lat0)
|
| double | x_min =0.0 |
| | coordinate range of the input atom (unit:lat0)
|
| double | y_min =0.0 |
| double | z_min =0.0 |
| double | x_max =0.0 |
| double | y_max =0.0 |
| double | z_max =0.0 |
| double | box_edge_length =0.0 |
| | box edge length (equal to sradius)
|
| int | box_nx =0 |
| | number of boxes in x direction
|
| int | box_ny =0 |
| | number of boxes in y direction
|
| int | box_nz =0 |
| | number of boxes in z direction
|
| std::vector< std::vector< std::vector< AtomMap > > > | atoms_in_box |
| | Stores the atoms after box partitioning.
|
| std::vector< std::vector< std::vector< FAtom * > > > | all_adj_info |
| | Stores the adjacent information of atoms. [ntype][natom][adj list].
|
Grid_Driver class for neighbor search interface.
This class provides the user interface for finding adjacent atoms.
◆ Grid_Driver() [1/2]
| Grid_Driver::Grid_Driver |
( |
| ) |
|
|
inline |
◆ Grid_Driver() [2/2]
| Grid_Driver::Grid_Driver |
( |
const int & | test_d_in, |
|
|
const int & | test_grid_in ) |
Constructor with test flags.
- Parameters
-
| test_d_in | test deconstructor flag |
| test_grid_in | test grid flag |
◆ ~Grid_Driver()
| Grid_Driver::~Grid_Driver |
( |
| ) |
|
◆ Find_atom() [1/2]
| void Grid_Driver::Find_atom |
( |
const UnitCell & | ucell, |
|
|
const int | ntype, |
|
|
const int | nnumber, |
|
|
AdjacentAtomInfo * | adjs = nullptr ) const |
Find adjacent atoms for a given atom.
- Note
- This design makes Grid_Driver compatible with multi-thread usage:
- Find_atom stores results in Grid_Driver::adj_info by default.
- And stores results into parameter adjs when adjs is NOT NULL.
- Parameters
-
| ucell | unit cell |
| ntype | atom type |
| nnumber | atom index within type |
| adjs | optional output adjacent atom information |
◆ Find_atom() [2/2]
Find adjacent atoms for a given cartesian position (deprecated).
- Deprecated
- This interface is deprecated, please use Find_atom above.
- Note
- cartesian_posi and ucell are deprecated 20241204 zhanghaochong
- Parameters
-
| ucell | unit cell |
| cartesian_posi | cartesian position |
| ntype | atom type |
| nnumber | atom index within type |
| adjs | optional output adjacent atom information |
◆ getAdjacentInfo()
Get the whole adjacent atom information.
- Returns
- adjacent atom information
◆ getAdjacentNum()
| const int & Grid_Driver::getAdjacentNum |
( |
| ) |
const |
|
inline |
Get the number of adjacent atoms.
- Returns
- number of adjacent atoms
◆ getAdjacentTau()
Get the position of an adjacent atom.
- Parameters
-
- Returns
- position of adjacent atom
◆ getBox()
Get the box indices of an adjacent atom.
- Parameters
-
- Returns
- box indices of adjacent atom
◆ getNatom()
| const int & Grid_Driver::getNatom |
( |
const int | i | ) |
const |
|
inline |
Get the index of an adjacent atom.
- Parameters
-
- Returns
- index of adjacent atom
◆ getType()
| const int & Grid_Driver::getType |
( |
const int | i | ) |
const |
|
inline |
Get the type of an adjacent atom.
- Parameters
-
- Returns
- type of adjacent atom
◆ operator=()
◆ adj_info
adjacent atom information
◆ test_deconstructor
| bool Grid_Driver::test_deconstructor |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_cell/module_neighbor/sltk_grid_driver.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_cell/module_neighbor/sltk_grid_driver.cpp
- /home/runner/work/abacus-develop/abacus-develop/source/source_estate/module_dm/unittests/tmp_mocks.cpp
- /home/runner/work/abacus-develop/abacus-develop/source/source_lcao/module_operator_lcao/test/tmp_mocks.cpp
- /home/runner/work/abacus-develop/abacus-develop/source/source_lcao/test/tmp_mocks.cpp