DISTANCE_FROM_CONTOUR
This is part of the multicolvar module

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 v2.8
dens: DENSITY 
SPECIES
this keyword is used for colvars such as coordination number.
=2-100 dc: DISTANCE_FROM_CONTOUR
DATA
compulsory keyword The input base multicolvar which is being used to calculate the contour
=dens
ATOM
The atom whose perpendicular distance we are calculating from the contour.
=1
BANDWIDTH
compulsory keyword the bandwidths for kernel density estimation
=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

When the label of this action is used as the input for a second you are not referring to a scalar quantity as you are in regular collective variables. The label is used to reference the full set of quantities calculated by the action. This is usual when using MultiColvar functions. Generally when doing this the previously calculated multicolvar will be referenced using the DATA keyword rather than ARG.

This Action can be used to calculate the following scalar quantities directly. These quantities are calculated by employing the keywords listed below. These quantities can then be referenced elsewhere in the input file by using this Action's label followed by a dot and the name of the quantity. Some of them can be calculated multiple times with different parameters. In this case the quantities calculated can be referenced elsewhere in the input by using the name of the quantity followed by a numerical identifier e.g. label.lessthan-1, label.lessthan-2 etc. When doing this and, for clarity we have made it so that the user can set a particular label for each of the components. As such by using the LABEL keyword in the description of the keyword input you can customize the component name

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

In addition the following quantities can be calculated by employing the keywords listed below

Quantity Keyword Description
gradient GRADIENT the gradient
vmean VMEAN the norm of the mean vector. The output component can be referred to elsewhere in the input file by using the label.vmean
vsum VSUM the norm of sum of vectors. The output component can be referred to elsewhere in the input file by using the label.vsum
spath SPATH the position on the path
gspath GPATH the position on the path calculated using trigonometry
gzpath GPATH the distance from the path calculated using trigonometry
zpath ZPATH the distance from the path
altmin ALT_MIN the minimum value. This is calculated using the formula described in the description of the keyword so as to make it continuous.
between BETWEEN the number/fraction of values within a certain range. This is calculated using one of the formula described in the description of the keyword so as to make it continuous. You can calculate this quantity multiple times using different parameters.
highest HIGHEST the highest of the quantities calculated by this action
lessthan LESS_THAN the number of values less than a target value. This is calculated using one of the formula described in the description of the keyword so as to make it continuous. You can calculate this quantity multiple times using different parameters.
lowest LOWEST the lowest of the quantities calculated by this action
max MAX the maximum value. This is calculated using the formula described in the description of the keyword so as to make it continuous.
mean MEAN the mean value. The output component can be referred to elsewhere in the input file by using the label.mean
min MIN the minimum value. This is calculated using the formula described in the description of the keyword so as to make it continuous.
moment MOMENTS the central moments of the distribution of values. The second moment would be referenced elsewhere in the input file using label.moment-2, the third as label.moment-3, etc.
morethan MORE_THAN the number of values more than a target value. This is calculated using one of the formula described in the description of the keyword so as to make it continuous. You can calculate this quantity multiple times using different parameters.
sum SUM the sum of values
The atoms involved can be specified using
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
DATA The input base multicolvar which is being used to calculate the contour
BANDWIDTH the bandwidths for kernel density estimation
KERNEL ( default=gaussian ) the kernel function you are using. More details on the kernels available in plumed plumed can be found in kernelfunctions.
DIR the direction perpendicular to the contour that you are looking for
CONTOUR the value we would like for the contour
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
NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically
NOPBC ( default=off ) ignore the periodic boundary conditions when calculating distances
SERIAL ( default=off ) do the calculation in serial. Do not use MPI
LOWMEM ( default=off ) lower the memory requirements
TIMINGS

( default=off ) output information on the timings of the various parts of the calculation