Skip to content

Commit

Permalink
fixed examples in new documentation for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed Dec 3, 2024
1 parent 9b8c43f commit 2ff2609
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions new-manual/index.ndx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[ Protein ]
1 3 5 7 9
2 4 6 8 10
[ Group2 ]
30 31 32 33 34 35 36 37 38 39 40
5
2 changes: 1 addition & 1 deletion src/core/ActionToPutData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tstep: PUT CONSTANT UNIT=time PERIODIC=NO
# This is how you create a value to hold a 10 x 10 matrix in plumed whose elements are unitless
matrix: PUT SHAPE=10,10 UNIT=number PERIODIC=NO
# Lastly, if you want to pass a value that has a periodic domain you can do so as follows
tor: PUT PERIODIC=-pi,pi
tor: PUT UNIT=number PERIODIC=-pi,pi
```
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/PbcAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pbc: PBC
Instead this command would be called from python like this:
```plumed
```python
import plumed
# Create a PLUMED object
Expand Down
2 changes: 1 addition & 1 deletion src/refdist/Difference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void Difference::read( ActionWithArguments* action ) {
} else action->getPntrToArgument(1)->setDomain( min0, max0 );
} else if( action->getPntrToArgument(1)->isPeriodic() ) {
periodic=true; action->getPntrToArgument(1)->getDomain( min0, max0 );
if( !action->getPntrToArgument(1)->isConstant() ) {
if( !action->getPntrToArgument(0)->isConstant() ) {
action->error("period for input variables " + action->getPntrToArgument(0)->getName() + " and " + action->getPntrToArgument(1)->getName() + " should be the same 1");
} else action->getPntrToArgument(0)->setDomain( min0, max0 );
}
Expand Down
22 changes: 11 additions & 11 deletions src/refdist/Kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ distance as is done in the following example:
```plumed
d1: DISTANCE ATOMS=1,2
d2: DISTANCEE ATOMS=3,4
d2: DISTANCE ATOMS=3,4
k: KERNEL ARG=d1,d2 TYPE=gaussian CENTER=1,1 SIGMA=0.1,0.1
```
or you can use the [MAHALANOBIS_DISTANCE](MAHALANOBIS_DISTANCE.md) as is done here:
```plumed
t1: TORSION ATOMS=1,2,3,4
t2: TORSION ATOMS=5,6,7,8
phi: TORSION ATOMS=1,2,3,4
psi: TORSION ATOMS=5,6,7,8
k: KERNEL ...
ARG=t1,t2 TYPE=von-misses
ARG=phi,psi TYPE=von-misses
CENTER=-1.09648066E+0000,-7.17867907E-0001
COVAR=1.40523052E-0001,-1.05385552E-0001,-1.05385552E-0001,1.63290557E-0001
...
Expand All @@ -98,9 +98,9 @@ Notice that you specify the Kernel function in a separate PLUMED input file by u
```plumed
#SETTINGS INPUTFILES=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
t1: TORSION ATOMS=1,2,3,4
t2: TORSION ATOMS=5,6,7,8
k: KERNEL ARG=t1,t2 REFERENCE=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp NUMBER=3
phi: TORSION ATOMS=1,2,3,4
psi: TORSION ATOMS=5,6,7,8
k: KERNEL ARG=phi,psi REFERENCE=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp NUMBER=3
```
This command computes the same Kernel that was computed in the previous input. The keyword `REFERENCE` specifies that the parameters are to be read
Expand All @@ -110,9 +110,9 @@ Lastly, note that you can use vectors in the input to this shortcut as shown her
```plumed
#SETTINGS INPUTFILES=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
t1: TORSION ATOMS1=1,2,3,4 ATOMS2=9,10,11,12 ATOMS3=17,18,19,20
t2: TORSION ATOMS1=5,6,7,8 ATOMS2=13,14,15,16 ATOMS3=21,22,23,24
k: KERNEL ARG=t1,t2 REFERENCE=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp NUMBER=3
phi: TORSION ATOMS1=1,2,3,4 ATOMS2=9,10,11,12 ATOMS3=17,18,19,20
psi: TORSION ATOMS1=5,6,7,8 ATOMS2=13,14,15,16 ATOMS3=21,22,23,24
k: KERNEL ARG=phi,psi REFERENCE=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp NUMBER=3
```
The output `k` here is a vector with three components. The first component is the kernel evaluated with the torsion involving atoms 1, 2, 3 and 4 and the
Expand All @@ -136,7 +136,7 @@ PLUMED_REGISTER_ACTION(Kernel,"KERNEL")

void Kernel::registerKeywords(Keywords& keys) {
ActionShortcut::registerKeywords( keys );
keys.add("numbered","ARG","the arguments that should be used as input to this method");
keys.addInputKeyword("numbered","ARG","scalar/vector","the arguments that should be used as input to this method");
keys.add("compulsory","TYPE","gaussian","the type of kernel to use");
keys.add("compulsory","CENTER","the position of the center of the kernel");
keys.add("optional","SIGMA","square root of variance of the cluster");
Expand Down

1 comment on commit 2ff2609

@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/ANN.tmp
Found broken examples in automatic/CLASSICAL_MDS.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/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HISTOGRAM.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/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.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 AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.