EXTERNAL
This is part of the bias module

Calculate a restraint that is defined on a grid that is read during start up

Description of components

By default this Action calculates the following quantities. These quanties can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Description
bias the instantaneous value of the bias potential
Compulsory keywords
ARG the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or *.* appears the scalars calculated by all the proceding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three componets x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.
FILE the name of the file containing the external potential.
Options
NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically
NOSPLINE ( default=off ) specifies that no spline interpolation is to be used when calculating the energy and forces due to the external potential
SPARSE

( default=off ) specifies that the external potential uses a sparse grid

Examples
The following is an input for a calculation with an external potential that is defined in the file bias.dat and that acts on the distance between atoms 3 and 5.
DISTANCE ATOMS=3,5 LABEL=d1
EXTERNAL ARG=d1 FILE=bias.dat LABEL=external 
(See also DISTANCE PRINT).

The header in the file bias.dat should read:

#! FIELDS d1 external.bias der_d1
#! SET min_d1 0.0
#! SET max_d1 1.0
#! SET nbins_d1 100
#! SET periodic_d1 false

This should then be followed by the value of the potential and its derivative at 100 equally spaced points along the distance between 0 and 1. If you run with NOSPLINE you do not need to provide derivative information.

You can also include grids that are a function of more than one collective variable. For instance the following would be the input for an external potential acting on two torsional angles:

TORSION ATOMS=4,5,6,7 LABEL=t1
TORSION ATOMS=6,7,8,9 LABEL=t2
EXTERNAL ARG=t1,t2 FILE=bias.dat LABEL=ext

The header in the file bias.dat for this calculation would read:

#! FIELDS t1 t2 ext.bias der_t1 der_t2
#! SET min_t1 -pi
#! SET max_t1 +pi
#! SET nbins_t1 100
#! SET periodic_t1 true
#! SET min_t2 -pi
#! SET max_t2 +pi
#! SET nbins_t2 100
#! SET periodic_t2 true

This would be then followed by 100 blocks of data. In the first block of data the value of t1 (the value in the first column) is kept fixed and the value of the function is given at 100 equally spaced values for t2 between \(-pi\) and \(+pi\). In the second block of data t1 is fixed at \(-pi + \frac{2pi}{100}\) and the value of the function is given at 100 equally spaced values for t2 between \(-pi\) and \(+pi\). In the third block of data the same is done but t1 is fixed at \(-pi + \frac{4pi}{100}\) and so on untill you get to the 100th block of data where t1 is fixed at \(+pi\).

Please note the order that the order of arguments in the plumed.dat file must be the same as the order of arguments in the header of the grid file.