Grid¶

This class is a base class to perform neighbor search between structural particles (i.e. atoms or pseudo-atoms). Internally, the neighbor search algorithm uses a grid to efficiently determine neighbors.

You can get a neighbor list for a structural particle:

# get a neighbor list for a structural particle with an index 0
      neighborIndexer = grid.getNeighborIndexer(0)

# get a neighbor list for a structural particle structuralParticle
      neighborIndexer = grid.getNeighborIndexer(structuralParticle)

To update the neighbor list execute:

grid.update()

See also

SAMSON API: SBMStructuralModelGrid

class samson.Modeling.StructuralModel.Grid(self: samson.Modeling.StructuralModel.Grid, arg0: samson.DataModel.DataGraph.NodeIndexer, arg1: samson.DataModel.Quantity.unitsSI) → None¶

Bases: samson.Core.Reference.ReferenceTarget

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

getMemoryFootprint(self: samson.Core.Reference.ReferenceTarget) → int¶

Returns the memory footprint

getNeighborIndexer(*args, **kwargs)¶

Overloaded function.

  1. getNeighborIndexer(self: samson.Modeling.StructuralModel.Grid, i: int) -> samson.DataModel.DataGraph.NodeIndexer

Returns the neighbor indexer of structural particle i

  1. getNeighborIndexer(self: samson.Modeling.StructuralModel.Grid, structuralParticle: SBMStructuralModelNodeParticle) -> samson.DataModel.DataGraph.NodeIndexer

Returns the neighbor indexer of structural particle structuralParticle

printDebugInfo(self: samson.Modeling.StructuralModel.Grid, offset: int = 0) → None¶

Prints some debugging information in stdout

update(self: samson.Modeling.StructuralModel.Grid) → None¶

Updates the grid and neighbor lists