Avogadro  1.1.0
Public Member Functions
Avogadro::NeighborList Class Reference

A list container for finding spatial neighbors of atoms. More...

#include <avogadro/neighborlist.h>

List of all members.

Public Member Functions

 NeighborList (Molecule *mol, double rcut, bool periodic=false, int boxSize=1)
 NeighborList (const QList< Atom * > &atoms, double rcut, bool periodic=false, int boxSize=1)
void update ()
QList< Atom * > nbrs (Atom *atom, bool uniqueOnly=true)
QList< Atom * > nbrs (const Eigen::Vector3f *pos)
double r2 (unsigned int index) const

Detailed Description

A list container for finding spatial neighbors of atoms.

Author:
Tim Vandermeersch

NeighborList can be used for finding non-bonded interactions between pairs of atoms. Based on: Near-neighbor calculations using a modified cell-linked list method Mattson, W.; B. M. Rice (1999). "Near-neighbor calculations using a modified cell-linked list method". Computer Physics Communications 119: 135.

http://dx.doi.org/10.1016/S0010-4655%2898%2900203-3


Constructor & Destructor Documentation

Avogadro::NeighborList::NeighborList ( Molecule mol,
double  rcut,
bool  periodic = false,
int  boxSize = 1 
)

Constructor to include all atoms.

Parameters:
molThe molecule containing the atoms
rcutThe cut-off distance.
boxSizeThe number of cells per rcut distance.

References Avogadro::Molecule::atoms().

Avogadro::NeighborList::NeighborList ( const QList< Atom * > &  atoms,
double  rcut,
bool  periodic = false,
int  boxSize = 1 
)

Construcor.

Parameters:
atomsThe atoms
rcutThe cut-off distance.
periodicUse periodic boundary conditions.
Thenumber of cells per rcut distance.

Member Function Documentation

QList< Atom * > Avogadro::NeighborList::nbrs ( Atom atom,
bool  uniqueOnly = true 
)

Get the near-neighbor atoms for atom. The squared distance is checked and is cached for later use (see r2() function).

Note: Atoms in relative 1-2 and 1-3 positions are not returned. The atom itself isn't added to the list.

Parameters:
atomThe atom for which to return the near-neighbors
Returns:
The near-neighbors for atom

References QList::append(), QList::clear(), Avogadro::Primitive::index(), and Avogadro::Atom::pos().

QList< Atom * > Avogadro::NeighborList::nbrs ( const Eigen::Vector3f *  pos)

Get the near-neighbor atoms around pos. The squared distance is checked and is cached for later use (see r2() function).

Parameters:
posThe position for which to return the near-neighbors
Returns:
The near-neighbors for atom

References QList::append(), and QList::clear().

double Avogadro::NeighborList::r2 ( unsigned int  index) const [inline]

Get the cached squared distance from the atom last used to call nbrs to the atom with index in the returned vector.

Parameters:
indexThe index for the atom in the vector of atoms returned by nbrs().
Returns:
The cached squared distance.

Update the cells. While minimizing or running MD simulations, atoms move and can go from on cell into the next. This function should be called every 10-20 iterations to make sure the cells stay accurate.


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