Class SBSNeighborSearchParticleSystemGridPBC#
ClassList > SBSNeighborSearchParticleSystemGridPBC
This class describes a grid-based neighbor search algorithm that can be applied to particle systems with periodic boundary conditions (PBC). More...
#include "SBSNeighborSearchParticleSystemGridPBC.hpp"
Inherits the following classes: SBSNeighborSearchParticleSystemPBC
Public Functions#
Type | Name |
---|---|
SBSNeighborSearchParticleSystemGridPBC (SBParticleSystem * p, const SBQuantity::length & cutoffDistance) Constructs a neighbor search particle system grid with PBC for the given particle system and the given cutoff radius. |
|
SB_DECLARE_DATA (SBSNeighborSearchParticleSystemGridPBC) |
|
virtual void | getNeighbors (SBVector< SBAtom * > & neighborVector, const SBPosition3 & position, const SBQuantity::length & radius) override const Appends to neighborVector all atoms that are at a distance smaller than or equal toradius from the specifiedposition . |
virtual void | getNeighbors (SBVector< SBAtom * > & neighborVector, const SBIAPosition3 & box) override const Appends to neighborVector all atoms inside thebox . |
virtual void | initializeNeighborLists () override Initializes the neighbor lists. |
void | onDynamicalEvent (SBDynamicalEvent * dynamicalEvent) Handles dynamical model events. |
virtual void | print (unsigned int offset=0) override const Prints debugging information. |
virtual void | updateNeighborLists () override Updates the neighbor lists. |
virtual | ~SBSNeighborSearchParticleSystemGridPBC () Destructor. |
Public Functions inherited from SBSNeighborSearchParticleSystemPBC#
See SBSNeighborSearchParticleSystemPBC
Type | Name |
---|---|
SB_DECLARE_DATA (SBSNeighborSearchParticleSystemPBC) |
|
SBVector< SBAtom * > * | getNeighborVector (unsigned int i) Returns the neighbor list for the i-th particle. |
virtual void | getNeighbors (SBVector< SBAtom * > & neighborVector, const SBPosition3 & position, const SBQuantity::length & radius) const Appends to neighborVector all atoms that are at a distance smaller than or equal toradius from the specifiedposition . |
virtual void | getNeighbors (SBVector< SBAtom * > & neighborVector, const SBIAPosition3 & box) const Appends to neighborVector all atoms inside thebox . |
virtual void | initializeNeighborLists () Initializes the neighbor lists. |
void | onDynamicalEvent (SBDynamicalEvent * dynamicalEvent) Handles dynamical model events. |
virtual void | print (unsigned int offset=0) override const Prints debugging information. |
virtual void | updateNeighborLists () Updates the neighbor lists. |
virtual | ~SBSNeighborSearchParticleSystemPBC () Destructor. |
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#
Type | Name |
---|---|
SBPointerIndexer< SBAtom > const * | atomIndexer |
SBQuantity::length * | cutoffDistance The cutoff distance. |
SBHashMap< GridKey, GridCell *, GridKeyFunctor, GridKeyComparator > * | grid |
SBVector< GridKey > * | gridKeyVector |
Protected Attributes inherited from SBSNeighborSearchParticleSystemPBC#
See SBSNeighborSearchParticleSystemPBC
Type | Name |
---|---|
SBIAPosition3 * | boxPBC The box's periodic boundary conditions bounds. |
SBQuantity::length * | boxSizeX The box's size in x-direction. |
SBQuantity::length * | boxSizeY The box's size in y-direction. |
SBQuantity::length * | boxSizeZ The box's size in z-direction. |
SBQuantity::squareLength * | cutoffDistanceSquared The squared cutoff distance. |
SBQuantity::inverseLength * | inverseCutoffDistance The inverse cutoff distance. |
SBBuffer< SBVector< SBAtom * > * > * | neighborVectorBuffer The buffer containing the neighbor lists associated to each atom. |
SBPointer< SBParticleSystem > * | particleSystem The particle system the neighbor search algorithm is attached to. |
Protected Attributes inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions#
Type | Name |
---|---|
SBSNeighborSearchParticleSystemGridPBC (SBParticleSystem * p, const SBQuantity::length & cutoffDistance, SBSNeighborSearchParticleSystemGridPBCData * dataPointer) Protected constructor. |
|
bool | cellCrossesTheBox (GridKey & gridKey) |
void | checkCell (GridCell * gridCellJ, int i, std::set< unsigned int > & neighbors) |
void | checkCellsAroundBigBox (GridKey & gridKeyI, int i) |
void | checkCellsAroundCellByCell () |
void | checkCellsAroundSmallBox (GridKey & gridKeyI, int i) |
void | checkCellsCross (GridCell * gridCellI, GridCell * gridCellJ) |
void | getCellCoordinates (SBPosition3 const & position, SBVector3 & coordinates) |
void | getMirrorCellKey (GridKey & gridKey, GridKey & gridKeyMirror) |
bool | isInTheBox (SBPosition3 const & position) |
void | updateLists () |
Protected Functions inherited from SBSNeighborSearchParticleSystemPBC#
See SBSNeighborSearchParticleSystemPBC
Type | Name |
---|---|
SBSNeighborSearchParticleSystemPBC (SBParticleSystem * p, const SBQuantity::length & cutoffDistance) Protected constructor. |
|
SBSNeighborSearchParticleSystemPBC (SBParticleSystem * p, const SBQuantity::length & cutoffDistance, SBSNeighborSearchParticleSystemPBCData * dataPointer) Protected constructor. |
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: SBNeighborSearchParticleSystemGridPBC
Public Functions Documentation#
function SBSNeighborSearchParticleSystemGridPBC [2/2]#
Constructs a neighbor search particle system grid with PBC for the given particle system and the given cutoff radius.
SBSNeighborSearchParticleSystemGridPBC::SBSNeighborSearchParticleSystemGridPBC (
SBParticleSystem * p,
const SBQuantity::length & cutoffDistance
)
function SB_DECLARE_DATA#
function getNeighbors [1/2]#
Appends to neighborVector
all atoms that are at a distance smaller than or equal toradius
from the specifiedposition
.
virtual void SBSNeighborSearchParticleSystemGridPBC::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBPosition3 & position,
const SBQuantity::length & radius
) override const
Implements SBSNeighborSearchParticleSystemPBC::getNeighbors
function getNeighbors [2/2]#
Appends to neighborVector
all atoms inside thebox
.
virtual void SBSNeighborSearchParticleSystemGridPBC::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBIAPosition3 & box
) override const
Implements SBSNeighborSearchParticleSystemPBC::getNeighbors
function initializeNeighborLists#
Initializes the neighbor lists.
Implements SBSNeighborSearchParticleSystemPBC::initializeNeighborLists
function onDynamicalEvent#
Handles dynamical model events.
function print#
Prints debugging information.
Implements SBSNeighborSearchParticleSystemPBC::print
function updateNeighborLists#
Updates the neighbor lists.
Important: this function does not appear to work at the moment. Please rebuild a grid at each step.
Implements SBSNeighborSearchParticleSystemPBC::updateNeighborLists
function ~SBSNeighborSearchParticleSystemGridPBC#
Destructor.
Protected Attributes Documentation#
variable atomIndexer#
variable cutoffDistance#
The cutoff distance.
variable grid#
SBHashMap<GridKey, GridCell*, GridKeyFunctor, GridKeyComparator>* SBSNeighborSearchParticleSystemGridPBC::grid;
variable gridKeyVector#
Protected Functions Documentation#
function SBSNeighborSearchParticleSystemGridPBC [1/2]#
Protected constructor.
SBSNeighborSearchParticleSystemGridPBC::SBSNeighborSearchParticleSystemGridPBC (
SBParticleSystem * p,
const SBQuantity::length & cutoffDistance,
SBSNeighborSearchParticleSystemGridPBCData * dataPointer
)
function cellCrossesTheBox#
function checkCell#
void SBSNeighborSearchParticleSystemGridPBC::checkCell (
GridCell * gridCellJ,
int i,
std::set< unsigned int > & neighbors
)
function checkCellsAroundBigBox#
function checkCellsAroundCellByCell#
function checkCellsAroundSmallBox#
function checkCellsCross#
void SBSNeighborSearchParticleSystemGridPBC::checkCellsCross (
GridCell * gridCellI,
GridCell * gridCellJ
)
function getCellCoordinates#
void SBSNeighborSearchParticleSystemGridPBC::getCellCoordinates (
SBPosition3 const & position,
SBVector3 & coordinates
)
function getMirrorCellKey#
void SBSNeighborSearchParticleSystemGridPBC::getMirrorCellKey (
GridKey & gridKey,
GridKey & gridKeyMirror
)