Skip to content

Shortcut: AROUND

Module volumes
Description Usage
This quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. used in 0 tutorialsused in 4 eggs
output value type
sum of values of input CVs in regin of interest scalar

Details and examples

This quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell.

This action can be used to calculate whether each of the atoms are within a particular part of the simulation box or not as illustrated by the following example:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ...
  ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f
  SIGMAthe width of the function to be used for kernel density estimation=0.2 KERNEL the type of kernel function to be used=gaussian
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
  ZLOWER the lower boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)=-1.0 ZUPPER the upper boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)=1.0
...
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=a FILEthe name of the file on which to output these quantities=colvar

The 100 elements of the vector a that is returned from the AROUND action in the above input are calculated using:

where is one of the kernel functions described in the documentation for the function BETWEEN, is a bandwidth parameter and the limits for the integrals are the values specified using the keywords XLOWER, XUPPER, YLOWER, YUPPER, YUPPER, ZLOWER and ZUPPER. , and are then the components of the vector that connects the th atom that was specified using the ATOMS keyword to the atom that was specified using the ORIGIN keyword. In other words, is 1 if the atom is within a rectangular box that is centered on the atom that is specified as the origin and zero otherwise.

If instead of calculating if the atoms are inside this box you want to calculate if they are outside this box you can use the following input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ...
  ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f
  SIGMAthe width of the function to be used for kernel density estimation=0.2 KERNEL the type of kernel function to be used=gaussian
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
  ZLOWER the lower boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)=-1.0 ZUPPER the upper boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)=1.0
  OUTSIDE calculate quantities for colvars that are on atoms outside the region of interest
...
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=a FILEthe name of the file on which to output these quantities=colvar

The 100 elements of the vector a that is returned from the AROUND action in the above input are calculated using:

Calculating the number of atoms in a particular part of the box

Lets suppose that you want to calculate how many atoms are in have an coordinate that is between -1.0 and 1.0. You can do this using the following PLUMED input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2 XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
s: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=a PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=s FILEthe name of the file on which to output these quantities=colvar

In this example the components of a are calculated as:

as the YLOWER, YUPPER, YUPPER, ZLOWER and ZUPPER flags have not been included. The SUM command then adds together all the elements of the vector a to calculate the total number of atoms in the region of the box that is of interest.

Calculating the average value for an order parameter in a particular part of the box

Suppose that you have calculated a vector of order parameters that can be assigned to a particular point in three dimensional space. The symmetry functions in the symfunc module are examples of order parameters that satisfy this criteria. You can use the AROUND command to calculate the average value of the symmetry function in a particular part of the box as follows:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ...
  ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
...

c: 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-100 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.={RATIONAL R_0=1.0} MASKthe label for a vector that is used to determine which rows of the matrix are computed=a p: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=c,a 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 n: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=p PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO d: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=a PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO av: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=n,d 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 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=av FILEthe name of the file on which to output these quantities=colvar

The final quantity av here is:

where are the coordination numbers and is:

Old syntax

In earlier versions of PLUMED the syntax for the calculation in the previous section is as follows:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c: 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-100 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.={RATIONAL R_0=1.0}
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. This action is a shortcut. More details ...
  DATAIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only=c ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
  MEANIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
...
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=a.mean FILEthe name of the file on which to output these quantities=colvar

This old syntax still works but we highly recommend you use the newer syntax as it is easlier to understand, more flexible and calculations with this newer input will run faster. You will notice that AROUND in the input above is a shortcut that expands to a longer input that is similar to that given in the previous section. The main difference is that the order of the AROUND and COORDINATIONNUMBER actions is reversed in the new syntax. The reason this reversal is necessary is that the vector output by AROUND must be passed as as a MASK action to the COORDINATIONNUMBER action in order to optimize code performance. Passing the vector from AROUND as a MASK in coordination number ensures that we only calculate the coordination numbers for those atomms that are in the region of interest. We thus avoid a lot of computational expense that would otherwise be associated with calculating coordination numbers for atoms that are not within the region of interest and would thus make no difference to the final average that we are calculating.

The old syntax also allowed you to compute the sum of the coordination numbers in the region of interest using an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c: 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-100 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.={RATIONAL R_0=1.0}
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. This action is a shortcut. More details ...
  DATAIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only=c ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
  SUMIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
...
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=a.sum FILEthe name of the file on which to output these quantities=colvar

The final CV that is computed here is:

the equivalent input with the new syntax is thus:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ...
  ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
...

c: 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-100 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.={RATIONAL R_0=1.0} MASKthe label for a vector that is used to determine which rows of the matrix are computed=a p: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=c,a 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 n: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=p PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=n FILEthe name of the file on which to output these quantities=colvar

That old syntax also allowed you to accumulate quantities such as:

where could be one of the switching functions discussed in the documentation for LESS_THAN, one of the reverse switching functions discussed in the documentation for MORE_THAN or one of the two sided switching functions discussed in the documentation for BETWEEN. An example of an old input that computes all three of three types of sum is shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c: 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-100 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.={RATIONAL R_0=1.0}
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. This action is a shortcut. More details ...
  DATAIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only=c ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
  LESS_THANIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only={RATIONAL R_0=3}
  MORE_THANIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only={RATIONAL R_0=6}
  BETWEENIncluding this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only={GAUSSIAN LOWER=3 UPPER=6 SMEAR=0.5}
...
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=a.lessthan,a.between,a.morethan FILEthe name of the file on which to output these quantities=colvar

With the new syntax we can achieve the same result using the following input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
f: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=0,0,0
a: AROUNDThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ...
  ATOMSthe group of atoms that you would like to investigate=1-100 ORIGINthe atom whose vicinity we are interested in examining=f SIGMAthe width of the function to be used for kernel density estimation=0.2
  XLOWER the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=-1.0 XUPPER the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)=1.0
  YLOWER the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=-1.0 YUPPER the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)=1.0
...

c: 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-100 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.={RATIONAL R_0=1.0} MASKthe label for a vector that is used to determine which rows of the matrix are computed=a # This part does the LESS_THAN={RATIONAL R_0=3} lt: LESS_THANUse a switching function to determine how many of the input variables are less than a certain cutoff. More details ARGthe values input to this function=c SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=3} wlt: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=a,lt 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 lessthan: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=wlt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # This part does the BETWEEN={GAUSSIAN LOWER=3 UPPER=6 SMEAR=0.5} bt: BETWEENUse a switching function to determine how many of the input variables are within a certain range. More details ARGthe values input to this function=c SWITCHThis keyword is used if you want to employ an alternative to the continuous function defined above={GAUSSIAN LOWER=3 UPPER=6 SMEAR=0.5} wbt: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=a,bt 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 between: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=wbt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # This part does the MORE_THAN={RATIONAL R_0=6} mt: 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=c SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=6} wmt: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=a,mt 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 morethan: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=wmt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=lessthan,between,morethan FILEthe name of the file on which to output these quantities=colvar

Input

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

Keyword Type Description
ATOMS atoms the group of atoms that you would like to investigate
ORIGIN atoms the atom whose vicinity we are interested in examining

Output components

This action can calculate the values in the following table when the associated keyword is included in the input for the action. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.

Name Type Keyword Description
lessthan scalar LESS_THAN the number of cvs in the region of interest that are less than a certain threshold
morethan scalar MORE_THAN the number of cvs in the region of interest that are more than a certain threshold
between scalar BETWEEN the number of cvs in the region of interest that are within a certain range
sum scalar SUM the sum of all the colvars weighted by the function that determines if we are in the region
mean scalar MEAN the average values of the colvar in the region of interest

Full list of keywords

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

Keyword Type Default Description
ATOMS input none the group of atoms that you would like to investigate
ORIGIN input none the atom whose vicinity we are interested in examining
SIGMA compulsory none the width of the function to be used for kernel density estimation
KERNEL compulsory gaussian the type of kernel function to be used
XLOWER compulsory 0.0 the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)
XUPPER compulsory 0.0 the upper boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)
YLOWER compulsory 0.0 the lower boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)
YUPPER compulsory 0.0 the upper boundary in y relative to the y coordinate of the atom (0 indicates use full extent of box)
ZLOWER compulsory 0.0 the lower boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)
ZUPPER compulsory 0.0 the upper boundary in z relative to the z coordinate of the atom (0 indicates use full extent of box)
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.
OUTSIDE optional false calculate quantities for colvars that are on atoms outside the region of interest

deprecated keywords

The keywords in the following table can still be used with this action but have been deprecated

Keyword Description
ATOM You should use ORIGIN instead of this keyword which was used in older versions of PLUMED and is provided for back compatibility only
DATA Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
LESS_THAN Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
MORE_THAN Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
BETWEEN Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
SUM Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only
MEAN Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only