22 #ifndef __PLUMED_tools_NeighborList_h
23 #define __PLUMED_tools_NeighborList_h
54 const std::vector<PLMD::AtomNumber>& list1,
55 const bool& do_pair,
const bool& do_pbc,
const PLMD::Pbc& pbc,
56 const double& distance=1.0e+30,
const unsigned& stride=0);
57 NeighborList(
const std::vector<PLMD::AtomNumber>& list0,
const bool& do_pbc,
58 const PLMD::Pbc& pbc,
const double& distance=1.0e+30,
59 const unsigned& stride=0);
68 void update(
const std::vector<PLMD::Vector>& positions);
76 unsigned size()
const;
78 std::pair<unsigned,unsigned>
getClosePair(
unsigned i)
const;
std::vector< std::pair< unsigned, unsigned > > neighbors_
std::vector< PLMD::AtomNumber > & getFullAtomList()
Return the list of all atoms. These are needed to rebuild the neighbor list.
std::vector< unsigned > getNeighbors(unsigned i)
Get the list of neighbors of the i-th atom.
std::vector< PLMD::AtomNumber > requestlist_
std::vector< PLMD::AtomNumber > fullatomlist_
void setRequestList()
Extract the list of atoms from the current list of close pairs.
void update(const std::vector< PLMD::Vector > &positions)
Update the neighbor list and prepare the new list of atoms that will be requested to the main code...
void setLastUpdate(unsigned step)
Set the step of the last update.
A class that implements neighbor lists from two lists or a single list of atoms.
std::pair< unsigned, unsigned > getClosePair(unsigned i) const
Get the i-th pair of the neighbor list.
std::pair< unsigned, unsigned > getIndexPair(unsigned i)
Return the pair of indexes in the positions array of the two atoms forming the i-th pair among all po...
void initialize()
Initialize the neighbor list with all possible pairs.
unsigned getStride() const
Get the update stride of the neighbor list.
std::vector< PLMD::AtomNumber > & getReducedAtomList()
Update the indexes in the neighbor list to match the ordering in the new positions array and return t...
unsigned getLastUpdate() const
Get the last step in which the neighbor list was updated.
NeighborList(const std::vector< PLMD::AtomNumber > &list0, const std::vector< PLMD::AtomNumber > &list1, const bool &do_pair, const bool &do_pbc, const PLMD::Pbc &pbc, const double &distance=1.0e+30, const unsigned &stride=0)
unsigned size() const
Get the size of the neighbor list.