A class for doing link cells. More...
#include <LinkCells.h>
Classes | |
| struct | CellCollection |
| This struct contains the configuration of cells. More... | |
Public Member Functions | |
| LinkCells (Communicator &comm) | |
| void | addRequiredCells (const std::array< unsigned, 3 > &celn, unsigned &ncells_required, std::vector< unsigned > &cells_required, bool usePbc=true) const |
| Get the list of cells we need to surround the a particular cell. | |
| template<typename T, typename Y> | |
| void | buildCellLists (const T &pos, const Y &indices, const Pbc &pbc) |
| void | buildCellLists (View< const Vector > pos, View< const unsigned > indices, const Pbc &pbc) |
| Build the link cell lists. | |
| unsigned | convertIndicesToIndex (std::array< unsigned, 3 > cellCoord) const |
| Take three indices and return the index of the corresponding cell. | |
| void | createNeighborList (unsigned nat, View< const Vector > pos, View< const unsigned > ind, View< const unsigned > tind, View< const Vector > neigh_pos, View< const unsigned > neigh_ind, const Pbc &pbc, unsigned &natoms_per_list, std::vector< std::size_t > &nlist) |
| Create a neighbour list for the specified input atoms. | |
| bool | enabled () const |
| Have the link cells been enabled. | |
| unsigned | findCell (const Vector &pos) const |
| Find the cell index in which this position is contained. | |
| std::array< unsigned, 3 > | findMyCell (unsigned cellIndex) const |
| Returns the "coordinate" of the cell index, assumes that cellIndex < getNumberOfCells() | |
| std::array< unsigned, 3 > | findMyCell (Vector pos) const |
| Find the cell in which this position is contained. | |
| const std::array< unsigned, 3 > & | getCellLimits () const |
| Get the number of cells per dimension. | |
| template<typename T, typename Y> | |
| CellCollection | getCollection (const T &pos, const Y &indices) |
| CellCollection | getCollection (View< const Vector > pos, View< const unsigned > indices) |
| double | getCutoff () const |
| Get the value of the cutoff. | |
| unsigned | getMaxInCell () const |
| Get the number of atoms in the cell that contains the most atoms. | |
| unsigned | getNumberOfCells () const |
| Get the total number of link cells. | |
| void | resetCollection (CellCollection &collection, View< const Vector > pos, View< const unsigned > indices) |
| void | retrieveAtomsInCells (unsigned ncells_required, View< const unsigned > cells_required, unsigned &natomsper, std::vector< unsigned > &atoms, unsigned avoidIndex=std::numeric_limits< unsigned >::max()) const |
| Retrieve the atoms in a list of cells. | |
| void | retrieveNeighboringAtoms (const Vector &pos, std::vector< unsigned > &cell_list, unsigned &natomsper, std::vector< unsigned > &atoms) const |
| Retrieve the atoms we need to consider. | |
| void | setCutoff (double lcut) |
| Set the value of the cutoff. | |
| void | setupCells (const Pbc &pbc) |
| Sets up the cells using the box stored in the Pbc object. | |
| template<typename T> | |
| void | setupCells (const T &pos) |
| template<typename T> | |
| void | setupCells (const T &pos, const Pbc &pbc) |
| void | setupCells (View< const Vector > pos) |
| Sets up the cells ignoring the pbcs. | |
| void | setupCells (View< const Vector > pos, const Pbc &pbc) |
| setups the cells | |
Private Member Functions | |
| void | createCells (const PLMD::Tensor &) |
Private Attributes | |
| std::vector< unsigned > | allcells |
| Work vector with the list of cells each atom is inside. | |
| Communicator & | comm |
| Symbolic link to plumed communicator. | |
| bool | cutoffwasset =false |
| Check that the link cells were set up correctly. | |
| CellCollection | innerCollection |
| The collection of indexes per cell created by buildCellLists. | |
| double | link_cutoff =0.0 |
| The cutoff to use for the sizes of the cells. | |
| Pbc | mypbc |
| The pbc we are using for link cells. | |
| std::array< unsigned, 3 > | ncells {0,0,0} |
| The number of cells in each direction. | |
| bool | nopbc =false |
| Are there periodic boundary conditions setup. | |
| std::array< unsigned, 3 > | nstride {1,0,0} |
| The number of cells to stride through to get the link cells. | |
| Vector | origin |
| The location of the origin if we are not using periodic boundary conditions. | |
A class for doing link cells.
|
explicit |
| void PLMD::LinkCells::addRequiredCells | ( | const std::array< unsigned, 3 > & | celn, |
| unsigned & | ncells_required, | ||
| std::vector< unsigned > & | cells_required, | ||
| bool | usePbc = true ) const |
Get the list of cells we need to surround the a particular cell.
usePbc toggles the use of pbcs for the input cell (celln)
|
inline |
| void PLMD::LinkCells::buildCellLists | ( | View< const Vector > | pos, |
| View< const unsigned > | indices, | ||
| const Pbc & | pbc ) |
Build the link cell lists.
| unsigned PLMD::LinkCells::convertIndicesToIndex | ( | std::array< unsigned, 3 > | cellCoord | ) | const |
Take three indices and return the index of the corresponding cell.
|
private |
| void PLMD::LinkCells::createNeighborList | ( | unsigned | nat, |
| View< const Vector > | pos, | ||
| View< const unsigned > | ind, | ||
| View< const unsigned > | tind, | ||
| View< const Vector > | neigh_pos, | ||
| View< const unsigned > | neigh_ind, | ||
| const Pbc & | pbc, | ||
| unsigned & | natoms_per_list, | ||
| std::vector< std::size_t > & | nlist ) |
Create a neighbour list for the specified input atoms.
| nat | number of atoms |
| pos | position of the "central atoms" |
| ind | indexes of the central atoms |
| tind | temporary indexes |
| neigh_pos | position of the candidate neighbors |
| neigh_ind | indexes of the candidate neighbors |
| pbc | |
| natoms_per_list | output number of atom per list (mapped on tind) nlist[tind[i]]=natoms[i] |
| nlist | output list of the central atoms plus their neigbors |
|
inline |
Have the link cells been enabled.
| unsigned PLMD::LinkCells::findCell | ( | const Vector & | pos | ) | const |
Find the cell index in which this position is contained.
| std::array< unsigned, 3 > PLMD::LinkCells::findMyCell | ( | unsigned | cellIndex | ) | const |
Returns the "coordinate" of the cell index, assumes that cellIndex < getNumberOfCells()
| std::array< unsigned, 3 > PLMD::LinkCells::findMyCell | ( | Vector | pos | ) | const |
Find the cell in which this position is contained.
|
inline |
Get the number of cells per dimension.
|
inline |
| LinkCells::CellCollection PLMD::LinkCells::getCollection | ( | View< const Vector > | pos, |
| View< const unsigned > | indices ) |
| double PLMD::LinkCells::getCutoff | ( | ) | const |
Get the value of the cutoff.
| unsigned PLMD::LinkCells::getMaxInCell | ( | ) | const |
Get the number of atoms in the cell that contains the most atoms.
|
inline |
Get the total number of link cells.
| void PLMD::LinkCells::resetCollection | ( | LinkCells::CellCollection & | collection, |
| View< const Vector > | pos, | ||
| View< const unsigned > | indices ) |
| void PLMD::LinkCells::retrieveAtomsInCells | ( | unsigned | ncells_required, |
| View< const unsigned > | cells_required, | ||
| unsigned & | natomsper, | ||
| std::vector< unsigned > & | atoms, | ||
| unsigned | avoidIndex = std::numeric_limits<unsigned>::max() ) const |
Retrieve the atoms in a list of cells.
| 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.
| void PLMD::LinkCells::setCutoff | ( | double | lcut | ) |
Set the value of the cutoff.
| void PLMD::LinkCells::setupCells | ( | const Pbc & | pbc | ) |
Sets up the cells using the box stored in the Pbc object.
|
inline |
|
inline |
Sets up the cells ignoring the pbcs.
This creates an orthogonal box that encloses all the atoms
setups the cells
Usually it only uses the pbcs if the pbc box is null (three zero vectors) it builds an orthorombic box from the given positions
|
private |
Work vector with the list of cells each atom is inside.
|
private |
Symbolic link to plumed communicator.
|
private |
Check that the link cells were set up correctly.
|
private |
The collection of indexes per cell created by buildCellLists.
|
private |
The cutoff to use for the sizes of the cells.
|
private |
The pbc we are using for link cells.
|
private |
The number of cells in each direction.
|
private |
Are there periodic boundary conditions setup.
|
private |
The number of cells to stride through to get the link cells.
|
private |
The location of the origin if we are not using periodic boundary conditions.
Hosted by GitHub
|
1.13.2
|