Next: Moving Constraints
Up: User Defined Forces
Previous: External Electric Field
Contents
Index
NAMD provides the ability to specify grids describing a potential in the simulation
space. Each atom is affected by the potential based on its charge and its position,
using the potential function interpolated from the specified grid(s). Energy due to the
grid-defined field will be reported in the MISC column of the output, unless a scaling
factor not proportional to (1,1,1) is used.
NAMD allows the definition of multiple grids, each with a separate set of defining
parameters. This is specified using a tag field in each of the mgridforceXXX commands.
The tag is an alphanumeric string without spaces which identifies to which grid the
specified field applies.
The grid file format is a subset of the DataExplorer DX file format. as shown below:
# Lines at the beginning of the file starting with a # symbol
# are ignored as comments
# Variables (replaced by numbers in an actual file):
# xn, yn, and zn are the number of data points along each dimension;
# xorg, yorg, and zorg is the origin of the grid, in angstroms;
# x[1-3]del, y[1-3]del, and z[1-3]del are the basis vectors which transform
# grid indices to coordinates in angstroms:
# x(i,j,k) = xorg + i * x1del + j * y1del + k * z1del
# y(i,j,k) = yorg + i * x2del + j * y2del + k * z2del
# z(i,j,k) = zorg + i * x3del + j * y3del + k * z3del
#
# Grid data follows, with three values per line, ordered z fast, y medium,
# and x slow. Exactly xn*yn*zn values should be given
#
# Note: Other features of the DX file format are not handled by this code
#
object 1 class gridpositions counts xn yn zn
origin xorg yorg zorg
delta x1del y1del z1del
delta x2del y2del z2del
delta x3del y3del z3del
object 2 class gridconnections counts xn yn zn
object 3 class array type double rank 0 items [ xn*yn*zn ] data follows
f1 f2 f3
f4 f5 f6
.
.
.
Each dimension of the grid may be specified as continuous or not. If the grid is not continuous in a particular dimension, the potential grid is padded with one border slices on each non-continuous face of the grid, and border grid values are computed so that the force felt by an atom outside the grid goes to zero. If the grid is continuous along a particular dimension, atoms outside the grid are affected by a potential that is interpolated from the grid and its corresponding periodic image along that dimension.
To calculate the force on an atom due to the grid, the atom's coordinates are transformed according to the current basis vectors of the simulation box to a coordinate frame that is centered at the center of the specified grid. Note that the size and spatial coordinates of the grid remain fixed, and are not scaled as the size of the simulation box fluctuates. For atoms within the grid, the force is computed by analytically determining the gradient of the tricubic polynomial used to interpolate the potential from surrounding grid values. For atoms outside the grid, the state of the mgridforcecont[1,2,3] determine whether the force is zero, or computed from the images of the grid as described above. Note that if the grid is ever larger than the periodic box, it is truncated at the edge of that box. The consequence of this is that the computed potential will not vary smoothly at the edges, introducing numerical instability.
The following parameters describe the grid-based potentials.
- mgridforce
apply grid forces?
Acceptable Values: yes or no
Default Value: no
Description: Specifies whether or not any grid forces are being applied.
- mgridforcefile
tag
PDB file specifying force multipliers and charges for each atomd
Acceptable Values: UNIX file name
Description: The force on each atom is scaled by the corresponding value in this PDB file. By setting the force multiplier to zero for an atom, it will not be affected by the grid force.
- mgridforcecol
tag
column of PDB from which to read force multipliers
Acceptable Values: X, Y, Z, O, or B
Default Value: B
Description: Which column in the PDB file specified by mgridforcefile contains the scaling factor
- mgridforcechargecol
tag
column of PDB from which to read atom charges
Acceptable Values: X, Y, Z, O, or B
Default Value: Atom charge used for electrostatics.
Description: Which column in the PDB file specified by mgridforcefile contains the atom charge. By default, the charge value specified for the short-range Columb interactions are also used for the grid force. Both mgridforcecol and mgridforceqcol can be specified, in which case the apparent charge of the atom will be the product of the two values.
- mgridforcepotfile
tag
grid potential file name
Acceptable Values: UNIX file name
Description: File specifying the grid size, coordinates, and potential values.
- mgridforcevolts
tag
grid potential units in eV/charge
Acceptable Values: yes or no
Default Value: no
Description: If set, the grid potential values are expressed in eV. Otherwise, values are
in
- mgridforcescale
tag
scale factor for grid potential
Acceptable Values: Vector of decimals scale
scale
scale
Default Value: 1 1 1
Description: Scale factor applied to the grid potential values
- mgridforcecont1
tag
Is grid continuous in the direction of the first basis vector
Acceptable Values: yes or no
Default Value: no
Description: By specifying that the grid is continuous in a direction, atoms outside of the grid will be affected by a force determined by interpolating based on the values at the edge of the grid with the values of the corresponding edge of the periodic image of the grid. The current size of the simulation box is taken into account, so that as the simulation box size fluctuates, the force on an atom outside of the grid varies continuously until it re-enters the opposite edge of the grid. If the grid is not continuous in this direction, the interpolated force on atoms near the edge of the grid is calculated so that it continuously approaches zero as an atom approaches the edge of the grid.
- mgridforcecont2
tag
Is grid continuous in the direction of the second basis vector
Acceptable Values: yes or no
Default Value: no
Description: Operates the same as mgridforcecont1 except applies in the direction of the second basis vector
- mgridforcecont3
tag
Is grid continuous in the direction of the third basis vector
Acceptable Values: yes or no
Default Value: no
Description: Operates the same as mgridforcecont1 except applies in the direction of the third basis vector
- mgridforcevoff
tag
Offset periodic images of the grid by specified amounts
Acceptable Values: vector of decimals (x y z)
Description: If a continuous grid is used along a particular basis vector, it may be desirable to shift the potentials in the image to manipulate the potential outside the grid. For example, consider the case where the potential is a ramp in the
direction and the grid is defined for points
, with a potential
given by
. By shifting the images of the grid, the potential can be transformed as illustrated in Fig. 5.
Figure 5:
Graph showing a slice of a ramp potential, with eight grid points along the axis, and a periodic cell size which just contains the grid. The Unshifted case shows how the pontential is not smooth when mgridforcevoff is not specified, or set to zero. The Shifted potential shows the grid that results when mgridfocevoff is set so that the wrapped potential is offset so that the potential has constant slope at the periodic boundaries.
|
Next: Moving Constraints
Up: User Defined Forces
Previous: External Electric Field
Contents
Index
namd@ks.uiuc.edu