Periodic Boundary Conditions - Practical Implementation: Continuity and The Minimum Image Convention

Practical Implementation: Continuity and The Minimum Image Convention

To implement periodic boundary conditions in practice, at least two steps are needed.

The first is to make an object which leaves the simulation cell on one side enter back on the other. This is of course a simple operation, and could in code be e.g. (for the x dimension, assuming an orthogonal unit cell centered on the origin):

if (periodicx) then if (x < -xsize*0.5) x=x+xsize if (x >= xsize*0.5) x=x-xsize endif

The second is to make sure that every distance between atoms, or other vector calculated from one atom to another, has a length and direction which corresponds to the minimum image criterion. This can be achieved as follows to calculate e.g. the x direction distance component from atom i to atom j:

if (periodicx) then dx = x(j) - x(i) if (abs(dx) > xsize*0.5) dx = dx - sign(xsize,dx) endif

Naturally both operations should be repeated in all 3 dimensions.

These operations can be written in much more compact form for orthorhombic cells if the origin is shifted to a corner of the box. Then we have, in one dimension, for positions and distances respectively:

! After x(i) update without regard to PBC: x(i)=x(i)-floor(x(i)/xsize)*xsize !For a box with the origin at the lower left vertex ! Works for xs lying in any image. dx=x(j)-x(i) dx=dx-nint(dx/(0.5*xsize))*xsize

For non-orthorhombic cells the situation can be considerably more complicated.

In simulations of ionic systems considerably more complicated operations may be needed to handle the long-range Coulomb interactions.

Read more about this topic:  Periodic Boundary Conditions

Famous quotes containing the words practical, continuity, minimum, image and/or convention:

    Juggling produces both practical and psychological benefits.... A woman’s involvement in one role can enhance her functioning in another. Being a wife can make it easier to work outside the home. Being a mother can facilitate the activities and foster the skills of the efficient wife or of the effective worker. And employment outside the home can contribute in substantial, practical ways to how one works within the home, as a spouse and as a parent.
    Faye J. Crosby (20th century)

    Only the family, society’s smallest unit, can change and yet maintain enough continuity to rear children who will not be “strangers in a strange land,” who will be rooted firmly enough to grow and adapt.
    Salvador Minuchin (20th century)

    After decades of unappreciated drudgery, American women just don’t do housework any more—that is, beyond the minimum that is required in order to clear a path from the bedroom to the front door so they can get off to work in the mourning.
    Barbara Ehrenreich (20th century)

    The essence of the physicality of the most famous blonde in the world is a wholesome eroticism blurred a little round the edges by the fact she is not quite sure what eroticism is. This gives her her tentative luminosity and what makes her, somehow, always more like her own image in the mirror than she is like herself.
    Angela Carter (1940–1992)

    No good poetry is ever written in a manner twenty years old, for to write in such a manner shows conclusively that the writer thinks from books, convention and cliché, not from real life.
    Ezra Pound (1885–1972)