Path Integral Quantum Monte Carlo
Public Member Functions | Data Fields
LookupTable Class Reference

The particle (bead) lookup table. More...

#include <lookuptable.h>

+ Collaboration diagram for LookupTable:

Public Member Functions

 LookupTable (const Container *, const int, const int)
 Initilialize the nearest neighbor lookup table. More...
 
 ~LookupTable ()
 Free all blitz arrays.
 
iVec getNumNNGrid ()
 Return the number of NN grid boxes.
 
int getTotNumGridBoxes ()
 Return the total number of grid boxes.
 
void updateInteractionList (const Path &, const beadLocator &)
 Update the NN lookup table and the array of beadLocators containing all beads which 'interact' with the supplied bead1.
 
void updateFullInteractionList (const beadLocator &, const int)
 Fill up the fullBeadList array with a list of beads in the same grid box as the supplied beadIndex and its nearest neighbors at the supplied time slice.
 
void updateFullInteractionList (const int, const int)
 Fill up the fullBeadList array with a list of beads in the supplied grid box indexed by its number and all its nearest neighbors at the supplied time slice.
 
void updateGrid (const Path &)
 We update the full nearest neighbor grid by filling up all data arrays at all time slices.
 
void updateGrid (const Array< dVec, 1 > &)
 Update the full nearest neighbor for a set of fixed particles, which are never updated and have the same position at all time slices.
 
void printGrid ()
 Print the NN Lookup table.
 
void delBead (const beadLocator &)
 Remove a single bead from the NN grid.
 
void addBead (const beadLocator &, const dVec &)
 Add a single bead to the NN grid and position pos.
 
void updateBead (const beadLocator &, const dVec &)
 Update the NN grid with a new bead position.
 
iVec gridIndex (const dVec &)
 Given a particle position, return the grid index for the nearest neighbor lookup table.
 
int gridNumber (const dVec &)
 Given a particle position, return the grid number for the nearest neighbor lookup table.
 
iVec gridIndex (int)
 Given the number of a grid box, returns its coordinates as a NDIM-vector.
 
int gridNumber (const iVec &)
 Given the grid index of a box, return its grid number.
 
void resizeList (int _numParticles)
 Resize the bead and grid lists.
 
bool gridNeighbors (const beadLocator &, const beadLocator &)
 Given two beadIndices, determine if the beads lie in neighboring grid boxes.
 
bool gridShare (const beadLocator &bead1, const beadLocator &bead2)
 Determine if two beads are in the same grid box.
 

Data Fields

const ContainerboxPtr
 The simulation cell.
 
int numUniqueNN
 The number of unique nearest neighbors of each box.
 
int numNN
 The total number of nearest neighbors of each box.
 
Array< beadLocator, 1 > beadList
 The cutoff dynamic list of interacting beads.
 
Array< beadLocator, 1 > fullBeadList
 The full dynamic list of interacting beads.
 
Array< dVec, 1 > beadSep
 The separation between beads.
 
int numBeads
 The cutoff number of active beads in beadList;.
 
int fullNumBeads
 The full number of active beads in beadList;.
 

Detailed Description

The particle (bead) lookup table.

Holds the lookup table and methods for finding where in the simulation cell a particle is located, and which particles are close enough to interact. Accomplishes this by partitioning the simulation cell and storing the box at ever time slice where a bead is located.

Definition at line 29 of file lookuptable.h.

Constructor & Destructor Documentation

◆ LookupTable()

LookupTable::LookupTable ( const Container _boxPtr,
const int  _numLookupTimeSlices,
const int  _numParticles 
)

Initilialize the nearest neighbor lookup table.

We partition the simulation cell into a grid of boxes whose edge length is defined by the global potential cutoff radius rc. All date structures are initialized to be empty. We must call an updateBeads method externally in order to place the worldlines in the lookup table.

Definition at line 26 of file lookuptable.cpp.

27  :
28  boxPtr(_boxPtr),
29  numLookupTimeSlices(_numLookupTimeSlices)
30 {
31  /* Setup the nearest neighbor grid list */
32  setupNNGrid();
33 
34  /* We begin with the assumption of evenly distributed particles, therefore
35  * there could be numLabels in each cell, allowing for some breathing room */
36  for (int i = 0; i < NDIM; i++)
37  hashSize[i] = numNNGrid[i];
38  hashSize[NDIM] = numLookupTimeSlices;
39  hashSize[NDIM+1] = static_cast<int>(_numParticles/totNumGridBoxes) + 5;
40 
41  /* Resize and initialize the main hash array */
42  hash.resize(hashSize);
43  hash = XXX;
44 
45  /* Resize and initialize the grid and bead label and list arrays */
46  resizeList(_numParticles);
47  grid = XXX;
48  beadLabel= XXX;
49  beadList = XXX;
50  fullBeadList = XXX;
51  beadSep = 0.0;
52 
53  /* Initialize the cutoff^2 */
54  rc2 = constants()->rc2();
55 }
double rc2() const
Get potential cutoff squared.
Definition: constants.h:48
Array< beadLocator, 1 > beadList
The cutoff dynamic list of interacting beads.
Definition: lookuptable.h:40
void resizeList(int _numParticles)
Resize the bead and grid lists.
Definition: lookuptable.h:78
Array< dVec, 1 > beadSep
The separation between beads.
Definition: lookuptable.h:42
Array< beadLocator, 1 > fullBeadList
The full dynamic list of interacting beads.
Definition: lookuptable.h:41
const Container * boxPtr
The simulation cell.
Definition: lookuptable.h:35
#define NDIM
Number of spatial dimnsions.
Definition: common.h:71
#define XXX
Used to refer to a nonsense beadIndex.
Definition: common.h:98
ConstantParameters * constants()
Global public access to the constants.
Definition: constants.h:201
+ Here is the call graph for this function:

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