Template Class CellLists#

Class Documentation#

template<typename distance_policy = periodic_distance<3>>
class CellLists#

cell list currently only work with box of equal side lengths cell lists are currently not implemented for non cubic boxes: in that case m_ncellx should be an array rather than a scalar and the definition of ncells and rcell would change to array.

This implies that in all the function these would need to be replace with the correct array element. This adds room for errors so in this first implementation we do not account for that scenario

Public Functions

inline ~CellLists()#
CellLists(
std::shared_ptr<distance_policy> const &dist,
pele::Array<double> const &boxv,
const double rcut,
const double ncellx_scale = 1.0,
const bool balance_omp = true
)#

constructor

ncellx_scale scales the number of cells. The number of cells in each direction is computed from ncellx_scale * box_length / rcut

template<class callback_class>
inline CellListsLoop<callback_class, distance_policy> get_atom_pair_looper(
callback_class &callback
) const#

return the class which loops over the atom pairs with a callback function

inline size_t get_nr_cells() const#

return the total number of cells

inline size_t get_nr_cellsx() const#

return the number of cells in the x direction

inline pele::Array<size_t> get_order(const size_t natoms) const#
void update(pele::Array<double> const &coords)#

update the cell list iterator with new coordinates

update or re-build cell lists

void update_specific(
pele::Array<double> const &coords,
std::vector<size_t> const &iatoms,
std::vector<double> const &old_coords
)#

update or re-build (part of) the cell lists

Public Static Attributes

static const size_t m_ndim = distance_policy::_ndim#

Protected Functions

void print_warnings(const size_t natoms)#
void build_cell_neighbors_list()#

build the list of neighboring cells.

void reset_container(pele::Array<double> const &coords)#

remove all atoms and re-add them to the right cells according to the new coordinates

void update_container(pele::Array<double> const &coords)#

re-calculate the cells for all atoms according to new coordinates

void update_container_specific(
pele::Array<double> const &coords,
std::vector<size_t> const &iatoms,
std::vector<double> const &old_coords
)#

re-calculate the cells for the specified atoms according to new coordinates

Protected Attributes

bool m_initialized#
pele::LatticeNeighbors<distance_policy> m_lattice_tool#
std::vector<SafePushQueue<std::array<size_t, 2>>> add_atom_queue#
CellListsContainer<m_ndim> m_container#

m_container is the class which hold the actual cell lists

it also manages iterating through the pairs of atoms