Action: POSITION
| Module | colvar |
|---|---|
| Description | Usage |
| Calculate the components of the position of an atom or atoms. |
Details and examples
Calculate the components of the position of an atom or atoms.
To print the position of atom one to a file you can use an input like this:
p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMthe atom number=1 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.x,p.y,p.z FILEthe name of the file on which to output these quantities=colvar
To print the position of four atoms you can use an input like this:
p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMSthe atom numbers that you would like to use the positions of=1-4 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.x,p.y,p.z FILEthe name of the file on which to output these quantities=colvar
The three output values, p.x, p.y and p.z, here are all four dimensional vectors. Furthermore, if you wish
to use a procedure akin to that described in the documentation for WHOLEMOLECULES to ensure
that molecules are reassembled if they are broken by periodic boundary conditions you can use the WHOLEMOLECULES
flag as shown below:
p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMSthe atom numbers that you would like to use the positions of=1-4 WHOLEMOLECULES if this is a vector of positions do you want to make the positions into a whole before PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.x,p.y,p.z FILEthe name of the file on which to output these quantities=colvar
This is used in the CENTER when we compute centers with arbitrary weights for shortcuts.
Periodic boundary conditions
Notice that single components will not have the proper periodicity!
If you need the values to be consistent through PBC you can use SCALED_COMPONENTS flag as shown below:
p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMthe atom number=1 SCALED_COMPONENTS calculate the a, b and c scaled components of the position separately and store them as label PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.a,p.b,p.c FILEthe name of the file on which to output these quantities=colvar
This flag ensures that values are output that are, by construction, in the -0.5,0.5 domain. The output is similar to the equivalent flag for DISTANCE.
If it also important to note that by default the positions are output by calculating minimal image distance between the instantaneous position of the atoms and the position of the origin, . This behaviour can be changed by using NOPBC as shown below, which will output the position of the atom directly.
p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMthe atom number=1 NOPBC ignore the periodic boundary conditions when calculating distances PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.x,p.y,p.z FILEthe name of the file on which to output these quantities=colvar
This variable should be used with extreme care since it allows you to easily get in troubles. It can be only be used if the Hamiltonian is not invariant for translation (i.e. there are other absolute positions which are biased, e.g. by position restraints) and cell size and shapes are fixed through the simulation.
If you are not in this situation and still want to use the absolute position of an atom you should first fix the reference frame by using FIT_TO_TEMPLATE as shown in the example below
#SETTINGS INPUTFILES=regtest/basic/rt63/align.pdb # align to a template FIT_TO_TEMPLATEThis action is used to align a molecule to a template. More details REFERENCEa file in pdb format containing the reference structure and the atoms involved in the CV=regtest/basic/rt63/align.pdbClick here to see an extract from this file.p: POSITIONCalculate the components of the position of an atom or atoms. More details ATOMthe atom number=3 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=p.x,p.y,p.z
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 |
|---|---|---|
| ATOM | atoms | the atom number |
| ATOMS | atoms | the atom numbers that you would like to use the positions of |
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 |
|---|---|---|---|
| x | scalar/vector | default | the x-component of the atom position |
| y | scalar/vector | default | the y-component of the atom position |
| z | scalar/vector | default | the z-component of the atom position |
| a | scalar/vector | SCALED_COMPONENTS | the normalized projection on the first lattice vector of the atom position |
| b | scalar/vector | SCALED_COMPONENTS | the normalized projection on the second lattice vector of the atom position |
| c | scalar/vector | SCALED_COMPONENTS | the normalized projection on the third lattice vector of the atom position |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ATOM | input | none | the atom number |
| ATOMS | input | none | the atom numbers that you would like to use the positions of |
| NOPBC | optional | false | ignore the periodic boundary conditions when calculating distances |
| WHOLEMOLECULES | optional | false | if this is a vector of positions do you want to make the positions into a whole before |
| SCALED_COMPONENTS | optional | false | calculate the a, b and c scaled components of the position separately and store them as label |