DISTANCE_FROM_CONTOUR
This is part of the contour module
It is only available if you configure PLUMED with ./configure –enable-modules=contour . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list.

Calculate the perpendicular distance from a Willard-Chandler dividing surface.

Suppose that you have calculated a multicolvar. By doing so you have calculated a set of colvars, \(s_i\), and each of these colvars has a well defined position in space \((x_i,y_i,z_i)\). You can use this information to calculate a phase-field model of the colvar density using:

\[ p(x,y,x) = \sum_{i} s_i K\left[\frac{x-x_i}{\sigma_x},\frac{y-y_i}{\sigma_y},\frac{z-z_i}{\sigma_z} \right] \]

In this expression \(\sigma_x, \sigma_y\) and \(\sigma_z\) are bandwidth parameters and \(K\) is one of the kernelfunctions. This is what is done within MULTICOLVARDENS

The Willard-Chandler surface is a surface of constant density in the above phase field \(p(x,y,z)\). In other words, it is a set of points, \((x',y',z')\), in your box which have:

\[ p(x',y',z') = \rho \]

where \(\rho\) is some target density. This action calculates the distance projected on the \(x, y\) or \(z\) axis between the position of some test particle and this surface of constant field density.

Examples

In this example atoms 2-100 are assumed to be concentrated along some part of the \(z\) axis so that you an interface between a liquid/solid and the vapor. The quantity dc measures the distance between the surface at which the density of 2-100 atoms is equal to 0.2 and the position of the test particle atom 1.

Click on the labels of the actions for more information on what each action computes
tested on master
dens: DENSITY 
SPECIES
compulsory keyword the atoms in the group
=2-100 dc: DISTANCE_FROM_CONTOUR
DATA
could not find this keyword
=dens
ATOM
The atom whose perpendicular distance we are calculating from the contour.
=1
BANDWIDTH
compulsory keyword the bandwidths for kernel density esimtation
=0.5,0.5,0.5
DIR
compulsory keyword the direction perpendicular to the contour that you are looking for
=z
CONTOUR
compulsory keyword the value we would like for the contour
=0.2
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities 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
dist1 the distance between the reference atom and the nearest contour
dist2 the distance between the reference atom and the other contour
qdist the differentiable (squared) distance between the two contours (see above)
thickness the distance between the two contours on the line from the reference atom
The atoms involved can be specified using
POSITIONS the positions of the atoms that we are calculating the contour from. For more information on how to specify lists of atoms see Groups and Virtual Atoms
ATOM The atom whose perpendicular distance we are calculating from the contour. For more information on how to specify lists of atoms see Groups and Virtual Atoms
Compulsory keywords
BANDWIDTH the bandwidths for kernel density esimtation
KERNEL ( default=GAUSSIAN ) the kernel function you are using. More details on the kernels available in plumed plumed can be found in kernelfunctions.
CUTOFF ( default=6.25 ) the cutoff at which to stop evaluating the kernel functions is set equal to sqrt(2*x)*bandwidth in each direction where x is this number
CONTOUR the value we would like for the contour
DIR the direction perpendicular to the contour that you are looking for
TOLERANCE ( default=0.1 ) this parameter is used to manage periodic boundary conditions. The problem here is that we can be between contours even when we are not within the membrane because of periodic boundary conditions. When we are in the contour, however, we should have it so that the sums of the absolute values of the distances to the two contours is approximately the distance between the two contours. There can be numerical errors in these calculations, however, so we specify a small tolerance here
Options
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 proceeding 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 components 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.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...