#
# T-CLUSTERING + METADYNAMICS ON THE NODE DEGREE
#
# Units here are nm not Angstroms atention with DLPOLY or LAMMPS metal units!
#
# DEFINITION OF THE CONNECTIVITY CRITERION AND BUILD OF THE ADJACENCY MATRIX:

mat: TOPOLOGY_MATRIX NODES=1-333 ATOMS=334-12672 BIN_SIZE=1.02 CYLINDER_SWITCH={RATIONAL  R_0=0.05 D_MAX=0.06} SWITCH={RATIONAL D_0=3.0 R_0=0.1 D_MAX=3.2} RADIUS={RATIONAL D_0=0.375 R_0=0.1 D_MAX=0.43} SIGMA=0.17 KERNEL=triangular DENSITY_THRESHOLD={RATIONAL R_0=0.0000001 D_MAX=0.000000100001} 

DUMPGRAPH MATRIX=mat FILE=mygraph.dot

#R_0=0.005 DMAX=1.0
#RADIUS={RATIONAL D_0=0.375 R_0=0.1 D_MAX=1.5}

# DETECTION OF THE CLUSTERS USING DFS:

DFSCLUSTERING MATRIX=mat LABEL=ss1

#                  
#A: Select which cluster detection
#B: Selects which specific cluster ordered in "descending" size order.
#                       A            B
cv: CLUSTER_PROPERTIES CLUSTERS=ss1 CLUSTER=1 SUM

size1: CLUSTER_NATOMS CLUSTERS=ss1 CLUSTER=1
size2: CLUSTER_NATOMS CLUSTERS=ss1 CLUSTER=2
size3: CLUSTER_NATOMS CLUSTERS=ss1 CLUSTER=3
size4: CLUSTER_NATOMS CLUSTERS=ss1 CLUSTER=4
size5: CLUSTER_NATOMS CLUSTERS=ss1 CLUSTER=5


PRINT ARG=cv.* FILE=CV.dat FMT=%8.4f STRIDE=1
PRINT ARG=size1.*,size2.*,size3.*,size4.*,size5.* FILE=Size.dat FMT=%8.4f STRIDE=1

OUTPUT_CLUSTER CLUSTERS=ss1 CLUSTER=1 FILE=mycluster.dat

#m1: METAD ARG=cv.sum SIGMA=5.0 HEIGHT=1.0 PACE=100 BIASFACTOR=60 TEMP=300 GRID_MIN=0 GRID_MAX=5000 GRID_BIN=100000
#PRINT ARG=m1.* FILE=colvar STRIDE=10




