DFSCLUSTERING
This is part of the adjmat module
It is only available if you configure PLUMED with ./configure –enable-modules=adjmat . 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 [131] 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 [131].

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
This keyword is used if you want to employ an alternative to the continuous switching function defined above.
={CUBIC D_0=0.45 D_MAX=0.55}
LOWMEM
( default=off ) lower the memory requirements
cm: CONTACT_MATRIX
ATOMS
The list of atoms for which you would like to calculate the contact matrix.
=lq
SWITCH
This keyword is used if you want to employ an alternative to the continuous switching function defined above.
={CUBIC D_0=0.45 D_MAX=0.55} dfs: DFSCLUSTERING
MATRIX
compulsory keyword the action that calculates the adjacency matrix vessel we would like to analyze
=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
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
Compulsory keywords
MATRIX the action that calculates the adjacency matrix vessel we would like to analyze
MAXCONNECT ( default=0 ) maximum number of connections that can be formed by any given node in the graph. By default this is set equal to zero and the number of connections is set equal to the number of nodes. You only really need to set this if you are working with a very large system and memory is at a premium
Options
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 ) do the calculation in serial. Do not use MPI
LOWMEM ( default=off ) lower the memory requirements
TIMINGS

( default=off ) output information on the timings of the various parts of the calculation