Project ID: plumID:21.044
Source: driver.dat
Originally used with PLUMED version: 2.5.1
Stable: raw zipped stdout - stderr
Master: raw zipped stdout - stderr

# From NaCl Crystallisation Pathways; Aaron R. Finney and Matteo Salvalaglio
# Plumed driver file to post-process MD and well-tempered metadynamics simulations


# Fixed atom at the centre of the simulation box
p: FIXEDATOM AT=2.,2.,2.

# DEfine the ion groups
gna: GROUP ATOMS=6151-6520
gcl: GROUP ATOMS=6521-6890
gions: GROUP ATOMS=6151-6890

# Measure coordination in the biased sphere 
cn0:  COORDINATIONNUMBER SPECIESA=gna SPECIESB=gcl SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} 
cn1:  COORDINATIONNUMBER SPECIESA=gcl SPECIESB=gna SWITCH={RATIONAL R_0=0.38 D_MAX=1.0}

sphere0: INSPHERE ATOM=p DATA=cn0 RADIUS={TANH R_0=1.5}  MORE_THAN={RATIONAL R_0=5.0}
sphere1: INSPHERE ATOM=p DATA=cn1 RADIUS={TANH R_0=1.5}  MORE_THAN={RATIONAL R_0=5.0}

ncrysts: COMBINE ARG=sphere0.morethan,sphere1.morethan POWERS=1,1 PERIODIC=NO
vcrysts: COMBINE ARG=ncrysts POWERS=0.333 PERIODIC=NO


# Measure coordination throughout the box
cn2:  COORDINATIONNUMBER SPECIESA=gna SPECIESB=gcl SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} MORE_THAN={RATIONAL R_0=5.0}
cn3:  COORDINATIONNUMBER SPECIESA=gcl SPECIESB=gna SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} MORE_THAN={RATIONAL R_0=5.0}

ncrysta: COMBINE ARG=cn2.morethan,cn3.morethan POWERS=1,1 PERIODIC=NO
vcrysta: COMBINE ARG=ncrysta POWERS=0.333 PERIODIC=NO


# Measure coordination of crystalline ions in the biased sphere
q60s: Q6 SPECIESA=gna SPECIESB=gcl SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} LOWMEM
q61s: Q6 SPECIESA=gcl SPECIESB=gna SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} LOWMEM

lq60s: LOCAL_Q6 SPECIES=q60s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} LOWMEM
lq61s: LOCAL_Q6 SPECIES=q61s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} LOWMEM

flq60s: MFILTER_MORE DATA=lq60s SWITCH={GAUSSIAN R_0=0.55 D_MAX=0.56} 
flq61s: MFILTER_MORE DATA=lq61s SWITCH={GAUSSIAN R_0=0.55 D_MAX=0.56} 

cn4: COORDINATIONNUMBER SPECIESA=flq60s SPECIESB=flq61s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} 
cn5: COORDINATIONNUMBER SPECIESA=flq61s SPECIESB=flq60s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} 

sphere2: INSPHERE ATOM=p DATA=cn4 RADIUS={TANH R_0=1.5}  MORE_THAN={RATIONAL R_0=5.0}
sphere3: INSPHERE ATOM=p DATA=cn5 RADIUS={TANH R_0=1.5}  MORE_THAN={RATIONAL R_0=5.0}

qncrysts: COMBINE ARG=sphere2.morethan,sphere3.morethan POWERS=1,1 PERIODIC=NO
qvcrysts: COMBINE ARG=qncrysts POWERS=0.333 PERIODIC=NO


# Measure coordination of crystalline ions in the box
cn6: COORDINATIONNUMBER SPECIESA=flq60s SPECIESB=flq61s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} MORE_THAN={RATIONAL R_0=5.0}
cn7: COORDINATIONNUMBER SPECIESA=flq61s SPECIESB=flq60s SWITCH={RATIONAL R_0=0.38 D_MAX=1.0} MORE_THAN={RATIONAL R_0=5.0}

qncrysta: COMBINE ARG=cn6.morethan,cn7.morethan POWERS=1,1 PERIODIC=NO
qvcrysta: COMBINE ARG=qncrysta POWERS=0.333 PERIODIC=NO


# Print
PRINT ARG=ncrysts,vcrysts,qncrysts,qvcrysts,ncrysta,vcrysta,qncrysta,qvcrysta FILE=q6-sphere-and-all.dat

# histograms for the rxn coordinate variables
histcv1: HISTOGRAM ARG=vcrysta GRID_MIN=-1. GRID_MAX=10. GRID_BIN=200 BANDWIDTH=0.01
histcv2: HISTOGRAM ARG=qvcrysta GRID_MIN=-1. GRID_MAX=10. GRID_BIN=200 BANDWIDTH=0.01
DUMPGRID GRID=histcv1 FILE=histn.dat FMT=%8.4f
DUMPGRID GRID=histcv2 FILE=histnq6.dat FMT=%8.4f



# Get the Na-Cl coordination number 
cnint: COORDINATIONNUMBER SPECIES=gions SWITCH={RATIONAL R_0=0.355 D_MAX=0.36} MEAN HIGHEST

# Report the mean and highest coordination numbers 
PRINT ARG=cnint.* FILE=cn-regions.dat

# DFS on ion clusters built according to simple cut-off criterion
mat: CONTACT_MATRIX ATOMS=cnint SWITCH={RATIONAL R_0=0.355 D_MAX=0.36}
dfs: DFSCLUSTERING MATRIX=mat

# Cluster size distribution and number of ion clusters/monomers
nhist: CLUSTER_DISTRIBUTION CLUSTERS=dfs HISTOGRAM={GAUSSIAN LOWER=-1.5 UPPER=499.5 NBINS=501 NORM}
nclust1: CLUSTER_DISTRIBUTION CLUSTERS=dfs MORE_THAN={GAUSSIAN D_0=0.95 R_0=0.01 D_MAX=0.96}
nclust2: CLUSTER_DISTRIBUTION CLUSTERS=dfs MORE_THAN={GAUSSIAN D_0=1.95 R_0=0.01 D_MAX=1.96}
nfree: CLUSTER_DISTRIBUTION CLUSTERS=dfs LESS_THAN={GAUSSIAN D_0=0.55 R_0=0.01 D_MAX=0.96}

# Largest cluster at the interface
clust0nat: CLUSTER_NATOMS CLUSTERS=dfs CLUSTER=1
clust1nat: CLUSTER_NATOMS CLUSTERS=dfs CLUSTER=2
clust2nat: CLUSTER_NATOMS CLUSTERS=dfs CLUSTER=3

# Report the cluster information
PRINT ARG=nfree.*,nclust1.*,nclust2.*,clust0nat.*,clust1nat.*,clust2nat.* FILE=cluster.dat
PRINT ARG=nhist.* FILE=csd.dat