ParM
parm
A molecular dynamics library
|
A fast algorithm for finding all pairs of neighboring atoms. More...
#include <trackers.hpp>
Public Types | |
typedef GridIterator | iterator |
typedef GridPairedIterator | pair_iter |
Public Member Functions | |
vector< uint > | neighbors (uint i) |
uint | get_loc (Vec v, Vec bsize) |
Grid (sptr< OriginBox > box, sptr< AtomGroup > atoms, const uint width=1) | |
/param width Number of divisions along all axes More... | |
Grid (sptr< OriginBox > box, sptr< AtomGroup > atoms, vector< uint > width) | |
/param widths Number of divisions along each axis More... | |
Grid (sptr< OriginBox > box, sptr< AtomGroup > atoms, const flt minwidth, const flt goalwidth) | |
/param minwidth The minimum size of a box, e.g. the widest diameter of a particle. More... | |
void | optimize_widths () |
Reshape the grid to optimize number of Atom pairs. More... | |
void | make_grid () |
Reshape the grid to optimize number of Atom pairs. More... | |
iterator | begin () |
Iterator over pairs. More... | |
iterator | end () |
pair_iter | pairs (AtomID a) |
Get all pairs of a specific Atom. More... | |
flt | time_to_edge (Atom &a) |
Find the amount of time until an Atom leaves its current cell. More... | |
flt | time_to_edge (uint i) |
vector< IDPair > | all_pairs () |
Return a list of all pairs. SLOW function, but useful for debugging. More... | |
vector< AtomID > | all_pairs (AtomID a) |
Return a list of all neighbors of a given Atom. SLOW function, but useful for debugging. More... | |
uint | numcells (uint i) |
uint | numcells () |
Public Attributes | |
sptr< OriginBox > | box |
sptr< AtomGroup > | atoms |
flt | minwidth |
minwidth is minimum size of a box, in real units. More... | |
flt | goalwidth |
goalwidth is how many atoms per box (goal). More... | |
uint | widths [NDIM] |
Number of box divisions per dimension. More... | |
vector< set< AtomID > > | gridlocs |
Atoms in each grid location. More... | |
Friends | |
class | GridIterator |
class | GridPairedIterator |
A fast algorithm for finding all pairs of neighboring atoms.
A Grid splits the OriginBox into "cells", where no cell is narrower than any Atom. For any given Atom, all atoms within the same cell or any neighboring cell are considered "neighbors".
typedef GridIterator Grid::iterator |
typedef GridPairedIterator Grid::pair_iter |
/param width Number of divisions along all axes
/param widths Number of divisions along each axis
Grid::Grid | ( | sptr< OriginBox > | box, |
sptr< AtomGroup > | atoms, | ||
const flt | minwidth, | ||
const flt | goalwidth | ||
) |
/param minwidth The minimum size of a box, e.g. the widest diameter of a particle.
/param goalwidth Number of atoms to try and fit per box.
vector< IDPair > Grid::all_pairs | ( | ) |
Return a list of all pairs. SLOW function, but useful for debugging.
Return a list of all neighbors of a given Atom. SLOW function, but useful for debugging.
Grid::iterator Grid::begin | ( | ) |
Iterator over pairs.
Grid::iterator Grid::end | ( | ) |
void Grid::make_grid | ( | ) |
Reshape the grid to optimize number of Atom pairs.
|
inline |
void Grid::optimize_widths | ( | ) |
Reshape the grid to optimize number of Atom pairs.
No-op if minwidth <= 1
or goalwidth <= 0
.
Grid::pair_iter Grid::pairs | ( | AtomID | a | ) |
Get all pairs of a specific Atom.
|
friend |
|
friend |
flt Grid::goalwidth |
goalwidth is how many atoms per box (goal).
See minwidth.
vector<set<AtomID> > Grid::gridlocs |
Atoms in each grid location.
flt Grid::minwidth |
minwidth is minimum size of a box, in real units.
This is used to calculate the widths of new boxes in optimize_widths()
.
May be 0 or negative, to indicate that optimize_widths()
should never change the box sizes.