Skip to main content
. Author manuscript; available in PMC: 2020 Aug 5.
Published in final edited form as: J Comput Chem. 2019 Apr 17;40(21):1919–1930. doi: 10.1002/jcc.25840

Algorithm 1.

Neighbor search used for GENESIS 1.0–1.3

do ij = 1, M M: number of cell pairs
 icel = cell_index(1,ij) First cell index of the cell pair
 jcel = cell_index(2,ij) Second cell index of the cell pair
 do i = 1, N(icel) N(icel): Number of atoms in icel-th cell
  do j = 1, N(jcel)
   rij(1) = coord(1,i,icel)-coord(1,j,jcel)
   rij(2) = coord(2,i,icel)-coord(2,j,jcel)
   rij(3) = coord(3,i,icel)-coord(3,j,jcel)
   dij = sqrt(rij(1)2+rij(1)2+rij(1)3)
   if (dij < pairlist cutoff) then
    Neighbor(i,ij) = Neighbor(i,ij) + 1
    k = Neighbor(i,ij)
    write Neighbor_list(k,i,ij)
   end if
  end do
 end do
 end do