You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/symfunc/AngularTetra.cpp
+21-1
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,27 @@
28
28
/*
29
29
Calculate the angular tetra CV
30
30
31
-
\par Examples
31
+
This shortcut calculates a [symmetry function](https://www.plumed-tutorials.org/lessons/23/001/data/SymmetryFunction.html). The particular function that is being
32
+
evaluated for the coordination sphere here is as follows:
In this expression the 4 atoms in the sums over $j$ and $k$ are the four atoms that are nearest to atom $i$. $\theta_{jik}$ is the angle between the vectors connecting
39
+
atoms $i$ and $j$ and the vector connecting atoms $i$ and $k$. The CV is large if the four atoms nearest atom $i$ are arranged on the vertices of a regular tetrahedron
40
+
and small otherwise. The following example shows how you can use this action to measure the degree of tetrahedral order in a system.
41
+
42
+
```plumed
43
+
# Calculate a vector that contains 64 values for the symmetry function.
44
+
# Sum the elements of the vector and calculate the mean value on the atoms from this sum.
45
+
acv: TETRA_ANGULAR SPECIES=1-64 SUM MEAN
46
+
# Print out the positions of the 64 atoms for which the symmetry function was calculated
47
+
# to an xyz file along with the values of the symmetry function
48
+
DUMPATOMS ATOMS=1-64 ARG=acv FILE=mcolv.xyz
49
+
# Print out the average value of the symmetry function and the sum of all the symmetry functions
In this expression $r_{ij}$ is the distance between atom $i$ and atom $j$ and $\sigma$ is a switching function that acts upon this distance. $c_i$ is thus the number of atoms that are within
42
+
a certain cutoff of atom $i$ and $\gamma$ is another switching function that acts upon this quantity. This switching function ensures that the symmetry function is zero for atoms that are
43
+
regions where the density is low. $\theta_{jik}$ is the angle between the vector connecting atoms $i$ and $j$ and the vector connecting atoms $i$ and $k$. This angle is the argument for the
44
+
set of Gaussian kernel functions, $G$, that are centered on $\phi_n$ and that have bandwidths of $b_n$. The function above is thus determining if the angles between the bonds in the first coordination
45
+
sphere around atom $i$ are similar to the $\phi_n$ values that have been specified by the user or not.
46
+
47
+
The following example demonstrates how this symmetry function can be used in practise.
The input above would calculate 64 instances of $s_i$ using the formula above. In each of these two Gaussian Kernels are used in the sum over $n$. The parameters for the switching function
55
+
$\sigma$ are specified using the SWITCH keyword, while the parameters for $\gamma$ are specified using SWITCH_COORD. As you can see if you expand the shortcut in the input above, the 64 values
56
+
for $s_i$ are stored in a vector. All the elements of this vector are then added together to produce the single quantity that is output in the colvar file.
keys.add("optional","SWITCH","This keyword is used if you want to employ an alternative to the continuous swiching function defined above. "
55
-
"The following provides information on the \\ref switchingfunction that are available. "
56
-
"When this keyword is present you no longer need the NN, MM, D_0 and R_0 keywords.");
74
+
keys.add("atoms-3","SPECIES","the list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments");
75
+
keys.add("atoms-4","SPECIESA","the list of atoms for which the symmetry function is being calculated. This keyword must be used in conjunction with SPECIESB, which specifies the atoms that are in the environment.");
76
+
keys.add("atoms-4","SPECIESB","the list of atoms that can be in the environments of each of the atoms for which the symmetry function is being calculated. This keyword must be used in conjunction with SPECIESA, which specifies the atoms for which the symmetry function is being calculated.");
77
+
keys.add("optional","SWITCH","the switching function that it used in the construction of the contact matrix");
57
78
keys.add("numbered","KERNEL","The kernels used in the function of the angle");
58
79
keys.add("optional","SWITCH_COORD","This keyword is used to define the coordination switching function.");
In this expression, $x_{ij}, y_{ij}, z_{ij}$ are the components of the vector connecting atoms $i$ and $j$ and $r_{ij}$ is the magnitude of this vector.
48
+
$\sigma(r_{ij})$ is then a switching function that ensures that the aritrary function $f$ is only evaluated for if atom $j$ is within a certain cutoff distance
49
+
of atom $i$.
50
+
51
+
Below you can see a simple example that shows how this action can be used in practise.
The above input calculates 64 $s_i$ values - one $s_i$ values for each of the atoms specified using the SPECIES keyword. These 64 numbers are then output to a file.
59
+
The function of x, y, z and r to be evaluated is specified using the FUNCTION keyword. Obviously, if your function does not depend on all four of these variables
60
+
they can be excluded from your function.
61
+
62
+
As discussed in [this paper](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.92.180102) it is sometimes useful to rotate the bond vectors before computing the
63
+
arbitrary function $f$ in the above expression. To perform such rotations you use the PHI, THETA and PSI keywords. The $x_{ij}, y_{ij}$ and $z_{ij}$ values that enter $f$ in the
$x_{ij}', y_{ij}'$ and $z_{ij}'$ in this expression are the bond vectors that are calculated in the lab frame. The matrix in the above expression is thus just a
90
+
[rotation matrix](https://en.wikipedia.org/wiki/Rotation_matrix) that converts the lab frame to some frame of interest.
41
91
42
92
43
93
*/
@@ -47,8 +97,30 @@ Calculate an arbitrary function of all the bond vectors in the first coordinatio
47
97
/*
48
98
Calculate an arbitrary function of all the bond vectors in the first coordination sphere of an atom and take an average
49
99
50
-
\par Examples
100
+
This shortcut allows you to calculate the average for an arbitrary function of the bond vectors that connect an atom to each of its neighbours.
101
+
In other words, this action allows you to compute the following:
In this expression, $x_{ij}, y_{ij}, z_{ij}$ are the components of the vector connecting atoms $i$ and $j$ and $r_{ij}$ is the magnitude of this vector.
108
+
$\sigma(r_{ij})$ is then a switching function that ensures that the aritrary function $f$ is only evaluated for if atom $j$ is within a certain cutoff distance
109
+
of atom $i$.
110
+
111
+
Below you can see a simple example that shows how this action can be used in practise.
The above input calculates 64 $s_i$ values - one $s_i$ values for each of the atoms specified using the SPECIES keyword. These 64 numbers are then output to a file.
119
+
The function of x, y, z and r to be evaluated is specified using the FUNCTION keyword. Obviously, if your function does not depend on all four of these variables
120
+
they can be excluded from your function.
121
+
122
+
Notice that you can you can rotate the bond vectors before computing the
123
+
arbitrary function $f$ in the above expression as is discussed in the documentation for [COORDINATION_SHELL_FUNCTION](COORDINATION_SHELL_FUNCTION.md)
52
124
53
125
*/
54
126
//+ENDPLUMEDOC
@@ -57,35 +129,38 @@ Calculate an arbitrary function of all the bond vectors in the first coordinatio
57
129
/*
58
130
Calculate whether or not the coordination spheres of atoms are arranged as they would be in a simple cubic structure.
59
131
60
-
We can measure how similar the environment around atom \f$i\f$ is to a simple cubic structure is by evaluating
132
+
This shortcut is an example of a [COORDINATION_SHELL_AVERAGE](COORDINATION_SHELL_AVERAGE.md),
133
+
which we can use to measure how similar the environment around atom $i$ is to a simple cubic structure. We perform this comparison by evaluating
In this expression \f$x_{ij}\f$, \f$y_{ij}\f$ and \f$z_{ij}\f$ are the \f$x\f$, \f$y\f$ and \f$z\f$ components of the vector connecting atom \f$i\f$ to
68
-
atom \f$j\f$ and \f$r_{ij}\f$ is the magnitude of this vector. \f$\sigma(r_{ij})\f$ is a \ref switchingfunction that acts on the distance between atom \f$i\f$ and atom \f$j\f$ and its inclusion in the numerator and the denominator of the above expression as well as the fact that we are summing
140
+
In this expression $x_{ij}$, $y_{ij}$ and $z_{ij}$ are the $x$, $y$ and $z$ components of the vector connecting atom $i$ to
141
+
atom $j$ and $r_{ij}$ is the magnitude of this vector. $\sigma(r_{ij})$ is a switching function that acts on the distance between atom $i$ and atom $j$ and its inclusion in the numerator and the denominator of the above expression as well as the fact that we are summing
69
142
over all of the other atoms in the system ensures that we are calculating an average
70
-
of the function of \f$x_{ij}\f$, \f$y_{ij}\f$ and \f$z_{ij}\f$ for the atoms in the first coordination sphere around atom \f$i\f$.
143
+
of the function of $x_{ij}$, $y_{ij}$ and $z_{ij}$ for the atoms in the first coordination sphere around atom $i$.
71
144
This quantity is once again a multicolvar so you can compute it for multiple atoms using a single PLUMED action and then compute
72
-
the average value for the atoms in your system, the number of atoms that have an \f$s_i\f$ value that is more that some target and
145
+
the average value for the atoms in your system, the number of atoms that have an $s_i$ value that is more that some target and
73
146
so on. Notice also that you can rotate the reference frame if you are using a non-standard unit cell.
74
147
75
-
76
-
\par Examples
77
-
78
148
The following input tells plumed to calculate the simple cubic parameter for the atoms 1-100 with themselves.
79
149
The mean value is then calculated.
80
-
\plumedfile
150
+
151
+
```plumed
81
152
SIMPLECUBIC SPECIES=1-100 R_0=1.0 MEAN
82
-
\endplumedfile
153
+
```
83
154
84
155
The following input tells plumed to look at the ways atoms 1-100 are within 3.0 are arranged about atoms
85
156
from 101-110. The number of simple cubic parameters that are greater than 0.8 is then output
0 commit comments