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

A single bin in the 3D binning grid for neighbor search. More...

#include <bin_manager.h>

Collaboration diagram for Bin:

Public Member Functions

 Bin ()=default
 Default constructor.
 ~Bin ()=default
 Default destructor.
const std::vector< ModuleNeighList::LocalAtomIndex > & get_atom_indices () const
 Get the atom indices stored in this bin.
void set_id (int ix, int iy, int iz)
 Set the grid indices for this bin.
void clear_atoms ()
 Clear all atoms from this bin.
void add_atom_index (ModuleNeighList::LocalAtomIndex atom_index)
 Add an atom index to this bin.

Private Attributes

int id_x_ = 0
 X index in the 3D bin grid.
int id_y_ = 0
 Y index in the 3D bin grid.
int id_z_ = 0
 Z index in the 3D bin grid.
std::vector< ModuleNeighList::LocalAtomIndex > atom_indices_
 Indices into the atom vector passed to BinManager::do_binning().

Detailed Description

A single bin in the 3D binning grid for neighbor search.

Each bin stores indices of atoms that fall within its spatial region, along with its position indices in the 3D grid.

Constructor & Destructor Documentation

◆ Bin()

Bin::Bin ( )
default

Default constructor.

◆ ~Bin()

Bin::~Bin ( )
default

Default destructor.

Member Function Documentation

◆ add_atom_index()

void Bin::add_atom_index ( ModuleNeighList::LocalAtomIndex atom_index)

Add an atom index to this bin.

Parameters
atom_indexIndex of the atom in the vector passed to BinManager::do_binning().

◆ clear_atoms()

void Bin::clear_atoms ( )

Clear all atoms from this bin.

◆ get_atom_indices()

const std::vector< ModuleNeighList::LocalAtomIndex > & Bin::get_atom_indices ( ) const

Get the atom indices stored in this bin.

Returns
Const reference to the atom-index vector.

◆ set_id()

void Bin::set_id ( int ix,
int iy,
int iz )

Set the grid indices for this bin.

Parameters
ixX index.
iyY index.
izZ index.

Member Data Documentation

◆ atom_indices_

std::vector<ModuleNeighList::LocalAtomIndex> Bin::atom_indices_
private

Indices into the atom vector passed to BinManager::do_binning().

◆ id_x_

int Bin::id_x_ = 0
private

X index in the 3D bin grid.

◆ id_y_

int Bin::id_y_ = 0
private

Y index in the 3D bin grid.

◆ id_z_

int Bin::id_z_ = 0
private

Z index in the 3D bin grid.


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