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 caculates the distance projected on the \(x, y\) or \(z\) axis between the position of some test particle and this surface of constant field density.

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 esimtation
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
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 parallelize
LOWMEM ( default=off ) lower the memory requirements
TIMINGS

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

Examples

In this example atoms 2-100 are assumed to be concentraed along some part of the \(z\) axis so that you an interface between a liquid/solid and the vapour. 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.

dens: DENSITY SPECIES=2-100
dc: DISTANCE_FROM_CONTOUR DATA=dens ATOM=1 BANDWIDTH=0.5,0.5,0.5 DIR=z CONTOUR=0.2