DFSCLUSTERING
This is part of the clusters module
It is only available if you configure PLUMED with ./configure –enable-modules=clusters . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list.

Find the connected components of the matrix using the depth first search clustering algorithm.

As discussed in the section of the manual on Exploiting contact matrices a useful tool for developing complex collective variables is the notion of the so called adjacency matrix. An adjacency matrix is an \(N \times N\) matrix in which the \(i\)th, \(j\)th element tells you whether or not the \(i\)th and \(j\)th atoms/molecules from a set of \(N\) atoms/molecules are adjacent or not. As detailed in [107] these matrices provide a representation of a graph and can thus can be analyzed using tools from graph theory. This particular action performs a depth first search clustering to find the connected components of this graph. You can read more about depth first search here:

https://en.wikipedia.org/wiki/Depth-first_search

This action is useful if you are looking at a phenomenon such as nucleation where the aim is to detect the sizes of the crystalline nuclei that have formed in your simulation cell.

Examples

The input below calculates the coordination numbers of atoms 1-100 and then computes the an adjacency matrix whose elements measures whether atoms \(i\) and \(j\) are within 0.55 nm of each other. The action labelled dfs then treats the elements of this matrix as zero or ones and thus thinks of the matrix as defining a graph. This dfs action then finds the largest connected component in this graph. The sum of the coordination numbers for the atoms in this largest connected component are then computed and this quantity is output to a colvar file. The way this input can be used is described in detail in [107].

Click on the labels of the actions for more information on what each action computes
tested on master
lq: COORDINATIONNUMBER 
SPECIES
this keyword is used for colvars such as coordination number.
=1-100
SWITCH
the switching function that it used in the construction of the contact matrix
={CUBIC D_0=0.45 D_MAX=0.55}
LOWMEM
( default=off ) this flag does nothing and is present only to ensure back-compatibility
cm: CONTACT_MATRIX
ATOMS
the atoms for which you would like to calculate the adjacency matrix (basically equivalent to GROUP)
=lq
SWITCH
specify the switching function to use between two sets of indistinguishable atoms.
={CUBIC D_0=0.45 D_MAX=0.55} dfs: DFSCLUSTERING
MATRIX
the input matrix (can use ARG instead)
=cm clust1: CLUSTER_PROPERTIES
CLUSTERS
compulsory keyword the label of the action that does the clustering
=dfs
CLUSTER
compulsory keyword ( default=1 ) which cluster would you like to look at 1 is the largest cluster, 2 is the second largest, 3 is the the third largest and so on.
=1
SUM
( default=off ) calculate the sum of all the quantities.
PRINT
ARG
the input for this action is the scalar output from one or more other actions.
=clust1.*
FILE
the name of the file on which to output these quantities
=colvar
Glossary of keywords and components
Options
LOWMEM

( default=off ) this flag does nothing and is present only to ensure back-compatibility

ARG the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or *.* appears the scalars calculated by all the proceeding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three components x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting Started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...
MATRIX the input matrix (can use ARG instead)
ARG the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or *.* appears the scalars calculated by all the proceeding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three components x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting Started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...