Topic 2: Molecular Dynamics of Lennard-Jones System (Continued)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

High Performance Computing II

Lecture 9

Topic 2: Molecular Dynamics of Lennard-Jones System (continued)


Many molecular dynamics programs use spatial decomposition, a finite range cutoff,
and neighbor lists. Dr. Nakanos program pmd.c and pmd.h is a nice implementation
of these important concepts. He has a writeup describing this program.

Finite Range Force Cutoff


The evaluation of forces scales like O(N 2) if all pairs of particles are taken into account.
However, the Lennard-Jones potential energy function
 

12  6
U (r) = 4

r
r
falls off fairly rapidly with increasing r, so the forces between particles that are very
far apart may be negligible.
A reasonable approximation is to cut off the force for r > rc where rc is some suitably chosen cutoff radius. Unfortunately, doing this violates conservation of energy:
because Newtons equations are discretized, the energy of a pair changes by a constant amount U (rc) rather than a quantity proportional to the time step h when the
separation crosses the cutoff length. This can be corrected by shifting the potential
function

U (r) U (rc), for r rc
Uc(r) =
0,
for r > rc
Page 1

February 13, 2002

High Performance Computing II

Lecture 9

While this shifted potential is continuous at r = rc, the force, which has strength
dUc/dr is discontinuous at r = rc. This discontinuity can cause instabilities in the
integration algorithm. A simple remedy for this problem is to modify the potential
further


dU
Uc(r) = U (r) U (rc) dr r=rc (r rc), for r rc
0,
for r > rc
so that

dUc
F (r) F (rc), for r rc
Fc(r) =
=
0,
for r > rc
dr
is continuous at r = rc.
Since the potential and force have now been changed, observables such as the pressure
must also be corrected. For example, it can be shown that
Z
4N 2
hU i = hUci +
r drU (r)g(r) ,
V
rc
where g(r) is the radial distribution function, which can be approximated in the integral
by g(r) = 1. Similarly, the virial formula for the pressure can be corrected using
*N
+
Z
X
1
N
dU (r)
P V = N kB T
ri Fci
r 3dr
g(r) .
3 i=1
3V rc
dr
Note that the averages in these formulas involve pairs with r rc and calculating the
averages scales like O(N ).
Page 2

February 13, 2002

High Performance Computing II

Lecture 9

Neighbor Lists and Cell Structures


If only pairs with a separation r rc are taken into account, the total number of pairs
scales like O(N ). However there is still a problem! How do we decided which pairs
have separation r rc without actually measuring r for all pairs? Two useful ways of
solving this problem are:
Verlet Neighbor List: A list of all particle pairs with separation rmax > rc is maintained and updated every say 10 or 20 time steps. rmax is chosen large enough
that it is unlikely that a particle pair not in the list will come closer than rc before
the list is updated.
It is also possible to decide automatically when the neighbor list needs to be
updated. When the list is created, a vector for each particle is set to zero. At
each time step, the vector is incremented by the particle displacement. The list
is updated when the sum of the magnitudes of the two largest vectors exceeds
rmax rc.
The neighbor list method becomes inefficient for very large N because each update
requires O(N 2) tests.
Cell Structures and Linked Lists: The system volume V is divided into cubic cells
of side ` > rc. At each time step, the particles in each cube are stored in a linked
list. Particles in a given cell interact only with particles in the 26 neighboring
cells. For given rc, the number of such pairs scales like O(N ), and so does the
construction of the linked lists.
Page 3

February 13, 2002

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy