ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LCAO_domain::Grid_Driver Class Reference

Grid_Driver class for neighbor search interface. More...

Inheritance diagram for LCAO_domain::Grid_Driver:
Collaboration diagram for LCAO_domain::Grid_Driver:

Public Member Functions

 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.
Public Member Functions inherited from LCAO_domain::Grid
 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

Private Attributes

AdjacentAtomInfo adj_info
 adjacent atom information
bool test_deconstructor
 test deconstructor flag

Additional Inherited Members

Public Attributes inherited from LCAO_domain::Grid
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].

Detailed Description

Grid_Driver class for neighbor search interface.

This class provides the user interface for finding adjacent atoms.

Constructor & Destructor Documentation

◆ Grid_Driver() [1/2]

LCAO_domain::Grid_Driver::Grid_Driver ( )
inline

Default constructor.

◆ Grid_Driver() [2/2]

LCAO_domain::Grid_Driver::Grid_Driver ( const int & test_d_in,
const int & test_grid_in )

Constructor with test flags.

Parameters
test_d_intest deconstructor flag
test_grid_intest grid flag

◆ ~Grid_Driver()

LCAO_domain::Grid_Driver::~Grid_Driver ( )

Destructor.

Member Function Documentation

◆ Find_atom() [1/2]

void LCAO_domain::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:
  1. Find_atom stores results in Grid_Driver::adj_info by default.
  2. And stores results into parameter adjs when adjs is NOT NULL.
Parameters
ucellunit cell
ntypeatom type
nnumberatom index within type
adjsoptional output adjacent atom information
Here is the caller graph for this function:

◆ Find_atom() [2/2]

void LCAO_domain::Grid_Driver::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).

Deprecated
This interface is deprecated, please use Find_atom above.
Note
cartesian_posi and ucell are deprecated 20241204 zhanghaochong
Parameters
ucellunit cell
cartesian_posicartesian position
ntypeatom type
nnumberatom index within type
adjsoptional output adjacent atom information

◆ getAdjacentInfo()

const AdjacentAtomInfo & LCAO_domain::Grid_Driver::getAdjacentInfo ( ) const
inline

Get the whole adjacent atom information.

Returns
adjacent atom information

◆ getAdjacentNum()

const int & LCAO_domain::Grid_Driver::getAdjacentNum ( ) const
inline

Get the number of adjacent atoms.

Returns
number of adjacent atoms

◆ getAdjacentTau()

const ModuleBase::Vector3< double > & LCAO_domain::Grid_Driver::getAdjacentTau ( const int i) const
inline

Get the position of an adjacent atom.

Parameters
iindex of adjacent atom
Returns
position of adjacent atom

◆ getBox()

const ModuleBase::Vector3< int > & LCAO_domain::Grid_Driver::getBox ( const int i) const
inline

Get the box indices of an adjacent atom.

Parameters
iindex of adjacent atom
Returns
box indices of adjacent atom

◆ getNatom()

const int & LCAO_domain::Grid_Driver::getNatom ( const int i) const
inline

Get the index of an adjacent atom.

Parameters
iindex of adjacent atom
Returns
index of adjacent atom

◆ getType()

const int & LCAO_domain::Grid_Driver::getType ( const int i) const
inline

Get the type of an adjacent atom.

Parameters
iindex of adjacent atom
Returns
type of adjacent atom

◆ operator=()

Grid_Driver & LCAO_domain::Grid_Driver::operator= ( Grid_Driver && )
default

Member Data Documentation

◆ adj_info

AdjacentAtomInfo LCAO_domain::Grid_Driver::adj_info
mutableprivate

adjacent atom information

◆ test_deconstructor

bool LCAO_domain::Grid_Driver::test_deconstructor
private

test deconstructor flag


The documentation for this class was generated from the following file: