next up previous contents index
Next: Full electrostatic integration Up: Basic Simulation Parameters Previous: Basic Simulation Parameters   Contents   Index

Subsections


Non-bonded interaction parameters and computations

NAMD has a number of options that control the way that non-bonded interactions are calculated. These options are interrelated and can be quite confusing, so this section attempts to explain the behavior of the non-bonded interactions and how to use these parameters.

Non-bonded van der Waals interactions

The simplest non-bonded interaction is the van der Waals interaction. In NAMD, van der Waals interactions are always truncated at the cutoff distance, specified by cutoff. The main option that effects van der Waals interactions is the switching parameter. With this option set to on, a smooth switching function will be used to truncate the van der Waals potential energy smoothly at the cutoff distance. A graph of the van der Waals potential with this switching function is shown in Figure 1. If switching is set to off, the van der Waals energy is just abruptly truncated at the cutoff distance, so that energy may not be conserved.

Figure 1: Graph of van der Waals potential with and without the application of the switching function. With the switching function active, the potential is smoothly reduced to 0 at the cutoff distance. Without the switching function, there is a discontinuity where the potential is truncated.
\includegraphics{figures/switching}

The switching function used is based on the X-PLOR switching function. The parameter switchdist specifies the distance at which the switching function should start taking effect to bring the van der Waals potential to 0 smoothly at the cutoff distance. Thus, the value of switchdist must always be less than that of cutoff.

Non-bonded electrostatic interactions

The handling of electrostatics is slightly more complicated due to the incorporation of multiple timestepping for full electrostatic interactions. There are two cases to consider, one where full electrostatics is employed and the other where electrostatics are truncated at a given distance.

First let us consider the latter case, where electrostatics are truncated at the cutoff distance. Using this scheme, all electrostatic interactions beyond a specified distance are ignored, or assumed to be zero. If switching is set to on, rather than having a discontinuity in the potential at the cutoff distance, a shifting function is applied to the electrostatic potential as shown in Figure 2. As this figure shows, the shifting function shifts the entire potential curve so that the curve intersects the x-axis at the cutoff distance. This shifting function is based on the shifting function used by X-PLOR.

Figure 2: Graph showing an electrostatic potential with and without the application of the shifting function.
\includegraphics{figures/shifting}

Next, consider the case where full electrostatics are calculated. In this case, the electrostatic interactions are not truncated at any distance. In this scheme, the cutoff parameter has a slightly different meaning for the electrostatic interactions -- it represents the local interaction distance, or distance within which electrostatic pairs will be directly calculated every timestep. Outside of this distance, interactions will be calculated only periodically. These forces will be applied using a multiple timestep integration scheme as described in Section 5.2.

Figure 3: Graph showing an electrostatic potential when full electrostatics are used within NAMD, with one curve portion calculated directly and the other calculated using DPMTA.
\includegraphics{figures/fmaOn}

Nonbonded interaction distance-testing

The last critical parameter for non-bonded interaction calculations is the parameter pairlistdist. To reduce the cost of performing the non-bonded interactions, NAMD uses a non-bonded pair list which contained all pairs of atoms for which non-bonded interactions should be calculated. Performing the search for pairs of atoms that should have their interactions calculated is an expensive operation. Thus, the pair list is only calculated periodically, at least once per cycle. Unfortunately, pairs of atoms move relative to each other during the steps between preparation of the pair list. Because of this, if the pair list were built to include only those pairs of atoms that are within the cutoff distance when the list is generated, it would be possible for atoms to drift closer together than the cutoff distance during subsequent timesteps and yet not have their non-bonded interactions calculated.

Let us consider a concrete example to better understand this. Assume that the pairlist is built once every ten timesteps and that the cutoff distance is 8.0 Å. Consider a pair of atoms A and B that are 8.1 Å apart when the pairlist is built. If the pair list includes only those atoms within the cutoff distance, this pair would not be included in the list. Now assume that after five timesteps, atoms A and B have moved to only 7.9 Å apart. A and B are now within the cutoff distance of each other, and should have their non-bonded interactions calculated. However, because the non-bonded interactions are based solely on the pair list and the pair list will not be rebuilt for another five timesteps, this pair will be ignored for five timesteps causing energy not to be conserved within the system.

To avoid this problem, the parameter pairlistdist allows the user to specify a distance greater than the cutoff distance for pairs to be included in the pair list, as shown in Figure 4. Pairs that are included in the pair list but are outside the cutoff distance are simply ignored. So in the above example, if the pairlistdist were set to $10.0$ Å, then the atom pair A and B would be included in the pair list, even though the pair would initially be ignored because they are further apart than the cutoff distance. As the pair moved closer and entered the cutoff distance, because the pair was already in the pair list, the non-bonded interactions would immediately be calculated and energy conservation would be preserved. The value of pairlistdist should be chosen such that no atom pair moves more than $\mbox{{\tt pairlistdist}}-\mbox{{\tt cutoff}}$ in one cycle. This will insure energy conservation and efficiency.

Figure 4: Depiction of the difference between the cutoff distance and the pair list distance. The pair list distance specifies a sphere that is slightly larger than that of the cutoff so that pairs are allowed to move in and out of the cutoff distance without causing energy conservation to be disturbed.
\includegraphics{figures/pairlistdist}

The pairlistdist parameter is also used to determine the minimum patch size. Unless the splitPatch parameter is explicitly set to position, hydrogen atoms will be placed on the same patch as the ``mother atom'' to which they are bonded. These hydrogen groups are then distance tested against each other using only a cutoff increased by the the value of the hgroupCutoff parameter. The size of the patches is also increased by this amount. NAMD functions correctly even if a hydrogen atom and its mother atom are separated by more than half of hgroupCutoff by breaking that group into its individual atoms for distance testing. Margin violation warning messages are printed if an atom moves outside of a safe zone surrounding the patch to which it is assigned, indicating that pairlistdist should be increased in order for forces to be calculated correctly and energy to be conserved.

Margin violations mean that atoms that are in non-neighboring patches may be closer than the cutoff distance apart. This may sometimes happen in constant pressure simulations when the cell shrinks (since the patch grid remains the same size). The workaround is to increase the margin parameter so that the simulation starts with fewer, larger patches. Restarting the simulation will also regenerate the patch grid.

In rare special circumstances atoms that are involved in bonded terms (bonds, angles, dihedrals, or impropers) or nonbonded exclusions (especially implicit exclusions due to bonds) will be placed on non-neighboring patches because they are more than the cutoff distance apart. This can result in the simulation dying with a message of ``bad global exclusion count''. If an ``atoms moving too fast; simulation has become unstable'', ``bad global exclusion count'', or similar error happens on the first timestep then there is likely something very wrong with the input coordinates, such as the atoms with uninitialized coordinates or different atom orders in the PSF and PDB file. Looking at the system in VMD will often reveal an abnormal structure. Be aware that the atom IDs in the ``Atoms moving too fast'' error message are 1-based, while VMD's atom indices are 0-based. If an ``atoms moving too fast; simulation has become unstable'', ``bad global exclusion count'', or similar error happens later in the simulation then the dynamics have probably become unstable, resulting in the system ``exploding'' apart. Energies printed at every timestep should show an exponential increase. This may be due to a timestep that is too long, or some other strange feature. Saving a trajectory of every step and working backwards in can also sometimes reveal the origin of the instability.


next up previous contents index
Next: Full electrostatic integration Up: Basic Simulation Parameters Previous: Basic Simulation Parameters   Contents   Index
namd@ks.uiuc.edu