Skip to content

Commit

Permalink
Fixes for more of manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed Oct 18, 2024
1 parent 43a9139 commit b921513
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/clusters/ClusterDiameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

//+PLUMEDOC CONCOMP CLUSTER_DIAMETER
/*
Print out the diameter of one of the connected components
Print out the diameter of one of the connected components.
An example input that determines the diameter of the second largest cluster that is identified by
analysing the connected components of a CONTACT_MATRIX using DFSCLUSTERING is shown below:
Expand Down
2 changes: 1 addition & 1 deletion src/clusters/ClusterDistribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ An input similar to this one was used to analyze the formation of a polycrystal
q6: Q6 SPECIES=1-300 SWITCH={GAUSSIAN D_0=5.29 R_0=0.01 D_MAX=5.3}
lq6: LOCAL_Q6 SPECIES=q6 SWITCH={GAUSSIAN D_0=5.29 R_0=0.01 D_MAX=5.3}
flq6: MORE_THAN ARG=lq6 SWITCH={GAUSSIAN D_0=0.19 R_0=0.01 D_MAX=0.2}
cc: COORDINATIONNUMBER SPECIES=flq6 SWITCH={GAUSSIAN D_0=3.59 R_0=0.01 D_MAX=3.6}
cc: COORDINATIONNUMBER SPECIES=1-300 SWITCH={GAUSSIAN D_0=3.59 R_0=0.01 D_MAX=3.6}
fcc: MORE_THAN ARG=cc SWITCH={GAUSSIAN D_0=5.99 R_0=0.01 D_MAX=6.0}
mat: CONTACT_MATRIX GROUP=1-300 SWITCH={GAUSSIAN D_0=3.59 R_0=0.01 D_MAX=3.6}
dfs: DFSCLUSTERING ARG=mat
Expand Down
2 changes: 1 addition & 1 deletion src/clusters/ClusterProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ file.
lq: COORDINATIONNUMBER SPECIES=1-100 SWITCH={CUBIC D_0=0.45 D_MAX=0.55}
cm: CONTACT_MATRIX GROUP=lq SWITCH={CUBIC D_0=0.45 D_MAX=0.55}
dfs: DFSCLUSTERING ARG=cm
clust1: CLUSTER_PROPERTIES CLUSTERS=dfs CLUSTER=1 SUM
clust1: CLUSTER_PROPERTIES ARG=lq CLUSTERS=dfs CLUSTER=1 SUM
PRINT ARG=clust1.sum FILE=colvar
```
Expand Down
2 changes: 1 addition & 1 deletion src/clusters/ClusterWithSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

//+PLUMEDOC CONCOMP CLUSTER_WITHSURFACE
/*
Determine the atoms that are within a certain cutoff of the atoms in a cluster
Determine the atoms that are within a certain cutoff of the atoms in a cluster.
This shortcut action can be used to identify the atoms within the largest connected cluster in a system as well
as the atoms around the cluster as shown in the example input below:
Expand Down
2 changes: 1 addition & 1 deletion src/clusters/OutputCluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ to a ndx file.
```plumed
mat: CONTACT_MATRIX ATOMS=1-1996 SWITCH={CUBIC D_0=0.34 D_MAX=0.38}
dfs: DFSCLUSTERING ARG=mat
OUTPUT_CLUSTER CLUSTERS=dfs CLUSTER=1 FILE=dfs.ndx
OUTPUT_CLUSTER ATOMS=1-1996 CLUSTERS=dfs CLUSTER=1 FILE=dfs.ndx
```
*/
Expand Down
45 changes: 44 additions & 1 deletion src/matrixtools/OuterProduct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,50 @@
/*
Calculate the outer product matrix of two vectors
\par Examples
This action can be used to calculate the [outer product](https://en.wikipedia.org/wiki/Outer_product) of two
vectors. As a (useless) example of what can be done with this action consider the following simple input:
```plumed
d1: DISTANCE ATOMS1=1,2 ATOMS2=3,4
d2: DISTANCE ATOMS1=5,6 ATOMS2=7,8 ATOMS3=9,10
pp: OUTER_PRODUCT ARG=d1,d2
PRINT ARG=pp FILE=colvar
```
This input outputs a $2 \times 3$ matrix. If we call the 2 dimensional vector output by the first DISTANCE action
$d$ and the 3 dimensional vector output by the second DISTANCE action $h$ then the $(i,j)$ element of the matrix
output by the action with the label `pp` is given by:
$$
p_{ij} = d_i h_j
$$
These outer product matrices are useful if you are trying to calculate an adjacency matrix that says atoms are
connected if they are within a certain distance of each other and if they satisfy a certain criterion. For example,
consider the following input:
```plumed
# Determine if atoms are within 5.3 nm of each other
c1: CONTACT_MATRIX GROUP=1-100 SWITCH={GAUSSIAN D_0=5.29 R_0=0.01 D_MAX=5.3}
# Calculate the coordination numbers
ones: ONES SIZE=100
cc: MATRIX_VECTOR PRODUCT ARG=c1,ones
# Now use MORE_THAN to work out which atoms have a coordination number that is bigger than six
cf: MORE_THAN ARG=cc SWITCH={RATIONAL D_0=5.5 R_0=0.5}
# Now make a matrix in which element i,j is one if atom i and atom j both have a coordination number that is greater than 6
cfm: OUTER_PRODUCT ARG=cf,cf
# And multiply this by our contact matrix to determine the desired adjacency matrix
m: CUSTOM ARG=c1,cfm FUNC=x*y PERIODIC=NO
PRINT ARG=m FILE=colvar
```
This input calculates a adjacency matrix which has element $(i,j)$ equal to one if atoms $i$ and $j$ have coordination numbers
that are greater than 6 and if they are within 5.3 nm of each other.
Notice that you can specify the function of the two input vectors that is to be calculated by using the `FUNC` keyword which accepts
mathematical expressions of $x$ and $y$. In other words, the elements of the outer product are calculated using the lepton library
that is used in the CUSTOM action. In addition, you can set `FUNC=min` or `FUNC=max` to set the elements of the outer product equal to
the minimum of the two input variables or the maximum respectively.
*/
//+ENDPLUMEDOC
Expand Down

1 comment on commit b921513

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/ANGLES.tmp
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/CAVITY.tmp
Found broken examples in automatic/CLASSICAL_MDS.tmp
Found broken examples in automatic/CONSTANT.tmp
Found broken examples in automatic/CONVERT_TO_FES.tmp
Found broken examples in automatic/COORDINATIONNUMBER.tmp
Found broken examples in automatic/DISTANCE_FROM_CONTOUR.tmp
Found broken examples in automatic/DUMPCUBE.tmp
Found broken examples in automatic/DUMPGRID.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/FIND_CONTOUR.tmp
Found broken examples in automatic/FIND_CONTOUR_SURFACE.tmp
Found broken examples in automatic/FIND_SPHERICAL_CONTOUR.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HISTOGRAM.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/INCYLINDER.tmp
Found broken examples in automatic/INENVELOPE.tmp
Found broken examples in automatic/INTERPOLATE_GRID.tmp
Found broken examples in automatic/LOCAL_AVERAGE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/METATENSOR.tmp
Found broken examples in automatic/MULTICOLVARDENS.tmp
Found broken examples in automatic/PAMM.tmp
Found broken examples in automatic/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in automatic/PYCVINTERFACE.tmp
Found broken examples in automatic/PYTHONFUNCTION.tmp
Found broken examples in automatic/Q3.tmp
Found broken examples in automatic/Q4.tmp
Found broken examples in automatic/Q6.tmp
Found broken examples in automatic/QUATERNION.tmp
Found broken examples in automatic/REWEIGHT_BIAS.tmp
Found broken examples in automatic/REWEIGHT_METAD.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_LINEAR_PROJ.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_MAHA_DIST.tmp
Found broken examples in automatic/TETRAHEDRALPORE.tmp
Found broken examples in automatic/TORSIONS.tmp
Found broken examples in automatic/WHAM_HISTOGRAM.tmp
Found broken examples in automatic/WHAM_WEIGHTS.tmp
Found broken examples in AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.