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.
=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
compulsory keyword the labels of the values that you would like to print to the file
=clust1.*
FILE
the name of the file on which to output these quantities
=colvar
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Description
.#!value vector with length that is equal to the number of rows in the input matrix. Elements of this vector are equal to the cluster that each node is a part of
Compulsory keywords
ARG the input matrix
Options
LOWMEM

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

MATRIX the input matrix (can use ARG instead)