bufferGridPoint2PointAcceleration - ProkopHapala/SimpleSimulationEngine GitHub Wiki
Description
Algorithm for acceleration of point-to-point radial short range interaction bounded by maximum interaction range R_MAX. Typical use is for molecule-molecule interaction. The idea is to project interaction bounding spheres of atoms iatom of the molecule imol to rectangular grid. Than for all interaction partners (molecules jmol) for each of its atom jatom current box is evaluated, and only interactions with iatom projected to that grid box is evaluated.
Pseudo code
for imol in molecules :
gridBuff.clean()
gridBuff.setBounds(imol)
iatoms = imol.getAtomsWorldSpace()
gridBuff.projectMoleculeToBox( iatoms )
for jmol < imol :
if ( not gridBuff.overlap(jmol.bounds) ) continue
jatoms = jmol.getAtomsWorldSpace()
for jatom in jatoms :
if (not gridBuff.pointIn(jatom) ) continue
icell = gridBuff.getCell(jatom)
for iatom in gridBuff.getAtom(icell) :
interact(iatom,jatom)
Properties & considerations
- GridBuffer is allocated usually once for whole systems, so the parameters like
Lbox,nx,ny,nz,nAtomPerCellare common for all molecules - Box size
Lboxshould be set according toRmaxsuch that each interaction bounding sphere overlap at max 8 boxes (or 4 in 2D). This means that box is enclosing the sphere or in other wordsLbox > 2*Rmax - Memory consumption is quite large,
nx*ny*nz*nAtomPerCellnx,ny,nzcan be reduced by larger grid spacing (increasingLmax), but thannAtomPerCellgrows for rivenRmax
- GridBuffer acceleration is efficient if the same inserted molecule is used many times (for interactions with several other jmols). Therefore it is good to put large molecules first in list (since
jmol < imol)