32 int defaultNeighborEstimate = 50);
55 double r = -1.0)
const;
The main list of atoms class.
NeighborList(Atoms *a, double rCut, double driftfactor=0.05, int defaultNeighborEstimate=50)
Generate a neighbor list for atoms a with cutoff rCut.
int * indices
Offsets into neighborList giving each atom's neighbors.
double drift2
The square of the maximally allowed drift of an atom.
double rCut2
The square of the cutoff radius.
void UpdateSuperCell(const SuperCell *superCell)
Inform the neighbor list that the supercell has changed.
Atoms * atoms
A pointer to the atoms.
bool CheckAndUpdateNeighborList()
Check if the neighbor list can still be reused, update if not.
int nMax
The size of the neighborList array.
const Image & GetImage(int i)
Get the real atom corresponding to an image.
void Allocate()
(Re)allocate the memory for the neighbor list.
int GetNumberOfAtoms() const
Get the number of atoms in the corresponding list of atoms.
Vec * positions
A pointer into the positions array of the atoms.
void MakeList()
Generate a new neighbor list.
int * neighborList
The actual neighbor list.
vector< Image > images
The images of neighbors through PBC.
double rMax
Cutoff when generating neighbor list.
vector< Vec > referencePositions
The positions at the last update.
const int * GetList(int a, int &n)
Low-level interface to the neighbor list.
int GetNeighbors(int n, int *neighbors, Vec *diffs, double *diffs2, int &size, double r=-1.0) const
Get all neighbors of atom n. The most important method :-).
int nAtoms
The number of atoms.
int MaxNeighborListLength() const
Return the guaranteed maximal length of a single atom's NB list.
void UpdateImagePositions()
Update the positions of the images when the real atoms may have moved.
int maxlistlen
The length of the longest neighbor list of an atom.
int nSize
Number of atoms including ghost atoms.
The SuperCell defines the size, shape and boundary condx of a simulation.
A 3-vector useful for postions etc.
Represents atoms seen through the periodic boundaries.