Class SBSNeighborSearchParticleSystem#
ClassList > SBSNeighborSearchParticleSystem
This class is the base class of neighbor search algorithms that can be applied to particle systems. More...
#include <SBSNeighborSearchParticleSystem.hpp>
Inherits the following classes: SBSNeighborSearch
Inherited by the following classes: SBSNeighborSearchParticleSystemGrid
Public Functions#
| Type | Name |
|---|---|
| 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 |
|---|---|
| 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 |
|---|---|
| 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 |
|---|---|
| SBSNeighborSearchParticleSystem (SBParticleSystem * particleSystem, const SBQuantity::length & cutoffDistance) Protected constructor. |
|
| SBSNeighborSearchParticleSystem (SBParticleSystem * particleSystem, 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: SBNeighborSearchParticleSystem
Public Functions Documentation#
function areNeighbors [1/2]#
Returns whether atoms with indices i andj are neighbors.
Determines whether two particles identified by their indices are neighbors.
Parameters:
iIndex of the first particle.jIndex of the second particle.
Returns:
true if the particles are neighbors; otherwise false.
function areNeighbors [2/2]#
Returns whether atoms atomI andatomJ are neighbors.
Determines whether two atoms are neighbors.
Parameters:
atomIPointer to the first atom.atomJPointer to the second atom.
Returns:
true if the atoms are neighbors; otherwise false.
function getNeighborVector#
Returns the neighbor list for the i-th particle.
Returns the neighbor list for the specified particle index.
Parameters:
iIndex of the particle whose neighbor list is requested.
Returns:
Pointer to a constant vector of neighbor atoms for particle i.
function getNeighbors [1/2]#
Appends to neighborVector all atoms that are at a distance smaller than or equal toradius from the specifiedposition .
virtual void SBSNeighborSearchParticleSystem::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBPosition3 & position,
const SBQuantity::length & radius
) const
Appends to the provided vector all atoms located within a given radius of a position.
Parameters:
neighborVectorVector that will receive the neighboring atoms (appended to the existing contents).positionCenter position around which to search for neighbors.radiusMaximum distance from the position to consider an atom a neighbor.
function getNeighbors [2/2]#
Appends to neighborVector all atoms inside thebox .
virtual void SBSNeighborSearchParticleSystem::getNeighbors (
SBVector< SBAtom * > & neighborVector,
const SBIAPosition3 & box
) const
Appends to the provided vector all atoms located inside a specified axis-aligned bounding box.
Parameters:
neighborVectorVector that will receive the neighboring atoms (appended to the existing contents).boxAxis-aligned bounding box defining the region to search for atoms.
function initializeNeighborLists#
Initializes the neighbor lists.
Initializes the neighbor lists for all particles.
function onDynamicalEvent#
Handles dynamical model events.
Handles dynamical model events that affect the particle system, such as atom addition or removal.
Parameters:
dynamicalEventPointer to the event describing the dynamical change.
function print#
Prints debugging information.
Prints debugging information for the neighbor search object.
Parameters:
offsetNumber of spaces to indent each line of output.
Implements SBSNeighborSearch::print
function updateNeighborLists#
Updates the neighbor lists.
Updates the neighbor lists for all particles.
function ~SBSNeighborSearchParticleSystem#
Destructor.
Destroys the neighbor search object and releases all associated resources.
Protected Attributes Documentation#
variable cutoffDistanceSquared#
The squared cutoff distance.
variable inverseCutoffDistance#
The inverse cutoff distance.
variable neighborVectorBuffer#
The buffer containing the neighbor lists associated to each atom.
variable particleSystem#
The particle system the neighbor search algorithm is attached to.
Protected Functions Documentation#
function SBSNeighborSearchParticleSystem [1/2]#
Protected constructor.
SBSNeighborSearchParticleSystem::SBSNeighborSearchParticleSystem (
SBParticleSystem * particleSystem,
const SBQuantity::length & cutoffDistance
)
Constructs a neighbor search algorithm for a particle system with a specified cutoff distance.
Parameters:
pPointer to the particle system the neighbor search will be attached to.cThe cutoff distance used for neighbor detection.
function SBSNeighborSearchParticleSystem [2/2]#
Protected constructor.
SBSNeighborSearchParticleSystem::SBSNeighborSearchParticleSystem (
SBParticleSystem * particleSystem,
const SBQuantity::length & cutoffDistance,
SBSNeighborSearchParticleSystemData * dataPointer
)
Constructs a neighbor search algorithm for a particle system with a specified cutoff distance and internal data pointer.
Parameters:
pPointer to the particle system the neighbor search will be attached to.cThe cutoff distance used for neighbor detection.dataPointerPointer to the internal data structure used by the neighbor search algorithm.