Class SBSNeighborSearchParticleSystemGrid#
ClassList > SBSNeighborSearchParticleSystemGrid
This class describes a grid-based neighbor search algorithm that can be applied to particle systems. More...
#include "SBSNeighborSearchParticleSystemGrid.hpp"
Inherits the following classes: SBSNeighborSearchParticleSystem
Public Functions#
Type | Name |
---|---|
SBSNeighborSearchParticleSystemGrid (SBParticleSystem * p, const SBQuantity::length & cutoffDistance) Constructs a neighbor search particle system grid for the given particle system and the given cutoff radius. |
|
SB_DECLARE_DATA (SBSNeighborSearchParticleSystemGrid) |
|
virtual bool | areNeighbors (unsigned int i, unsigned int j) override const Returns whether atoms with indices i andj are neighbors. |
virtual bool | areNeighbors (SBAtom * atomI, SBAtom * atomJ) override const Returns whether atoms atomI andatomJ are neighbors. |
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 . |
bool | getParallelizationEnabled () const Returns whether the parallelization is enabled. By default, it is enabled and will be used if some criteria (e.g. the minimum number of atoms) are met. |
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. |
void | setParallelizationEnabled (bool enabled) Sets whether the parallelization is enabled. If set to true then the parallel implementation will be used if some criteria (e.g. the minimum number of atoms) are met, else the serial implementation will be used. |
virtual void | updateNeighborLists () override Updates the neighbor lists. |
virtual | ~SBSNeighborSearchParticleSystemGrid () Destructor. |
Public Functions inherited from SBSNeighborSearchParticleSystem#
See SBSNeighborSearchParticleSystem
Type | Name |
---|---|
SB_DECLARE_DATA (SBSNeighborSearchParticleSystem) |
|
virtual bool | areNeighbors (unsigned int i, unsigned int j) const Returns whether atoms with indices i andj are neighbors. |
virtual bool | areNeighbors (SBAtom * atomI, SBAtom * atomJ) const Returns whether atoms atomI andatomJ are neighbors. |
SBVector< SBAtom * > const * | 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 | ~SBSNeighborSearchParticleSystem () 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 |
---|---|
SBHashMap< GridKey, GridCell *, GridKeyFunctor, GridKeyComparator > * | grid |
SBVector< GridKey > * | gridKeyVector |
SBHashMap< std::pair< unsigned int, unsigned int >, bool > * | neighborMap Hashmap which caches whether two atoms are neighbors. |
Protected Attributes inherited from SBSNeighborSearchParticleSystem#
See SBSNeighborSearchParticleSystem
Type | Name |
---|---|
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 |
---|---|
SBSNeighborSearchParticleSystemGrid (SBParticleSystem * p, const SBQuantity::length & cutoffDistance, SBSNeighborSearchParticleSystemGridData * dataPointer) Protected constructor. |
Protected Functions inherited from SBSNeighborSearchParticleSystem#
See SBSNeighborSearchParticleSystem
Type | Name |
---|---|
SBSNeighborSearchParticleSystem (SBParticleSystem * p, const SBQuantity::length & cutoffDistance) Protected constructor. |
|
SBSNeighborSearchParticleSystem (SBParticleSystem * p, const SBQuantity::length & cutoffDistance, SBSNeighborSearchParticleSystemData * 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: SBNeighborSearchParticleSystemGrid
Public Functions Documentation#
function SBSNeighborSearchParticleSystemGrid [2/2]#
Constructs a neighbor search particle system grid for the given particle system and the given cutoff radius.
SBSNeighborSearchParticleSystemGrid::SBSNeighborSearchParticleSystemGrid (
SBParticleSystem * p,
const SBQuantity::length & cutoffDistance
)
function SB_DECLARE_DATA#
function areNeighbors [1/2]#
Returns whether atoms with indices i
andj
are neighbors.
virtual bool SBSNeighborSearchParticleSystemGrid::areNeighbors (
unsigned int i,
unsigned int j
) override const
Implements SBSNeighborSearchParticleSystem::areNeighbors
function areNeighbors [2/2]#
Returns whether atoms atomI
andatomJ
are neighbors.
virtual bool SBSNeighborSearchParticleSystemGrid::areNeighbors (
SBAtom * atomI,
SBAtom * atomJ
) override const
Implements SBSNeighborSearchParticleSystem::areNeighbors
function getNeighbors [1/2]#
Appends to neighborVector
all atoms that are at a distance smaller than or equal toradius
from the specifiedposition
.
virtual void SBSNeighborSearchParticleSystemGrid::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBPosition3 & position,
const SBQuantity::length & radius
) override const
Implements SBSNeighborSearchParticleSystem::getNeighbors
function getNeighbors [2/2]#
Appends to neighborVector
all atoms inside thebox
.
virtual void SBSNeighborSearchParticleSystemGrid::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBIAPosition3 & box
) override const
Implements SBSNeighborSearchParticleSystem::getNeighbors
function getParallelizationEnabled#
Returns whether the parallelization is enabled. By default, it is enabled and will be used if some criteria (e.g. the minimum number of atoms) are met.
function initializeNeighborLists#
Initializes the neighbor lists.
Implements SBSNeighborSearchParticleSystem::initializeNeighborLists
function onDynamicalEvent#
Handles dynamical model events.
function print#
Prints debugging information.
Implements SBSNeighborSearchParticleSystem::print
function setParallelizationEnabled#
Sets whether the parallelization is enabled. If set to true then the parallel implementation will be used if some criteria (e.g. the minimum number of atoms) are met, else the serial implementation will be used.
function updateNeighborLists#
Updates the neighbor lists.
Implements SBSNeighborSearchParticleSystem::updateNeighborLists
function ~SBSNeighborSearchParticleSystemGrid#
Destructor.
Protected Attributes Documentation#
variable grid#
SBHashMap<GridKey, GridCell*, GridKeyFunctor, GridKeyComparator>* SBSNeighborSearchParticleSystemGrid::grid;
variable gridKeyVector#
variable neighborMap#
Hashmap which caches whether two atoms are neighbors.
SBHashMap<std::pair<unsigned int, unsigned int>, bool>* SBSNeighborSearchParticleSystemGrid::neighborMap;
Protected Functions Documentation#
function SBSNeighborSearchParticleSystemGrid [1/2]#
Protected constructor.
SBSNeighborSearchParticleSystemGrid::SBSNeighborSearchParticleSystemGrid (
SBParticleSystem * p,
const SBQuantity::length & cutoffDistance,
SBSNeighborSearchParticleSystemGridData * dataPointer
)