Skip to content

Action: FIND_CONTOUR_SURFACE

Module contour
Description Usage
Find an isocontour by searching along either the x, y or z direction. used in 0 tutorialsused in 1 eggs
output value type
a grid containing the location of the points in the Willard-Chandler surface along the chosen direction grid

Details and examples

Find an isocontour by searching along either the x, y or z direction.

As discussed in the documentation for the gridtools, PLUMED contains a number of tools that allow you to calculate a function on a grid. The function on this grid might be a HISTOGRAM or it might be one of the phase fields that are discussed here. If this function has one or two input arguments it is relatively straightforward to plot the function. If by contrast the data has a three dimensions it can be difficult to visualize.

This action provides one tool for visualizing these functions. It can be used to search for a set of points on a contour where the function takes a particular value. In other words, for the function this action would find a set of points that have:

where is some constant value that is specified by the user. The points on this contour are find by searching along lines that run parallel to the , or axis of the simulation cell. The result is, therefore, a two dimensional function evaluated on a grid that gives us the height of the interface as a function of two coordinates.

It is important to note that this action can only be used to detect contours in three dimensional functions. In addition, this action will fail to find the full set of contour points if the contour does not have the same topology as an infinite plane. If you are uncertain that the isocontours in your function have the appropriate topology you should use FIND_CONTOUR in place of this action.

Examples

The input shown below was used to analyze the results from a simulation of an interface between solid and molten Lennard Jones. The interface between the solid and the liquid was set up in the plane perpendicular to the direction of the simulation cell. The input below calculates something akin to a Willard-Chandler dividing surface (see contour) between the solid phase and the liquid phase. There are two of these interfaces within the simulation box because of the periodic boundary conditions but we were able to determine that one of these two surfaces lies in a particular part of the simulation box. The input below detects the height profile of one of these two interfaces. It does so by computing a phase field average from the values, , of the FCCUBIC symmetry functions for each of the atoms using the following expression.

where is the position of atom relative to the position of atom 1, is a Gaussian kernel function and .

Notice that we use the fact that we know roughly where the interface is when specifying how this phase field is to be calculated and specify the region over the -axis in which the KDE is computed. Once we have calculated the phase field we search for contour points on the lines that run parallel to the -direction of the cell box using the FIND_CONTOUR_SURFACE command. The final result is a grid of values for the height of the interface as a function of the position. This grid is then output to a file called contour2.dat.

Notice that the commands below calculate the instantaneous position of the surface separating the solid and liquid and that as such the accumulated average is cleared on every step.

Click on the labels of the actions for more information on what each action computes
tested on2.11
UNITSThis command sets the internal units for the code. More details NATURAL use natural units

# This calculates the value of a set of symmetry functions for the atoms of interest fcc: FCCUBICMeasure how similar the environment around atoms is to that found in a FCC structure. This action is a shortcut. More details ... SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-96000 SWITCHthe switching function that it used in the construction of the contact matrix. Options for this keyword are explained in the documentation for LESS_THAN.={CUBIC D_0=1.2 D_MAX=1.5} ALPHA The alpha parameter of the angular function that is used for FCCUBIC=27 PHI The Euler rotational angle phi=0.0 THETA The Euler rotational angle theta=-1.5708 PSI The Euler rotational angle psi=-2.35619 ...
# This determines the positions of the atoms of interest relative to the position of atom 1 dens2_dist: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ORIGINcalculate the distance of all the atoms specified using the ATOMS keyword from this point=1 ATOMSthe pairs of atoms that you would like to calculate the angles for=fcc COMPONENTS calculate the x, y and z components of the distance separately and store them as label # This computes the numerator in the expression above for the phase field dens2_numer: KDECreate a histogram from the input scalar/vector/matrix using KDE This action has hidden defaults. More details ... VOLUMESthis keyword take the label of an action that calculates a vector of values=fcc_n ARGthe label for the value that should be used to construct the histogram=dens2_dist.x,dens2_dist.y,dens2_dist.z GRID_BINthe number of bins for the grid=14,14,50 GRID_MIN the lower bounds for the grid=auto,auto,6.0 GRID_MAX the upper bounds for the grid=auto,auto,11.0 BANDWIDTHthe bandwidths for kernel density esimtation=1.0,1.0,1.0 ... # This computes the denominator dens2_denom: KDECreate a histogram from the input scalar/vector/matrix using KDE This action has hidden defaults. More details ... ARGthe label for the value that should be used to construct the histogram=dens2_dist.x,dens2_dist.y,dens2_dist.z GRID_BINthe number of bins for the grid=14,14,50 GRID_MIN the lower bounds for the grid=auto,auto,6.0 GRID_MAX the upper bounds for the grid=auto,auto,11.0 BANDWIDTHthe bandwidths for kernel density esimtation=1.0,1.0,1.0 ... # This computes the final phase field dens2: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=dens2_numer,dens2_denom FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # We can now find and print the location of the two dimensional contour surface ss2: FIND_CONTOUR_SURFACEFind an isocontour by searching along either the x, y or z direction. This action has hidden defaults. More details ARGthe labels of the grid in which the contour will be found=dens2 CONTOURthe value we would like to draw the contour at in the space=0.42 SEARCHDIRIn which directions do you wish to search for the contour=dens2_dist.z DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=ss2 FILE the file on which to write the grid=contour2.dat STRIDE the frequency with which the grid should be output to the file=1

Input

The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
ARG grid the labels of the grid in which the contour will be found

Full list of keywords

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
ARG input none the labels of the grid in which the contour will be found
CONTOUR compulsory none the value we would like to draw the contour at in the space
INTERPOLATION_TYPE compulsory spline the method to use for interpolation
SEARCHDIR compulsory none In which directions do you wish to search for the contour
SERIAL optional false do the calculation in serial. Further information about this flag can be found here.
USEGPU optional false run this calculation on the GPU. Further information about this flag can be found here.

References

More information about how this action can be used is available in the following articles: