Class SBSNeighborSearchPositionGrid#
ClassList > SBSNeighborSearchPositionGrid
This class is the base class of neighbor search algorithms. More...
#include "SBSNeighborSearchPositionGrid.hpp"
Inherits the following classes: SBSNeighborSearch
Classes#
| Type | Name |
|---|---|
| class | GridCell |
| class | GridKey |
| class | GridKeyComparator |
| class | GridKeyFunctor |
Public Attributes#
| Type | Name |
|---|---|
| SBQuantity::squareLength * | cutoffDistanceSquared The squared cutoff distance. |
| SBHashMap< GridKey, GridCell *, GridKeyFunctor, GridKeyComparator > * | grid |
| SBVector< GridKey > * | gridKeyVector |
| SBIndexer< unsigned int > * | indexIndexer The set of indices the neighbor search algorithm is applied to. |
| SBQuantity::inverseLength * | inverseCutoffDistance The inverse cutoff distance. |
| SBBuffer< SBVector< unsigned int > * > * | neighborVectorBuffer The buffer containing the neighbor lists associated to each index. |
| SBBuffer< SBPosition3 > * | positionBuffer The buffer containing the positions. |
Public Functions#
| Type | Name |
|---|---|
| SBSNeighborSearchPositionGrid (const SBVector< SBPosition3 > & positionVector, const SBQuantity::length & cutoffDistance, bool findNeighbors=true) Constructs a neighbor search grid. |
|
| virtual void | getNeighbors (SBVector< unsigned int > & neighborVector, const SBPosition3 & position, const SBQuantity::length & radius) const Returns all atoms that are at a distance smaller than or equal to radius from the specifiedposition . |
| virtual bool | hasNeighbors (const SBPosition3 & position, const SBQuantity::length & radius) const Returns true if there are neighbors withinradius ofposition . |
| virtual | ~SBSNeighborSearchPositionGrid () Destroys the neighbor search grid. |
Public Functions inherited from SBSNeighborSearch#
| Type | Name |
|---|---|
| SB_DECLARE_DATA (SBSNeighborSearch) |
|
| virtual void | print (unsigned int offset=0) const Prints debugging information. |
| virtual | ~SBSNeighborSearch () Destructor. |
Public Functions inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTarget () Builds the reference target. |
|
| unsigned int | getMemoryFootprint () const Returns the memory footprint. |
| void | printReferencesToOwners () const Prints the references to the owners of this reference target. |
| virtual | ~SBCReferenceTarget () Destructor. |
Protected Attributes inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions inherited from SBSNeighborSearch#
| Type | Name |
|---|---|
| SBSNeighborSearch () Protected constructor. |
|
| SBSNeighborSearch (SBSNeighborSearchData * dataPointer) Protected constructor. |
Protected Functions inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTarget (SBCReferenceTargetData * dataPointer) Protected constructor. |
|
| void | removeAllReferenceOwners () Stops all the reference owners from referencing this reference target. |
Detailed Description#
Short name: SBPositionGrid
Public Attributes Documentation#
variable cutoffDistanceSquared#
The squared cutoff distance.
variable grid#
SBHashMap<GridKey, GridCell*, GridKeyFunctor, GridKeyComparator>* SBSNeighborSearchPositionGrid::grid;
variable gridKeyVector#
variable indexIndexer#
The set of indices the neighbor search algorithm is applied to.
variable inverseCutoffDistance#
The inverse cutoff distance.
variable neighborVectorBuffer#
The buffer containing the neighbor lists associated to each index.
variable positionBuffer#
The buffer containing the positions.
Public Functions Documentation#
function SBSNeighborSearchPositionGrid#
Constructs a neighbor search grid.
SBSNeighborSearchPositionGrid::SBSNeighborSearchPositionGrid (
const SBVector< SBPosition3 > & positionVector,
const SBQuantity::length & cutoffDistance,
bool findNeighbors=true
)
Initialize the grid.
Parameters:
positionVectorThe vector of positionscutoffDistanceThe cutoff distancefindNeighborsWhen true, performs a complete neighbor search and initializes neighborVectorBuffer. Setting findNeighbors to false saves time when the grid is only used to find neighboring positions through hasNeighbors and getNeighbors.
function getNeighbors#
Returns all atoms that are at a distance smaller than or equal to radius from the specifiedposition .
virtual void SBSNeighborSearchPositionGrid::getNeighbors (
SBVector< unsigned int > & neighborVector,
const SBPosition3 & position,
const SBQuantity::length & radius
) const
function hasNeighbors#
Returns true if there are neighbors withinradius ofposition .
virtual bool SBSNeighborSearchPositionGrid::hasNeighbors (
const SBPosition3 & position,
const SBQuantity::length & radius
) const
function ~SBSNeighborSearchPositionGrid#
Destroys the neighbor search grid.