For even larger particle numbers the cell volume is divided
into subcells with side lengths
.
Figure 2.6:
For a particle in the shaded subcell, eligible
interaction partners can be only from the subcells marked with
a dot
Figure 2.7:
To avoid duplication of pair property calculations, only the
marked cells should be scanned for partners of a particle in the shaded
cell. (But respect periodic b.c.!)
The following description follows the discussion found in Hockney's
book [HOCKNEY, EASTWOOD: COMPUTER SIMULATION USING PARTICLES.
McGraw-Hill, New York 1981].
Define two pointer arrays defined as follows:
(for ``head of chain'');
its -element contains the largest particle number of all inhabitants of
cell .
( ``linked list''); number of the next (i.e. lower)
particle in the presently treated cell; when that cell is
finished.
Procedure:
In a language-free (but Fortran-like) form, proceed as follows:
do 100 k=1,ncell // where usually ncell=M^3
100 hoc(k)=0
do 200 i=1,n
icell=1+int(x(i)/cl) //where cl=l=L/M
+int(y(i)/cl)*M
+int(z(i)/cl)*M*M
ll(i)=hoc(icell)
hoc(icell)=i
200 continue
These few quick steps may be performed at each MD or MC step to update
the linked-cell pointer arrays. When it comes to calculating interactions,
these arrays provide the information about possible partner molecules.
For clarity, consider this example:
Figure 2.8:
Note: the cells are numbered from lower left (1)
to upper right(9)