SBStructuralModelGrid#
This class is a base class to perform neighbor search between atoms. Internally, the neighbor search algorithm uses a grid to efficiently determine neighbors.
You can get a neighbor indxer for an atom:
# get a neighbor list for a atom with an index 0
neighborIndexer = grid.getNeighborIndexer(0)
# get a neighbor list for an atom
neighborIndexer = grid.getNeighborIndexer(atom)
To update the neighbor list execute:
grid.update()
See also
SAMSON SDK: SBMStructuralModelGrid
- class samson.SBStructuralModelGrid(self: samson.SBStructuralModelGrid, arg0: samson.SBNodeIndexer, arg1: samson.SBQuantity.unitsSI)#
Bases:
SBReferenceTarget
This class describes a grid-based neighbor search algorithm that can be applied to atoms.
- areNeighbors(*args, **kwargs)#
Overloaded function.
areNeighbors(self: samson.SBStructuralModelGrid, i: int, j: int) -> bool
Returns whether particles with indices i and j are neighbors
areNeighbors(self: samson.SBStructuralModelGrid, atomI: SBMStructuralModelNodeAtom, atomJ: SBMStructuralModelNodeAtom) -> bool
Returns whether atoms atomI and atomJ are neighbors
- getNeighborVector(*args, **kwargs)#
Overloaded function.
getNeighborVector(self: samson.SBStructuralModelGrid, i: int) -> std::vector<SBMStructuralModelNodeAtom * __ptr64,std::allocator<SBMStructuralModelNodeAtom * __ptr64> >
Returns the neighbor indexer of atom i
getNeighborVector(self: samson.SBStructuralModelGrid, atom: SBMStructuralModelNodeAtom) -> std::vector<SBMStructuralModelNodeAtom * __ptr64,std::allocator<SBMStructuralModelNodeAtom * __ptr64> >
Returns the neighbor indexer of atom atom
- getNeighbors(*args, **kwargs)#
Overloaded function.
getNeighbors(self: samson.SBStructuralModelGrid, position: samson.SBPhysicalVector3, radius: samson.SBQuantity.unitsSI) -> std::vector<SBMStructuralModelNodeAtom * __ptr64,std::allocator<SBMStructuralModelNodeAtom * __ptr64> >
Returns vector of all atoms that are at a distance smaller than or equal to radius from the specified position
getNeighbors(self: samson.SBStructuralModelGrid, box: samson.SBPhysicalIAVector3) -> std::vector<SBMStructuralModelNodeAtom * __ptr64,std::allocator<SBMStructuralModelNodeAtom * __ptr64> >
Returns vector of all atoms inside the box
- update(self: samson.SBStructuralModelGrid) None #
Updates the grid and neighbor lists