Web Analytics Made Easy - Statcounter
Skip to content

Class SBSNeighborSearchParticleSystemPBC#

ClassList > SBSNeighborSearchParticleSystemPBC

This class is the base class of neighbor search algorithms that can be applied to particle systems with periodic boundary conditions. More...

  • #include <SBSNeighborSearchParticleSystemPBC.hpp>

Inherits the following classes: SBSNeighborSearch

Inherited by the following classes: SBSNeighborSearchParticleSystemGridPBC

Public Functions#

Type Name
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#

See SBSNeighborSearch

Type Name
virtual void print (unsigned int offset=0) const
Prints debugging information.
virtual ~SBSNeighborSearch ()
Destructor.

Public Functions inherited from SBCReferenceTarget#

See 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
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#

See SBCReferenceTarget

Type Name
SBCReferenceTargetData * dataPointer
A pointer to the private data.

Protected Functions#

Type Name
SBSNeighborSearchParticleSystemPBC (SBParticleSystem * particleSystem, const SBQuantity::length & cutoffDistance)
Protected constructor.
SBSNeighborSearchParticleSystemPBC (SBParticleSystem * particleSystem, const SBQuantity::length & cutoffDistance, SBSNeighborSearchParticleSystemPBCData * dataPointer)
Protected constructor.

Protected Functions inherited from SBSNeighborSearch#

See SBSNeighborSearch

Type Name
SBSNeighborSearch ()
Protected constructor.
SBSNeighborSearch (SBSNeighborSearchData * dataPointer)
Protected constructor.

Protected Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
Protected constructor.
void removeAllReferenceOwners ()
Stops all the reference owners from referencing this reference target.

Detailed Description#

Short name: SBNeighborSearchParticleSystemPBC

Public Functions Documentation#

function getNeighborVector#

Returns the neighbor list for the i-th particle.

SBVector< SBAtom * > * SBSNeighborSearchParticleSystemPBC::getNeighborVector (
    unsigned int i
) 

Returns the neighbor list vector for a given particle index.

The returned vector contains pointers to neighboring atoms for the specified particle.

Parameters:

  • i Index of the particle whose neighbor vector is requested.

Returns:

Pointer to the vector of neighboring atoms.


function getNeighbors [1/2]#

Appends to neighborVector all atoms that are at a distance smaller than or equal toradius from the specifiedposition .

virtual void SBSNeighborSearchParticleSystemPBC::getNeighbors (
    SBVector< SBAtom * > & neighborVector,
    const SBPosition3 & position,
    const SBQuantity::length & radius
) const

Appends to a vector all atoms within a specified radius of a given position.

This method searches for atoms whose distance to the provided position is less than or equal to the given radius and appends them to the supplied neighbor vector.

Parameters:

  • neighborVector Vector that will receive the neighboring atoms.
  • position Position around which to search for neighbors.
  • radius Search radius.

function getNeighbors [2/2]#

Appends to neighborVector all atoms inside thebox .

virtual void SBSNeighborSearchParticleSystemPBC::getNeighbors (
    SBVector< SBAtom * > & neighborVector,
    const SBIAPosition3 & box
) const

Appends to a vector all atoms inside a specified box region.

This method searches for atoms that lie within the given axis-aligned bounding box and appends them to the neighbor vector.

Parameters:

  • neighborVector Vector that will receive the neighboring atoms.
  • box Box defining the region to search for atoms.

function initializeNeighborLists#

Initializes the neighbor lists.

virtual void SBSNeighborSearchParticleSystemPBC::initializeNeighborLists () 

Initializes the neighbor lists for all particles.


function onDynamicalEvent#

Handles dynamical model events.

void SBSNeighborSearchParticleSystemPBC::onDynamicalEvent (
    SBDynamicalEvent * dynamicalEvent
) 

Handles a dynamical event, updating the neighbor search state as needed.

This method processes the provided dynamical event, which may affect particle positions or system configuration.

Parameters:

  • dynamicalEvent Pointer to the dynamical event to handle.

function print#

Prints debugging information.

virtual void SBSNeighborSearchParticleSystemPBC::print (
    unsigned int offset=0
) override const

Prints debugging information with a specified indentation offset.

The method outputs the internal state of the neighbor search object, indented by the given offset.

Parameters:

  • offset Number of spaces to indent the output.

Implements SBSNeighborSearch::print


function updateNeighborLists#

Updates the neighbor lists.

virtual void SBSNeighborSearchParticleSystemPBC::updateNeighborLists () 

Updates the neighbor lists after particle positions have changed.


function ~SBSNeighborSearchParticleSystemPBC#

Destructor.

virtual SBSNeighborSearchParticleSystemPBC::~SBSNeighborSearchParticleSystemPBC () 

Destroys the neighbor search object and releases allocated resources.


Protected Attributes Documentation#

variable boxPBC#

The box's periodic boundary conditions bounds.

SBIAPosition3* SBSNeighborSearchParticleSystemPBC::boxPBC;


variable boxSizeX#

The box's size in x-direction.

SBQuantity::length* SBSNeighborSearchParticleSystemPBC::boxSizeX;


variable boxSizeY#

The box's size in y-direction.

SBQuantity::length* SBSNeighborSearchParticleSystemPBC::boxSizeY;


variable boxSizeZ#

The box's size in z-direction.

SBQuantity::length* SBSNeighborSearchParticleSystemPBC::boxSizeZ;


variable cutoffDistanceSquared#

The squared cutoff distance.

SBQuantity::squareLength* SBSNeighborSearchParticleSystemPBC::cutoffDistanceSquared;


variable inverseCutoffDistance#

The inverse cutoff distance.

SBQuantity::inverseLength* SBSNeighborSearchParticleSystemPBC::inverseCutoffDistance;


variable neighborVectorBuffer#

The buffer containing the neighbor lists associated to each atom.

SBBuffer<SBVector<SBAtom*>*>* SBSNeighborSearchParticleSystemPBC::neighborVectorBuffer;


variable particleSystem#

The particle system the neighbor search algorithm is attached to.

SBPointer<SBParticleSystem>* SBSNeighborSearchParticleSystemPBC::particleSystem;


Protected Functions Documentation#

function SBSNeighborSearchParticleSystemPBC [1/2]#

Protected constructor.

SBSNeighborSearchParticleSystemPBC::SBSNeighborSearchParticleSystemPBC (
    SBParticleSystem * particleSystem,
    const SBQuantity::length & cutoffDistance
) 

Constructs a neighbor search object for a particle system with a given cutoff distance.

This constructor creates a neighbor search algorithm attached to the specified particle system and uses the provided cutoff distance to determine neighbor interactions. It delegates to the protected constructor with a newly allocated internal data object.

Parameters:

  • p Pointer to the particle system.
  • c Cutoff distance used for neighbor determination.

function SBSNeighborSearchParticleSystemPBC [2/2]#

Protected constructor.

SBSNeighborSearchParticleSystemPBC::SBSNeighborSearchParticleSystemPBC (
    SBParticleSystem * particleSystem,
    const SBQuantity::length & cutoffDistance,
    SBSNeighborSearchParticleSystemPBCData * dataPointer
) 

Constructs a neighbor search object for a particle system with a given cutoff distance and internal data pointer.

This constructor initializes the neighbor search algorithm, associating it with the specified particle system, cutoff distance, and internal data structure.

Parameters:

  • p Pointer to the particle system.
  • c Cutoff distance.
  • dataPointer Pointer to the internal data object used by the neighbor search algorithm.