Action: FIND_SPHERICAL_CONTOUR
| Module |
contour |
| Description |
Usage |
| Find an isocontour in a three dimensional grid by searching over a Fibonacci sphere. |
  |
| output value |
type |
| a grid on a Fibonacci sphere that describes the radial distance from the origin for the points on the Willard-Chandler surface |
grid |
Details and examples
Find an isocontour in a three dimensional grid by searching over a Fibonacci sphere.
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 a
set of equally spaced radii of a sphere that centered at on particular, user-specified atom or virtual atom. To ensure that
these search radii are equally spaced on the surface of the sphere the search directions are generated by using a Fibonacci
spiral projected on a sphere. In other words, the search directions are given by:
where is the second component of the vector defined above, is the number of directions to look in and is
where is a random variable between 0 and that is generated during the read in of the input file and that is fixed during
the whole calculation.
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 a sphere. If you are uncertain that the isocontours in your
function have a spherical topology you should use FIND_CONTOUR instead.
Examples
The following input demonstrates how this action can be used. The input here is used to study the shape of a droplet that has been formed during the
condensation of Lennard Jones from the vapor. The input below achieves this by calculating the coordination numbers, , of all the atoms within the gas.
Obviously, those atoms within the droplet will have a large value for the coordination number while the isolated atoms in the gas will have a low value.
We can detect the sizes of the droplets by constructing a matrix whose element tells us whether atom and atom are within 6 nm of each other and
both have coordination numbers that are greater that two. The atoms within the various droplets within the system can then be found by performing a
DFSCLUSTERING on this matrix to detect the connected components. We can take the largest of these connected components and find the center of the droplet
by exploiting the functionality within CENTER. We can then construct a phase field based on the positions of the atoms in the largest
cluster and the values of the coordination numbers of these atoms as follows:
where is a switching function. The final line in the input then finds the a set of points on the dividing surface that separates
the droplet from the surrounding gas. The value of the phase field on this isocontour is equal to 0.75.
c1The COORDINATIONNUMBER action with label c1 calculates the following quantities:| Quantity | Type | Description |
| c1 | vector | the coordination numbers of the specified atoms |
: COORDINATIONNUMBERCalculate the coordination numbers of atoms so that you can then calculate functions of the distribution of 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-512 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.={EXP D_0=4.0 R_0=0.5 D_MAX=6.0}
# c1: COORDINATIONNUMBER SPECIES=1-512 SWITCH={EXP D_0=4.0 R_0=0.5 D_MAX=6.0}
c1_grpThe GROUP action with label c1_grp calculates the following quantities:| Quantity | Type | Description |
| c1_grp | atoms | indices of atoms specified in GROUP |
: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=1-512
c1_matThe CONTACT_MATRIX action with label c1_mat calculates the following quantities:| Quantity | Type | Description |
| c1_mat | matrix | a matrix containing the weights for the bonds between each pair of atoms |
: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-512 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={EXP D_0=4.0 R_0=0.5 D_MAX=6.0}
c1_onesThe CONSTANT action with label c1_ones calculates the following quantities:| Quantity | Type | Description |
| c1_ones | vector | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=512
c1The MATRIX_VECTOR_PRODUCT action with label c1 calculates the following quantities:| Quantity | Type | Description |
| c1 | vector | the vector that is obtained by taking the product between the matrix and the vector that were input |
: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=c1_mat,c1_ones
# --- End of included input ---
cfThe MORE_THAN action with label cf calculates the following quantities:| Quantity | Type | Description |
| cf | vector | the vector obtained by doing an element-wise application of a function that is one if the if the input is more than a threshold to the input vectors |
: MORE_THANUse a switching function to determine how many of the input variables are more than a certain cutoff. More details ARGthe values input to this function=c1 SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL D_0=2.0 R_0=0.1}
c1_mat2The CONTACT_MATRIX action with label c1_mat2 calculates the following quantities:| Quantity | Type | Description |
| c1_mat2 | matrix | a matrix containing the weights for the bonds between each pair of atoms |
: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-512 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={EXP D_0=4.0 R_0=0.5 D_MAX=6.0}
dp_matThe OUTER_PRODUCT action with label dp_mat calculates the following quantities:| Quantity | Type | Description |
| dp_mat | matrix | a matrix containing the outer product of the two input vectors that was obtained using the function that was input |
: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=cf,cf
dp_mat: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action uses the defaults shown here. More details ARGthe labels of the two vectors from which the outer product is being computed=cf,cf FUNC the function of the input vectors that should be put in the elements of the outer product=x*y
matThe CUSTOM action with label mat calculates the following quantities:| Quantity | Type | Description |
| mat | matrix | the matrix obtained by doing an element-wise application of an arbitrary function to the input matrix |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=c1_mat2,dp_mat 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
dfsThe DFSCLUSTERING action with label dfs calculates the following quantities:| Quantity | Type | Description |
| dfs | vector | vector with length that is equal to the number of rows in the input matrix. Elements of this vector are equal to the cluster that each node is a part of |
: DFSCLUSTERINGFind the connected components of the matrix using the depth first search clustering algorithm. More details ARGthe input matrix=mat
clust1The CLUSTER_WEIGHTS action with label clust1 calculates the following quantities:| Quantity | Type | Description |
| clust1 | vector | vector with elements that are one if the atom of interest is part of the required cluster and zero otherwise |
: CLUSTER_WEIGHTSSetup a vector that has one for all the atoms that form part of the cluster of interest and that has zero for all other atoms. More details CLUSTERSthe label of the action that does the clustering=dfs CLUSTER which cluster would you like to look at 1 is the largest cluster, 2 is the second largest, 3 is the the third largest and so on=1
trans1The CUSTOM action with label trans1 calculates the following quantities:| Quantity | Type | Description |
| trans1 | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cf,clust1 FUNCthe function you wish to evaluate=x*x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
centThe ARGS2VATOM action with label cent calculates the following quantities:| Quantity | Type | Description |
| cent.x | scalar | the x coordinate of the virtual atom |
| cent.y | scalar | the y coordinate of the virtual atom |
| cent.z | scalar | the z coordinate of the virtual atom |
| cent.mass | scalar | the mass of the virtual atom |
| cent.charge | scalar | the charge of the virtual atom |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. This action is a shortcut. More details ATOMSthe group of atoms that appear in the definition of this center=1-512 WEIGHTSwhat weights should be used when calculating the center=trans1 PHASES use trigonometric phases when computing position of center
# cent: CENTER ATOMS=1-512 WEIGHTS=trans1 PHASES
cent_mThe MASS action with label cent_m calculates the following quantities:| Quantity | Type | Description |
| cent_m | vector | the MASS of the atom/s |
: MASSGet the mass of one or multiple atoms More details ATOMSthe atom numbers that you would like to store the masses and charges of=1-512
cent_massThe SUM action with label cent_mass calculates the following quantities:| Quantity | Type | Description |
| cent_mass | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO ARGthe vector/matrix/grid whose elements shuld be added together=cent_m
cent_qThe CHARGE action with label cent_q calculates the following quantities:| Quantity | Type | Description |
| cent_q | vector | the CHARGE of the atom/s |
: CHARGEGet the charges of one or multiple atoms More details ATOMSthe atom numbers that you would like to store the masses and charges of=1-512
cent_chargeThe SUM action with label cent_charge calculates the following quantities:| Quantity | Type | Description |
| cent_charge | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO ARGthe vector/matrix/grid whose elements shuld be added together=cent_q
cent_fposThe POSITION action with label cent_fpos calculates the following quantities:| Quantity | Type | Description |
| cent_fpos.a | vector | the normalized projection on the first lattice vector of the atom position |
| cent_fpos.b | vector | the normalized projection on the second lattice vector of the atom position |
| cent_fpos.c | vector | the normalized projection on the third lattice vector of the atom position |
: POSITIONCalculate the components of the position of an atom or atoms. More details SCALED_COMPONENTS calculate the a, b and c scaled components of the position separately and store them as label ATOMSthe atom numbers that you would like to use the positions of=1-512
cent_sinaThe CUSTOM action with label cent_sina calculates the following quantities:| Quantity | Type | Description |
| cent_sina | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.a FUNCthe function you wish to evaluate=x*sin(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cosaThe CUSTOM action with label cent_cosa calculates the following quantities:| Quantity | Type | Description |
| cent_cosa | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.a FUNCthe function you wish to evaluate=x*cos(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_sinbThe CUSTOM action with label cent_sinb calculates the following quantities:| Quantity | Type | Description |
| cent_sinb | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.b FUNCthe function you wish to evaluate=x*sin(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cosbThe CUSTOM action with label cent_cosb calculates the following quantities:| Quantity | Type | Description |
| cent_cosb | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.b FUNCthe function you wish to evaluate=x*cos(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_sincThe CUSTOM action with label cent_sinc calculates the following quantities:| Quantity | Type | Description |
| cent_sinc | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.c FUNCthe function you wish to evaluate=x*sin(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_coscThe CUSTOM action with label cent_cosc calculates the following quantities:| Quantity | Type | Description |
| cent_cosc | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=trans1,cent_fpos.c FUNCthe function you wish to evaluate=x*cos(2*pi*y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_sinsumaThe SUM action with label cent_sinsuma calculates the following quantities:| Quantity | Type | Description |
| cent_sinsuma | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_sina PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cossumaThe SUM action with label cent_cossuma calculates the following quantities:| Quantity | Type | Description |
| cent_cossuma | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_cosa PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_sinsumbThe SUM action with label cent_sinsumb calculates the following quantities:| Quantity | Type | Description |
| cent_sinsumb | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_sinb PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cossumbThe SUM action with label cent_cossumb calculates the following quantities:| Quantity | Type | Description |
| cent_cossumb | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_cosb PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_sinsumcThe SUM action with label cent_sinsumc calculates the following quantities:| Quantity | Type | Description |
| cent_sinsumc | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_sinc PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cossumcThe SUM action with label cent_cossumc calculates the following quantities:| Quantity | Type | Description |
| cent_cossumc | scalar | the SUM of the elements in the input value |
: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cent_cosc PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_aThe CUSTOM action with label cent_a calculates the following quantities:| Quantity | Type | Description |
| cent_a | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cent_sinsuma,cent_cossuma FUNCthe function you wish to evaluate=atan2(x,y)/(2*pi) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_bThe CUSTOM action with label cent_b calculates the following quantities:| Quantity | Type | Description |
| cent_b | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cent_sinsumb,cent_cossumb FUNCthe function you wish to evaluate=atan2(x,y)/(2*pi) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent_cThe CUSTOM action with label cent_c calculates the following quantities:| Quantity | Type | Description |
| cent_c | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cent_sinsumc,cent_cossumc FUNCthe function you wish to evaluate=atan2(x,y)/(2*pi) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
cent: ARGS2VATOMCreate a virtual atom from the input scalars More details XPOSthe value to use for the x position of the atom=cent_a YPOSthe value to use for the y position of the atom=cent_b ZPOSthe value to use for the z position of the atom=cent_c MASSthe value to use for the mass of the atom=cent_mass CHARGEthe value to use for the charge of the atom=cent_charge FRACTIONAL the input arguments are calculated in fractional coordinates so you need to multiply by the cell
# --- End of included input ---
dens_distThe DISTANCE action with label dens_dist calculates the following quantities:| Quantity | Type | Description |
| dens_dist.x | vector | the x-component of the vector connecting the two atoms |
| dens_dist.y | vector | the y-component of the vector connecting the two atoms |
| dens_dist.z | vector | the z-component of the vector connecting the two atoms |
: 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=cent ATOMSthe pairs of atoms that you would like to calculate the angles for=c1 COMPONENTS calculate the x, y and z components of the distance separately and store them as label
# dens_dist: DISTANCES ORIGIN=cent ATOMS=c1 COMPONENTS
dens_dist: DISTANCECalculate the distance/s between pairs of atoms. More details COMPONENTS calculate the x, y and z components of the distance separately and store them as label ATOMS1the pair of atom that we are calculating the distance between=cent,1 ATOMS2the pair of atom that we are calculating the distance between=cent,2 ATOMS3the pair of atom that we are calculating the distance between=cent,3 ATOMS4the pair of atom that we are calculating the distance between=cent,4 ATOMS5the pair of atom that we are calculating the distance between=cent,5
# --- End of included input --- dens_numerThe KDE action with label dens_numer calculates the following quantities:| Quantity | Type | Description |
| dens_numer | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: 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=trans1 ARGthe label for the value that should be used to construct the histogram=dens_dist.x,dens_dist.y,dens_dist.z
GRID_BINthe number of bins for the grid=30,30,30 BANDWIDTHthe bandwidths for kernel density esimtation=2.0,2.0,2.0
...
dens_numer: KDECreate a histogram from the input scalar/vector/matrix using KDE This action uses the defaults shown here. More details ...
VOLUMESthis keyword take the label of an action that calculates a vector of values=trans1 ARGthe label for the value that should be used to construct the histogram=dens_dist.x,dens_dist.y,dens_dist.z
GRID_BINthe number of bins for the grid=30,30,30 BANDWIDTHthe bandwidths for kernel density esimtation=2.0,2.0,2.0
KERNEL the kernel function you are using=GAUSSIAN
...
dens_denomThe KDE action with label dens_denom calculates the following quantities:| Quantity | Type | Description |
| dens_denom | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: 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=clust1 ARGthe label for the value that should be used to construct the histogram=dens_dist.x,dens_dist.y,dens_dist.z
GRID_BINthe number of bins for the grid=30,30,30 BANDWIDTHthe bandwidths for kernel density esimtation=2.0,2.0,2.0
...
dens_denom: KDECreate a histogram from the input scalar/vector/matrix using KDE This action uses the defaults shown here. More details ...
VOLUMESthis keyword take the label of an action that calculates a vector of values=clust1 ARGthe label for the value that should be used to construct the histogram=dens_dist.x,dens_dist.y,dens_dist.z
GRID_BINthe number of bins for the grid=30,30,30 BANDWIDTHthe bandwidths for kernel density esimtation=2.0,2.0,2.0
KERNEL the kernel function you are using=GAUSSIAN
...
densThe CUSTOM action with label dens calculates the following quantities:| Quantity | Type | Description |
| dens | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=dens_numer,dens_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
scThe FIND_SPHERICAL_CONTOUR action with label sc calculates the following quantities:| Quantity | Type | Description |
| sc | grid | a grid on a Fibonacci sphere that describes the radial distance from the origin for the points on the Willard-Chandler surface |
: FIND_SPHERICAL_CONTOURFind an isocontour in a three dimensional grid by searching over a Fibonacci sphere. This action has hidden defaults. More details ARGthe labels of the grid in which the contour will be found=dens CONTOURthe value we would like to draw the contour at in the space=0.85 INNER_RADIUSthe minimum radius on which to look for the contour=10.0 OUTER_RADIUSthe outer radius on which to look for the contour=40.0 NPOINTSthe number of points for which we are looking for the contour=100
sc: FIND_SPHERICAL_CONTOURFind an isocontour in a three dimensional grid by searching over a Fibonacci sphere. This action uses the defaults shown here. More details ARGthe labels of the grid in which the contour will be found=dens CONTOURthe value we would like to draw the contour at in the space=0.85 INNER_RADIUSthe minimum radius on which to look for the contour=10.0 OUTER_RADIUSthe outer radius on which to look for the contour=40.0 NPOINTSthe number of points for which we are looking for the contour=100 NBINS the number of discrete sections in which to divide the distance between the inner and outer radius when searching for a contour=1 INTERPOLATION_TYPE the method to use for interpolation=spline
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=sc PRINT_XYZ output coordinates on fibonacci grid to xyz file FILE the file on which to write the grid=mysurface.xyz STRIDE the frequency with which the grid should be output to the file=1
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 |
| NPOINTS |
compulsory |
none |
the number of points for which we are looking for the contour |
| INNER_RADIUS |
compulsory |
none |
the minimum radius on which to look for the contour |
| OUTER_RADIUS |
compulsory |
none |
the outer radius on which to look for the contour |
| 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 |
| NBINS |
compulsory |
1 |
the number of discrete sections in which to divide the distance between the inner and outer radius when searching for a 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: