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 2.

Real-space non-bonded interaction kernel used for GENESIS 1.0–1.3

do ij = 1, M
 icel = cell_index(1,ij)
 jcel = cell_index(2,ij)
 do i = 1, N(icel)
  force_temp(1:3) = 0.0
   do k = 1, Neighbor(i,ij) Number of neighbors of i-th atm in icel-th cell
    j = Neighbor_list(k,i,ij) Neighbor of i-th atom in icel-th cell
    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)
    calculate f (1:3):force component from given distance
    force_temp(1) = force_temp(1) – f (1)
    force_temp(2) = force_temp(2) – f (2)
    force_temp(3) = force_temp(3) – f (3)
    force(1,j,jcel) = force(1,j,jcel) + f (1)
    force(2,j,jcel) = force(2,j,jcel) + f (2)
    force(3,j,jcel) = force(3,j,jcel) + f (3)
   end do
   force(1,i,icel) = force(1,i,icel) + force_temp(1)
   force(2,i,icel) = force(2,i,icel) + force_temp(2)
   force(3,i,icel) = force(3,i,icel) + force_temp(3)
  end do
end do