Calculate coordination numbers.
This keyword can be used to calculate the number of contacts between two groups of atoms and is defined as
\[ \sum_{i\in A} \sum_{i\in B} s_{ij} \]
where \(s_{ij}\) is 1 if the contact between atoms \(i\) and \(j\) is formed, zero otherwise. In practise, \(s_{ij}\) is replaced with a switching function to make it differentiable. The default switching function is:
\[ s_{ij} = \frac{ 1 - \left(\frac{{\bf r}_{ij}-d_0}{r_0}\right)^n } { 1 - \left(\frac{{\bf r}_{ij}-d_0}{r_0}\right)^m } \]
but it can be changed using the optional SWITCH option.
To make your calculation faster you can use a neighbor list, which makes it that only a relevant subset of the pairwise distance are calculated at every step.
GROUPA | First list of atoms |
GROUPB | Second list of atoms |
NN | ( default=6 ) The n parameter of the switching function |
MM | ( default=12 ) The m parameter of the switching function |
D_0 | ( default=0.0 ) The d_0 parameter of the switching function |
R_0 | The r_0 parameter of the switching function |
NUMERICAL_DERIVATIVES | ( default=off ) calculate the derivatives for these quantities numerically |
NOPBC | ( default=off ) ignore the periodic boundary conditions when calculating distances |
SERIAL | ( default=off ) Perform the calculation in serial - for debug purpose |
PAIR | ( default=off ) Pair only 1st element of the 1st group with 1st element in the second, etc |
NLIST | ( default=off ) Use a neighbour list to speed up the calculation |
NL_CUTOFF | The cutoff for the neighbour list |
NL_STRIDE | The frequency with which we are updating the atoms in the neighbour list |
SWITCH | This keyword is used if you want to employ an alternative to the continuous swiching function defined above. The following provides information on the switchingfunction that are available. When this keyword is present you no longer need the NN, MM, D_0 and R_0 keywords. |
The following example instructs plumed to calculate the total coordination number of the atoms in group 1-10 with the atoms in group 20-100. For atoms 1-10 coordination numbers are calculated that count the number of atoms from the second group that are within 0.3 nm of the central atom. A neighbour list is used to make this calculation faster, this neighbour list is updated every 100 steps.
COORDINATION GROUPA=1-10 GROUPB=20-100 R_0=0.3 NLIST NL_CUTOFF=0.5 NL_STRIDE=100
Hosted by GitHub
![]() |
![]() |