ParM
parm
A molecular dynamics library
|
A mapping of Atom -> [list of Atom], used by NeighborList to keep track of what atoms are near what other atoms. More...
#include <trackers.hpp>
Public Member Functions | |
PairList () | |
void | ensure (const AtomID a) |
Ensure that a given Atom is in the overall list. More... | |
void | ensure (vector< AtomID > ps) |
Ensure that every Atom in input is in the overall list. More... | |
void | ensure (AtomGroup &group) |
Ensure that every Atom in input is in the overall list. More... | |
bool | has_pair (AtomID a1, AtomID a2) |
Check if a given pair is is the list. More... | |
void | add_pair (AtomID a1, AtomID a2) |
Add a pair to the list. More... | |
void | erase_pair (AtomID a1, AtomID a2) |
Remove a pair from the list. More... | |
set< AtomID > | get_pairs (const AtomID a) |
Get all atoms neighboring an Atom that are "lesser" than the Atom. More... | |
set< AtomID >::iterator | begin (const AtomID a) |
for iterating over neighbors More... | |
set< AtomID >::iterator | end (const AtomID a) |
for iterating over neighbors More... | |
uint | size () const |
for iterating over neighbors More... | |
void | clear () |
Clear the inner lists. More... | |
Protected Attributes | |
map< const AtomID, set< AtomID > > | pairs |
A mapping of Atom -> [list of Atom], used by NeighborList to keep track of what atoms are near what other atoms.
Pairs are assumed to be symmetric, i.e. either (a1, a2)
is stored or (a2, a1)
is stored, and only one will be returned through the iterator.
|
inline |
Add a pair to the list.
If already in the list, nothing changes.
void PairList::clear | ( | ) |
Clear the inner lists.
|
inline |
Ensure that every Atom in input is in the overall list.
|
inline |
Ensure that every Atom in input is in the overall list.
Remove a pair from the list.
If not already in the list, nothing changes.
Get all atoms neighboring an Atom that are "lesser" than the Atom.
Because of the way neighbors are stored, there is no easy way to actually get all neighbors of an Atom, but if get_pairs
is called successively on all atoms, it will return each and every pair exactly once (including "false positives").
Check if a given pair is is the list.
Note that has_pair(a1, a2) == has_pair(a2, a1)
.
|
inline |
for iterating over neighbors