Action: ARGS2VATOM
| Module | vatom |
|---|---|
| Description | Usage |
| Create a virtual atom from the input scalars |
Details and examples
Create a virtual atom from the input scalars
This action takes five scalars that are computed by other actions in input and uses them to set the x, y and z positions and the mass and charge of a virtual atom. This action is used within the CENTER shortcut to compute a center of mass. An example input that shows how you can use this command to calculate the center of mass of atoms 1-10 is as follows:
# Calculate the total mass of the atoms m: 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-10 mass: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=m PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Calculate the totla charge of the atoms q: 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-10 charge: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=q PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Now get the positions of the atoms pos: POSITIONCalculate the components of the position of an atom or atoms. More details WHOLEMOLECULES if this is a vector of positions do you want to make the positions into a whole before ATOMSthe atom numbers that you would like to use the positions of=1-10 # Multiply each vector of positions by the masses xwvec: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.x 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 ywvec: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.y 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 zwvec: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.z 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 # Sum the numerators in the expression for the center of mass xnum: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=xwvec PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO ynum: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=ywvec PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO znum: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=zwvec PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # And compute the x, y and z positions of the center of mass x: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=xnum,mass 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 y: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ynum,mass 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 z: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=znum,mass 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 # And now create the virtual atom p: ARGS2VATOMCreate a virtual atom from the input scalars More details XPOSthe value to use for the x position of the atom=x YPOSthe value to use for the y position of the atom=y ZPOSthe value to use for the z position of the atom=z MASSthe value to use for the mass of the atom=mass CHARGEthe value to use for the charge of the atom=charge
In the following input by contrast we use the PHASES method that is discussed in the documentation for CENTER to calculate the position of the center of mass:
# Calculate the total mass of the atoms m: 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-10 mass: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=m PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Calculate the totla charge of the atoms q: 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-10 charge: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=q PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Now get the positions of the atoms pos: 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-10 # Multiply the sins and cosines of the scaled positions by the weights sina: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 cosa: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 sinb: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 cosb: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 sinc: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 cosc: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=m,pos.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 # And accumulate the sums sinsuma: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=sina PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO cossuma: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cosa PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO sinsumb: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=sinb PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO cossumb: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cosb PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO sinsumc: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=sinc PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO cossumc: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=cosc PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # And get the position of the center in fractional coordinates a: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=sinsuma,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 b: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=sinsumb,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 c: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=sinsumc,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 # And now create the virtual atom p: ARGS2VATOMCreate a virtual atom from the input scalars More details XPOSthe value to use for the x position of the atom=a YPOSthe value to use for the y position of the atom=b ZPOSthe value to use for the z position of the atom=c MASSthe value to use for the mass of the atom=mass CHARGEthe value to use for the charge of the atom=charge FRACTIONAL the input arguments are calculated in fractional coordinates so you need to multiply by the cell
These inputs provide very slow ways of computing a center of mass - PLUMED contains faster implementations that do calculations that are equivalent to both of these inputs. This type of input is nevertheless useful if you are using arbitary weights when computing the sums in the numerator and denominator of the expression for the center as is detailed in the documentation for the CENTER command.
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 |
|---|---|---|
| XPOS | scalar | the value to use for the x position of the atom |
| YPOS | scalar | the value to use for the y position of the atom |
| ZPOS | scalar | the value to use for the z position of the atom |
| MASS | scalar | the value to use for the mass of the atom |
| CHARGE | scalar | the value to use for the charge of the atom |
| XBKP | scalar | x position to use in case PBC not set when using PHASES |
| YBKP | scalar | y position to use in case PBC not set when using PHASES |
| ZBKP | scalar | z position to use in case PBC not set when using PHASES |
Output components
This action calculates the values in the following table. 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 | Description |
|---|---|---|
| x | scalar | the x coordinate of the virtual atom |
| y | scalar | the y coordinate of the virtual atom |
| z | scalar | the z coordinate of the virtual atom |
| mass | scalar | the mass of the virtual atom |
| charge | scalar | the charge of the virtual atom |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| XPOS | input | none | the value to use for the x position of the atom |
| YPOS | input | none | the value to use for the y position of the atom |
| ZPOS | input | none | the value to use for the z position of the atom |
| MASS | input | none | the value to use for the mass of the atom |
| CHARGE | input | none | the value to use for the charge of the atom |
| XBKP | input | none | x position to use in case PBC not set when using PHASES |
| YBKP | input | none | y position to use in case PBC not set when using PHASES |
| ZBKP | input | none | z position to use in case PBC not set when using PHASES |
| FRACTIONAL | optional | false | the input arguments are calculated in fractional coordinates so you need to multiply by the cell |