Template Class CellListsLoop#
Defined in File cell_lists.hpp
Class Documentation#
-
template<class visitor_t, typename distance_policy = periodic_distance<3>>
class CellListsLoop# this does the looping over atom pairs within the cell lists framework.
This uses the visitor design pattern, in the same way that the Boost graph uses visitors for, e.g., breadth_first_search. http://www.boost.org/doc/libs/1_56_0/boost/graph/breadth_first_search.hpp
The visitor is called for every pair of atoms in the system. It is meant to be used for, e.g. accumulating the energy or the gradient.
We use a template rather than an interface because the visitor will be called many times over a short period and the additional overhead of an interface might be a problem.
Public Functions
- inline CellListsLoop(
- visitor_t &visitor,
- CellListsContainer<m_ndim> const &container,
- pele::LatticeNeighbors<distance_policy> lattice_tool
-
inline void loop_through_atom_pairs()#
- inline void loop_through_atom_pairs_specific( )#
- inline void loop_through_unique_pairs_containing_iatoms( )#
loop through unique pairs that contain elements of iatoms
for each iatom, this function loops through unique {iatom, jatom} pairs where jatom is an belongs to the cell or neighboring cells of iatom. This is useful to calculate energy changes when atoms corresponding to iatoms are moved.
- Parameters:
coords – the coordinates of the atoms
iatoms – list of indices (iatoms)
Protected Functions
- inline virtual void loop_cell_pairs(
- std::vector<std::array<cell_t*, 2>> const &neighbor_pairs,
- const size_t isubdom
- inline virtual void loop_cell_pairs_specific(
- std::vector<size_t> const &icells,
- std::vector<size_t> const &iatoms
- inline virtual void loop_through_cell_neighbors_for_unique_pairs(
- size_t cell_containing_iatom,
- size_t iatom,
- std::vector<size_t> const &iatoms
Protected Attributes
-
CellListsContainer<m_ndim> const &m_container#
-
LatticeNeighbors<distance_policy> m_lattice_tool#
Protected Static Attributes
-
static const size_t m_ndim = distance_policy::_ndim#