Public Member Functions | Private Attributes | List of all members
PLMD::LinkCells Class Reference

A class for doing link cells. More...

#include <LinkCells.h>

Public Member Functions

 LinkCells (Communicator &comm)
 
bool enabled () const
 Have the link cells been enabled. More...
 
void setCutoff (const double &lcut)
 Set the value of the cutoff. More...
 
double getCutoff () const
 Get the value of the cutoff. More...
 
unsigned getNumberOfCells () const
 Get the total number of link cells. More...
 
void buildCellLists (const std::vector< Vector > &pos, const std::vector< unsigned > &indices, const Pbc &pbc)
 Build the link cell lists. More...
 
unsigned convertIndicesToIndex (const unsigned &nx, const unsigned &ny, const unsigned &nz) const
 Take three indices and return the index of the corresponding cell. More...
 
unsigned findCell (const Vector &pos) const
 Find the cell index in which this position is contained. More...
 
std::vector< unsigned > findMyCell (const Vector &pos) const
 Find the cell in which this position is contained. More...
 
void addRequiredCells (const std::vector< unsigned > &celn, unsigned &ncells_required, std::vector< unsigned > &cells_required) const
 Get the list of cells we need to surround the a particular cell. More...
 
void retrieveAtomsInCells (const unsigned &ncells_required, const std::vector< unsigned > &cells_required, unsigned &natomsper, std::vector< unsigned > &atoms) const
 Retrieve the atoms in a list of cells. More...
 
void retrieveNeighboringAtoms (const Vector &pos, std::vector< unsigned > &cell_list, unsigned &natomsper, std::vector< unsigned > &atoms) const
 Retrieve the atoms we need to consider. More...
 

Private Attributes

Communicatorcomm
 Symbolic link to plumed communicator. More...
 
bool cutoffwasset
 Check that the link cells were set up correctly. More...
 
double link_cutoff
 The cutoff to use for the sizes of the cells. More...
 
Pbc mypbc
 The pbc we are using for link cells. More...
 
std::vector< unsigned > ncells
 The number of cells in each direction. More...
 
std::vector< unsigned > nstride
 The number of cells to stride through to get the link cells. More...
 
std::vector< unsigned > allcells
 The list of cells each atom is inside. More...
 
std::vector< unsigned > lcell_starts
 The start of each block corresponding to each link cell. More...
 
std::vector< unsigned > lcell_tots
 The number of atoms in each link cell. More...
 
std::vector< unsigned > lcell_lists
 The atoms ordered by link cells. More...
 

Detailed Description

A class for doing link cells.

Constructor & Destructor Documentation

◆ LinkCells()

PLMD::LinkCells::LinkCells ( Communicator comm)
explicit

Member Function Documentation

◆ addRequiredCells()

void PLMD::LinkCells::addRequiredCells ( const std::vector< unsigned > &  celn,
unsigned &  ncells_required,
std::vector< unsigned > &  cells_required 
) const

Get the list of cells we need to surround the a particular cell.

◆ buildCellLists()

void PLMD::LinkCells::buildCellLists ( const std::vector< Vector > &  pos,
const std::vector< unsigned > &  indices,
const Pbc pbc 
)

Build the link cell lists.

◆ convertIndicesToIndex()

unsigned PLMD::LinkCells::convertIndicesToIndex ( const unsigned &  nx,
const unsigned &  ny,
const unsigned &  nz 
) const

Take three indices and return the index of the corresponding cell.

◆ enabled()

bool PLMD::LinkCells::enabled ( ) const
inline

Have the link cells been enabled.

◆ findCell()

unsigned PLMD::LinkCells::findCell ( const Vector pos) const

Find the cell index in which this position is contained.

◆ findMyCell()

std::vector< unsigned > PLMD::LinkCells::findMyCell ( const Vector pos) const

Find the cell in which this position is contained.

◆ getCutoff()

double PLMD::LinkCells::getCutoff ( ) const

Get the value of the cutoff.

◆ getNumberOfCells()

unsigned PLMD::LinkCells::getNumberOfCells ( ) const
inline

Get the total number of link cells.

◆ retrieveAtomsInCells()

void PLMD::LinkCells::retrieveAtomsInCells ( const unsigned &  ncells_required,
const std::vector< unsigned > &  cells_required,
unsigned &  natomsper,
std::vector< unsigned > &  atoms 
) const

Retrieve the atoms in a list of cells.

◆ retrieveNeighboringAtoms()

void PLMD::LinkCells::retrieveNeighboringAtoms ( const Vector pos,
std::vector< unsigned > &  cell_list,
unsigned &  natomsper,
std::vector< unsigned > &  atoms 
) const

Retrieve the atoms we need to consider.

◆ setCutoff()

void PLMD::LinkCells::setCutoff ( const double &  lcut)

Set the value of the cutoff.

Member Data Documentation

◆ allcells

std::vector<unsigned> PLMD::LinkCells::allcells
private

The list of cells each atom is inside.

◆ comm

Communicator& PLMD::LinkCells::comm
private

Symbolic link to plumed communicator.

◆ cutoffwasset

bool PLMD::LinkCells::cutoffwasset
private

Check that the link cells were set up correctly.

◆ lcell_lists

std::vector<unsigned> PLMD::LinkCells::lcell_lists
private

The atoms ordered by link cells.

◆ lcell_starts

std::vector<unsigned> PLMD::LinkCells::lcell_starts
private

The start of each block corresponding to each link cell.

◆ lcell_tots

std::vector<unsigned> PLMD::LinkCells::lcell_tots
private

The number of atoms in each link cell.

◆ link_cutoff

double PLMD::LinkCells::link_cutoff
private

The cutoff to use for the sizes of the cells.

◆ mypbc

Pbc PLMD::LinkCells::mypbc
private

The pbc we are using for link cells.

◆ ncells

std::vector<unsigned> PLMD::LinkCells::ncells
private

The number of cells in each direction.

◆ nstride

std::vector<unsigned> PLMD::LinkCells::nstride
private

The number of cells to stride through to get the link cells.


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