All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PLMD::NeighborList Class Reference

A class that implements neighbor lists from two lists or a single list of atoms. More...

#include <NeighborList.h>

Public Member Functions

 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)
 
 NeighborList (const std::vector< PLMD::AtomNumber > &list0, const bool &do_pbc, const PLMD::Pbc &pbc, const double &distance=1.0e+30, const unsigned &stride=0)
 
std::vector< PLMD::AtomNumber > & getFullAtomList ()
 Return the list of all atoms. These are needed to rebuild the neighbor list. More...
 
std::vector< PLMD::AtomNumber > & getReducedAtomList ()
 Update the indexes in the neighbor list to match the ordering in the new positions array and return the new list of atoms that must be requested to the main code. More...
 
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. More...
 
unsigned getStride () const
 Get the update stride of the neighbor list. More...
 
unsigned getLastUpdate () const
 Get the last step in which the neighbor list was updated. More...
 
void setLastUpdate (unsigned step)
 Set the step of the last update. More...
 
unsigned size () const
 Get the size of the neighbor list. More...
 
std::pair< unsigned, unsigned > getClosePair (unsigned i) const
 Get the i-th pair of the neighbor list. More...
 
std::vector< unsigned > getNeighbors (unsigned i)
 Get the list of neighbors of the i-th atom. More...
 
 ~NeighborList ()
 

Private Member Functions

void initialize ()
 Initialize the neighbor list with all possible pairs. More...
 
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 possible pairs. More...
 
void setRequestList ()
 Extract the list of atoms from the current list of close pairs. More...
 

Private Attributes

bool reduced
 
bool do_pair_
 
bool do_pbc_
 
bool twolists_
 
const PLMD::Pbcpbc_
 
std::vector< PLMD::AtomNumberfullatomlist_
 
std::vector< PLMD::AtomNumberrequestlist_
 
std::vector< std::pair
< unsigned, unsigned > > 
neighbors_
 
double distance_
 
unsigned stride_
 
unsigned nlist0_
 
unsigned nlist1_
 
unsigned nallpairs_
 
unsigned lastupdate_
 

Detailed Description

A class that implements neighbor lists from two lists or a single list of atoms.

Definition at line 36 of file NeighborList.h.

Constructor & Destructor Documentation

PLMD::NeighborList::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 
)

Definition at line 33 of file NeighborList.cpp.

PLMD::NeighborList::NeighborList ( const std::vector< PLMD::AtomNumber > &  list0,
const bool &  do_pbc,
const PLMD::Pbc pbc,
const double &  distance = 1.0e+30,
const unsigned &  stride = 0 
)

Definition at line 55 of file NeighborList.cpp.

PLMD::NeighborList::~NeighborList ( )
inline

Definition at line 81 of file NeighborList.h.

Member Function Documentation

pair< unsigned, unsigned > PLMD::NeighborList::getClosePair ( unsigned  i) const

Get the i-th pair of the neighbor list.

Definition at line 156 of file NeighborList.cpp.

vector< AtomNumber > & PLMD::NeighborList::getFullAtomList ( )

Return the list of all atoms. These are needed to rebuild the neighbor list.

Definition at line 75 of file NeighborList.cpp.

pair< unsigned, unsigned > PLMD::NeighborList::getIndexPair ( unsigned  i)
private

Return the pair of indexes in the positions array of the two atoms forming the i-th pair among all possible pairs.

Definition at line 79 of file NeighborList.cpp.

unsigned PLMD::NeighborList::getLastUpdate ( ) const

Get the last step in which the neighbor list was updated.

Definition at line 144 of file NeighborList.cpp.

vector< unsigned > PLMD::NeighborList::getNeighbors ( unsigned  i)

Get the list of neighbors of the i-th atom.

Definition at line 160 of file NeighborList.cpp.

vector< AtomNumber > & PLMD::NeighborList::getReducedAtomList ( )

Update the indexes in the neighbor list to match the ordering in the new positions array and return the new list of atoms that must be requested to the main code.

Definition at line 125 of file NeighborList.cpp.

unsigned PLMD::NeighborList::getStride ( ) const

Get the update stride of the neighbor list.

Definition at line 140 of file NeighborList.cpp.

void PLMD::NeighborList::initialize ( )
private

Initialize the neighbor list with all possible pairs.

Definition at line 68 of file NeighborList.cpp.

void PLMD::NeighborList::setLastUpdate ( unsigned  step)

Set the step of the last update.

Definition at line 148 of file NeighborList.cpp.

void PLMD::NeighborList::setRequestList ( )
private

Extract the list of atoms from the current list of close pairs.

Definition at line 115 of file NeighborList.cpp.

unsigned PLMD::NeighborList::size ( ) const

Get the size of the neighbor list.

Definition at line 152 of file NeighborList.cpp.

void PLMD::NeighborList::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.

Definition at line 94 of file NeighborList.cpp.

Member Data Documentation

double PLMD::NeighborList::distance_
private

Definition at line 43 of file NeighborList.h.

bool PLMD::NeighborList::do_pair_
private

Definition at line 39 of file NeighborList.h.

bool PLMD::NeighborList::do_pbc_
private

Definition at line 39 of file NeighborList.h.

std::vector<PLMD::AtomNumber> PLMD::NeighborList::fullatomlist_
private

Definition at line 41 of file NeighborList.h.

unsigned PLMD::NeighborList::lastupdate_
private

Definition at line 44 of file NeighborList.h.

unsigned PLMD::NeighborList::nallpairs_
private

Definition at line 44 of file NeighborList.h.

std::vector<std::pair<unsigned,unsigned> > PLMD::NeighborList::neighbors_
private

Definition at line 42 of file NeighborList.h.

unsigned PLMD::NeighborList::nlist0_
private

Definition at line 44 of file NeighborList.h.

unsigned PLMD::NeighborList::nlist1_
private

Definition at line 44 of file NeighborList.h.

const PLMD::Pbc* PLMD::NeighborList::pbc_
private

Definition at line 40 of file NeighborList.h.

bool PLMD::NeighborList::reduced
private

Definition at line 38 of file NeighborList.h.

std::vector<PLMD::AtomNumber> PLMD::NeighborList::requestlist_
private

Definition at line 41 of file NeighborList.h.

unsigned PLMD::NeighborList::stride_
private

Definition at line 44 of file NeighborList.h.

bool PLMD::NeighborList::twolists_
private

Definition at line 39 of file NeighborList.h.


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