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#
| 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#
| Type | Name |
|---|---|
| SBCReferenceTargetData * | dataPointer A pointer to the private data. |
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#
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:
nodeIndexerIndexer that maps atoms to unique indices.cCutoff distance used for neighbor determination.
function areNeighbors [1/2]#
Returns whether atoms with indices i andj are neighbors.
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:
iIndex of the first atom.jIndex of the second atom.
Returns:
true if the atoms are neighbors; otherwise false.
function areNeighbors [2/2]#
Returns whether atoms atomI andatomJ are neighbors.
Determines whether two atoms are neighbors.
Returns true if the specified atoms are neighbors according to the grid's cutoff distance.
Parameters:
atomIPointer to the first atom.atomJPointer to the second atom.
Returns:
true if the atoms are neighbors; otherwise false.
function getNeighborVector [1/2]#
Returns the neighbor vector of atom i .
Returns the neighbor vector for a given atom index.
Retrieves the vector of neighboring atoms for the atom identified by the specified index.
Parameters:
iIndex of the atom.
Returns:
Pointer to the vector of neighboring atoms.
function getNeighborVector [2/2]#
Returns the neighbor vector of atom atom .
Returns the neighbor vector for a given atom.
Retrieves the vector of neighboring atoms for the specified atom.
Parameters:
atomPointer 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:
neighborVectorVector that will receive the neighboring atoms.positionCenter position of the search sphere.radiusSearch 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:
neighborVectorVector that will receive the neighboring atoms.boxBox defining the search region.
function print#
Prints debugging information.
Prints debugging information about the neighbor grid.
Outputs neighbor pairs, grid cell count, and other relevant details to standard output.
Parameters:
offsetNumber of spaces to indent the output.
function update#
Updates the grid and neighbor lists.
function ~SBMStructuralModelGrid#
Destroys the neighbor search grid.