Web Analytics Made Easy - Statcounter
Skip to content

Class SBMStructuralModelGrid#

ClassList > SBMStructuralModelGrid

This class describes a grid-based neighbor search algorithm that can be applied to atoms (atoms or pseudo-atoms). More...

  • #include <SBMStructuralModelGrid.hpp>

Inherits the following classes: SBCReferenceTarget

Public Functions#

Type Name
SBMStructuralModelGrid (const SBNodeIndexer & nodeIndexer, const SBQuantity::length & cutoffDistance)
Constructs a neighbor search grid.
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) const
Returns the neighbor vector of atom i .
SBVector< SBAtom * > const * getNeighborVector (SBAtom * atom) const
Returns the neighbor vector of atom atom .
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 print (unsigned int offset=0) const
Prints debugging information.
virtual void update ()
Updates the grid and neighbor lists.
virtual ~SBMStructuralModelGrid ()
Destroys the neighbor search grid.

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 inherited from SBCReferenceTarget#

See SBCReferenceTarget

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

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#

This class may be used by developers to perform neighbor search between atoms .

Internally, the neighbor search algorithm uses a grid to efficiently determine neighbors.

Short name: SBStructuralModelGrid

Public Functions Documentation#

function SBMStructuralModelGrid#

Constructs a neighbor search grid.

SBMStructuralModelGrid::SBMStructuralModelGrid (
    const SBNodeIndexer & nodeIndexer,
    const SBQuantity::length & cutoffDistance
) 

Initializes the neighbor search algorithm. After the grid is constructed, neighbor lists are available and can be retrieved using the getNeighborVector functions.

Parameters:

  • nodeIndexer Indexer that maps atoms to unique indices.
  • c Cutoff distance used for neighbor determination.

function areNeighbors [1/2]#

Returns whether atoms with indices i andj are neighbors.

virtual bool SBMStructuralModelGrid::areNeighbors (
    unsigned int i,
    unsigned int j
) const

Determines whether two atoms are neighbors.

Returns true if atoms with indices i and j are neighbors according to the grid's cutoff distance.

Parameters:

  • i Index of the first atom.
  • j Index of the second atom.

Returns:

true if the atoms are neighbors; otherwise false.


function areNeighbors [2/2]#

Returns whether atoms atomI andatomJ are neighbors.

virtual bool SBMStructuralModelGrid::areNeighbors (
    SBAtom * atomI,
    SBAtom * atomJ
) const

Determines whether two atoms are neighbors.

Returns true if the specified atoms are neighbors according to the grid's cutoff distance.

Parameters:

  • atomI Pointer to the first atom.
  • atomJ Pointer to the second atom.

Returns:

true if the atoms are neighbors; otherwise false.


function getNeighborVector [1/2]#

Returns the neighbor vector of atom i .

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

Returns the neighbor vector for a given atom index.

Retrieves the vector of neighboring atoms for the atom identified by the specified index.

Parameters:

  • i Index of the atom.

Returns:

Pointer to the vector of neighboring atoms.


function getNeighborVector [2/2]#

Returns the neighbor vector of atom atom .

SBVector< SBAtom * > const * SBMStructuralModelGrid::getNeighborVector (
    SBAtom * atom
) const

Returns the neighbor vector for a given atom.

Retrieves the vector of neighboring atoms for the specified atom.

Parameters:

  • atom Pointer to the atom.

Returns:

Pointer to the vector of neighboring atoms, or nullptr if the atom is not indexed.


function getNeighbors [1/2]#

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

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

Retrieves atoms within a spherical region.

Appends to neighborVector all atoms that lie within a distance less than or equal to radius from the specified position.

Parameters:

  • neighborVector Vector that will receive the neighboring atoms.
  • position Center position of the search sphere.
  • radius Search radius.

function getNeighbors [2/2]#

Appends to neighborVector all atoms inside thebox .

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

Retrieves atoms within a box region.

Appends to neighborVector all atoms that are inside the specified axis-aligned bounding box.

Parameters:

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

function print#

Prints debugging information.

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

Prints debugging information about the neighbor grid.

Outputs neighbor pairs, grid cell count, and other relevant details to standard output.

Parameters:

  • offset Number of spaces to indent the output.

function update#

Updates the grid and neighbor lists.

virtual void SBMStructuralModelGrid::update () 


function ~SBMStructuralModelGrid#

Destroys the neighbor search grid.

virtual SBMStructuralModelGrid::~SBMStructuralModelGrid ()