Skip to content

Commit 5dab89c

Browse files
Gareth Aneurin TribelloGareth Aneurin Tribello
authored andcommitted
Fixed more documentation
1 parent f8cd8ec commit 5dab89c

File tree

14 files changed

+165
-33
lines changed

14 files changed

+165
-33
lines changed

src/bias/BiasValue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ void BiasValue::registerKeywords(Keywords& keys) {
107107
"these quantities will named with the arguments of the bias followed by "
108108
"the character string _bias. These quantities tell the user how much the bias is "
109109
"due to each of the colvars.");
110+
keys.reset_style("NUMERICAL_DERIVATIVES","hidden");
110111
}
111112

112113
BiasValue::BiasValue(const ActionOptions&ao):

src/colvar/DRMSD.cpp

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,21 @@ position. Only pairs of atoms whose distance in the reference structure is withi
6464
6565
```plumed
6666
#SETTINGS INPUTFILES=regtest/basic/rt-drmsd/test1.pdb
67-
DRMSD REFERENCE=regtest/basic/rt-drmsd/test1.pdb LOWER_CUTOFF=0.1 UPPER_CUTOFF=0.8
67+
d: DRMSD ...
68+
REFERENCE=regtest/basic/rt-drmsd/test1.pdb
69+
LOWER_CUTOFF=0.1 UPPER_CUTOFF=0.8
70+
...
6871
```
6972
70-
The following tells plumed to calculate a DRMSD value for a pair of molecules.
73+
The following tells plumed to calculate the square of the DRMSD value for a pair of molecules.
7174
7275
```plumed
7376
#SETTINGS INPUTFILES=regtest/basic/rt-drmsd/test0.pdb
74-
DRMSD REFERENCE=regtest/basic/rt-drmsd/test0.pdb LOWER_CUTOFF=0.1 UPPER_CUTOFF=0.8 TYPE=INTER-DRMSD
77+
d: DRMSD ...
78+
REFERENCE=regtest/basic/rt-drmsd/test0.pdb
79+
LOWER_CUTOFF=0.1 UPPER_CUTOFF=0.8 TYPE=INTER-DRMSD
80+
SQUARED
81+
...
7582
```
7683
7784
Notice that in the input reference file (which you can see by clicking on regtest/basic/rt-drmsd/test0.pdb )
@@ -83,6 +90,20 @@ quantity is computed involve one atom from each of the two molecules. If this i
8390
by INTRA-DRMSD then only those distances involving pairs of atoms that are both in the same
8491
molecule are computed.
8592
93+
## Periodic boundary conditions
94+
95+
Notice that PLUMED does not use periodic boundary conditions when computing the reference distances. However, the instantaneous
96+
values of the distances are computed using periodic boundary conditions. If you would like not to use periodic boundary conditions
97+
when computing these instaneous distances you use the NOPBC flag as illustrated below:
98+
99+
```plumed
100+
#SETTINGS INPUTFILES=regtest/basic/rt-drmsd/test1.pdb
101+
d: DRMSD ...
102+
REFERENCE=regtest/basic/rt-drmsd/test1.pdb
103+
LOWER_CUTOFF=0.1 UPPER_CUTOFF=0.8 NOPBC
104+
...
105+
```
106+
86107
*/
87108
//+ENDPLUMEDOC
88109

@@ -106,7 +127,7 @@ void DRMSD::registerKeywords( Keywords& keys ) {
106127
keys.addFlag("SQUARED",false,"This should be setted if you want MSD instead of RMSD ");
107128
keys.addFlag("NOPBC",false,"ignore the periodic boundary conditions when calculating distances");
108129
// This is just ignored in reality which is probably bad
109-
keys.addFlag("NUMERICAL_DERIVATIVES",false,"calculate the derivatives for these quantities numerically");
130+
keys.addDeprecatedFlag("NUMERICAL_DERIVATIVES","");
110131
keys.setValueDescription("scalar/vector","the DRMSD distance between the instantaneous structure and the reference structure");
111132
keys.needsAction("SUM");
112133
keys.needsAction("DISTANCE");

src/colvar/Dipole.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PRINT ARG=d.* FILE=output
5252
5353
This command will output three values d.x, d.y and d.z, which are the x, y and z components of the dipole respectively.
5454
55+
5556
You can calculate three instinguishable dipoles using a single DIPOLE command by using an input like the one below:
5657
5758
```plumed
@@ -71,14 +72,15 @@ PRINT ARG=d.x,d.y,d.z FILE=output
7172
The output from the DIPOLE command now consists of three three dimensional vectors called d.x, d.y and d.z that contain the
7273
x, y and z components of the three dipoles respectively.
7374
74-
When running with periodic boundary conditions, the atoms in every group should be
75-
in the proper periodic image. This is done automatically since PLUMED 2.5,
76-
by considering the ordered list of atoms and rebuilding the molecule with a procedure
77-
that is equivalent to that done in [WHOLEMOLECULES](WHOLEMOLECULES.md). Notice that
78-
rebuilding is local to this action. This is different from [WHOLEMOLECULES](WHOLEMOLECULES.md)
79-
which actually modifies the coordinates stored in PLUMED. If you want to recover the old behavior
80-
you should use the NOPBC flag. In that case you need to take care that atoms are in the correct
81-
periodic image.
75+
A final important thing to note is that in all the commands above the default is to use a procedure akin to that used in [WHOLEMOLECULES](WHOLEMOLECULES.md) to ensure
76+
that the sets of atoms that are specified to each GROUP keyword are not broken by the periodic
77+
boundary conditions. If you would like to turn this off for any reason you add the NOPBC in your input file as shown
78+
below:
79+
80+
```plumed
81+
d: DIPOLE GROUP=1-10 NOPBC
82+
PRINT FILE=output STRIDE=5 ARG=d
83+
```
8284
8385
!!! caution "behaviour for non charge neutral groups"
8486

src/colvar/Plane.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ PRINT ARG=p.x,p.y,p.z FILE=colvar
4444
4545
The three components, p.x, p.y and p.z, output by the PLANE action here are the x, y and z components of the normal
4646
vector to the plane that is obtained by taking the cross product between the vector connecting atoms 1 and 2 and
47-
the vector connecting atoms 2 and 3.
47+
the vector connecting atoms 2 and 3. Notice that the default here is to evaluate these two vectors in a way that takes
48+
any periodic boundary conditions (PBC) into account. If you wish to disregard the PBC you can use the NOPBC flag as shown in the following input:
49+
50+
```plumed
51+
p: PLANE ATOMS=1,2,3 NOPBC
52+
PRINT ARG=p.x,p.y,p.z FILE=colvar
53+
```
4854
4955
To calculate the cross product of the vector connecting atoms 1 and 2 and the vector connecting atoms 3 and 4 you use
5056
an input like this:

src/contour/DumpContour.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,22 @@ center: CENTER ATOMS=1-96000 WEIGHTS=tfcc
5555
# This determines the positions of the atoms of interest relative to the center of the solid region
5656
dens_dist: DISTANCES ORIGIN=center ATOMS=1-96000 COMPONENTS
5757
# This computes the numerator in the expression above for the phase field
58-
dens_numer: KDE VOLUMES=tfcc ARG=dens_dist.x,dens_dist.y,dens_dist.z GRID_BIN=80,80,80 BANDWIDTH=1.0,1.0,1.0
58+
dens_numer: KDE ...
59+
VOLUMES=tfcc ARG=dens_dist.x,dens_dist.y,dens_dist.z
60+
GRID_BIN=80,80,80 BANDWIDTH=1.0,1.0,1.0
61+
...
5962
# This computes the denominator
60-
dens_denom: KDE ARG=dens_dist.x,dens_dist.y,dens_dist.z GRID_BIN=80,80,80 BANDWIDTH=1.0,1.0,1.0
63+
dens_denom: KDE ...
64+
ARG=dens_dist.x,dens_dist.y,dens_dist.z
65+
GRID_BIN=80,80,80 BANDWIDTH=1.0,1.0,1.0
66+
...
6167
# This computes the final phase field
6268
dens: CUSTOM ARG=dens_numer,dens_denom FUNC=x/y PERIODIC=NO
6369
6470
# Find the isocontour
6571
cont: FIND_CONTOUR ARG=dens CONTOUR=0.5
6672
# Use the special method for outputting the contour to a file
67-
DUMPCONTOUR ARG=cont FILE=surface.xyz
73+
DUMPCONTOUR ARG=cont FILE=surface.xyz STRIDE=1 FMT=%8.4f
6874
```
6975
7076
*/
@@ -92,13 +98,12 @@ void DumpContour::registerKeywords( Keywords& keys ) {
9298
keys.addInputKeyword("compulsory","ARG","vector","the labels of the FIND_CONTOUR action that you would like to output");
9399
keys.add("compulsory","STRIDE","1","the frequency with which the grid should be output to the file.");
94100
keys.add("compulsory","FILE","density","the file on which to write the grid.");
95-
keys.add("optional","FMT","the format that should be used to output real numbers");
101+
keys.add("compulsory","FMT","%f","the format that should be used to output real numbers");
96102
}
97103

98104
DumpContour::DumpContour(const ActionOptions&ao):
99105
Action(ao),
100-
ActionPilot(ao),
101-
fmt("%f") {
106+
ActionPilot(ao) {
102107

103108
std::string argname;
104109
parse("ARG",argname);

src/core/ActionToPutData.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,19 @@ You would only use the PUT command if you were calling PLUMED from python or an
6161
# This is how you create a value to hold the energy the MD code passes energy in plumed
6262
eng: PUT UNIT=energy PERIODIC=NO
6363
# This is how you create an vector of the 100 x positions to plumed
64-
xpos: PUT SHAPE=100 UNIT=length PERIODIC=NO
64+
# Notice how we use ROLE here in order to tell PLUMED that these are the x coordinates.
65+
# Further note that we need to use the FROM_DOMAINS flag if the MD code we are using uses
66+
# domain decomposition.
67+
xpos: PUT SHAPE=100 UNIT=length PERIODIC=NO ROLE=x FROM_DOMAINS
6568
# This is how you create a scalar to hold the timestep
6669
# The constant flag indicates that the value of the timestep doesn't change during the simulation
6770
tstep: PUT CONSTANT UNIT=time PERIODIC=NO
6871
# This is how you create a value to hold a 10 x 10 matrix in plumed whose elements are unitless
6972
matrix: PUT SHAPE=10,10 UNIT=number PERIODIC=NO
7073
# Lastly, if you want to pass a value that has a periodic domain you can do so as follows
71-
tor: PUT UNIT=number PERIODIC=-pi,pi
74+
# By adding the MUTABLE flag here we pass the data to PLUMED in a way that ensures that PLUMED can modify
75+
# the value that was passed from the MD code and thus pass back a different value to the underlying MD code.
76+
tor: PUT UNIT=number PERIODIC=-pi,pi MUTABLE
7277
```
7378
7479
*/

src/core/Group.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Further notice that starting from version 2.10 it is possible to directly use an
8787
DUMPATOMS ATOMS={@ndx:{extras/index.ndx Protein}} FILE=traj.gro
8888
```
8989
90-
Lastly notice that it is also possible to remove atoms from the list of atoms specified in a GROUP by using the keywords `REMOVE`, `SORT`, and `UNIQUE` as shown below:
90+
Notice that it is possible to remove atoms from the list of atoms specified in a GROUP by using the keyword `REMOVE` as shown below:
9191
9292
```plumed
9393
# take one atom every three, that is oxygens
@@ -98,6 +98,22 @@ DUMPATOMS ATOMS=ox FILE=ox.gro
9898
DUMPATOMS ATOMS=hy FILE=hy.gro
9999
```
100100
101+
You can also `SORT` the atoms in a group into ascending order by using the SORT keyword as shown below:
102+
103+
```plumed
104+
# If you ask for this group in the input to another action the atoms will be
105+
# in ascending order i.e. the specified atoms will be 2,3,4,4,5,6
106+
g: GROUP ATOMS=5,4,6,3,4,2 SORT
107+
```
108+
109+
or you can sort the atoms and remove duplicated atoms by using the `UNIQUE` flag
110+
111+
```plumed
112+
# If you ask for this group in the input to another action the duplicate atom specifications will be removed
113+
# and the atoms will be ascending order i.e. the specified atoms will be 2,3,4,5,6
114+
g: GROUP ATOMS=5,4,6,3,4,2 UNIQUE
115+
```
116+
101117
When you used the GROUP command the flow as follows:
102118
103119
- If `ATOMS` is present, then take the ordered list of atoms from the `ATOMS` keyword as a starting list.

src/function/Custom.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ and that the MATHEVAL action evaluates functions [the Lepton library](https://si
486486
//+ENDPLUMEDOC
487487

488488
void Custom::registerKeywords(Keywords& keys) {
489+
if( keys.getDisplayName()=="MATHEVAL") {
490+
keys.setDeprecated("CUSTOM");
491+
}
489492
keys.use("PERIODIC");
490493
keys.add("compulsory","FUNC","the function you wish to evaluate");
491494
keys.add("optional","VAR","the names to give each of the arguments in the function. If you have up to three arguments in your function you can use x, y and z to refer to them. Otherwise you must use this flag to give your variables names.");

src/generic/UpdateIf.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,19 @@ only when another variable is within a given range.
5858
5959
## Examples
6060
61-
The following input instructs plumed dump all the snapshots where an atom is in touch with
61+
The following input instructs plumed to dump all the snapshots in which atoms 1 and 2 are within
62+
0.3 nm of each other:
63+
64+
```plumed
65+
d: DISTANCE ATOMS=1,2
66+
UPDATE_IF ARG=d LESS_THAN=0.3 STRIDE=1
67+
DUMPATOMS ATOMS=@mdatoms FILE=output.xyz
68+
UPDATE_IF ARG=d END
69+
```
70+
71+
Notice, that the STRIDE is set equal to one by default. You will likely always want to set it to this value.
72+
73+
The following input instructs plumed to dump all the snapshots where an atom is in touch with
6274
the solute.
6375
6476
```plumed

src/gridtools/ReadGridInSetup.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ function at the various grid points.
5757
5858
N.B. This method with lepton was implemented to facilitate the implementation of the normalisation in the implementation of the [RDF](RDF.md) shortcut.
5959
60+
Lastly note that you can specify the grid spacing in the input to this action rather than the number of bins as shown below:
61+
62+
```plumed
63+
d2: REFERENCE_GRID GRID_MIN=0 GRID_MAX=10 GRID_SPACING=0.5 FUNC=d1*d1 VAR=d1 PERIODIC=NO
64+
d1: DISTANCE ATOMS=1,2
65+
ff: EVALUATE_FUNCTION_FROM_GRID GRID=d2
66+
PRINT ARG=d1,ff FMT=%8.4f FILE=colvar
67+
```
68+
6069
*/
6170
//+ENDPLUMEDOC
6271

@@ -85,7 +94,7 @@ class ReadGridInSetup : public ActionWithGrid {
8594
std::vector<std::string> dernames;
8695
void createGridAndValue( const std::string& gtype, const std::vector<bool>& ipbc, const unsigned& nfermi,
8796
const std::vector<std::string>& gmin, const std::vector<std::string>& gmax,
88-
const std::vector<std::size_t>& gbin );
97+
const std::vector<std::size_t>& gbin, std::vector<double>& gspacing );
8998
public:
9099
static void registerKeywords( Keywords& keys );
91100
explicit ReadGridInSetup(const ActionOptions&ao);
@@ -130,6 +139,8 @@ ReadGridInSetup::ReadGridInSetup(const ActionOptions&ao):
130139
parseVector("GRID_MAX",gmax);
131140
std::vector<std::size_t> gbin(gmin.size());
132141
parseVector("GRID_BIN",gbin);
142+
std::vector<double> spacing(gmin.size());
143+
parseVector("GRID_SPACING",spacing);
133144
std::vector<std::string> pbc(gmin.size());
134145
parseVector("PERIODIC",pbc);
135146
std::vector<bool> ipbc( pbc.size() );
@@ -165,7 +176,7 @@ ReadGridInSetup::ReadGridInSetup(const ActionOptions&ao):
165176
}
166177

167178
// Create the grid and the value of the grid
168-
createGridAndValue( "flat", ipbc, 0, gmin, gmax, gbin );
179+
createGridAndValue( "flat", ipbc, 0, gmin, gmax, gbin, spacing );
169180

170181
// Read in stuff for function
171182
log.printf(" evaluating function : %s\n",func.c_str());
@@ -275,7 +286,8 @@ ReadGridInSetup::ReadGridInSetup(const ActionOptions&ao):
275286
if( !flatgrid ) {
276287
ifile.scanField( "nbins", gbin1);
277288
gbin[0]=gbin1;
278-
createGridAndValue( "fibonacci", ipbc, gbin[0], gmin, gmax, gbin );
289+
std::vector<double> spacing;
290+
createGridAndValue( "fibonacci", ipbc, gbin[0], gmin, gmax, gbin, spacing );
279291
} else {
280292
for(unsigned i=0; i<dernames.size(); ++i) {
281293
ifile.scanField( "min_" + dernames[i], gmin[i]);
@@ -298,7 +310,8 @@ ReadGridInSetup::ReadGridInSetup(const ActionOptions&ao):
298310
plumed_merror("missing derivatives from grid file");
299311
}
300312
}
301-
createGridAndValue( "flat", ipbc, 0, gmin, gmax, gbin );
313+
std::vector<double> spacing;
314+
createGridAndValue( "flat", ipbc, 0, gmin, gmax, gbin, spacing );
302315
}
303316
// And finally read all the grid points
304317
Value* valout=getPntrToComponent(0);
@@ -338,9 +351,8 @@ ReadGridInSetup::ReadGridInSetup(const ActionOptions&ao):
338351

339352
void ReadGridInSetup::createGridAndValue( const std::string& gtype, const std::vector<bool>& ipbc, const unsigned& nfermi,
340353
const std::vector<std::string>& gmin, const std::vector<std::string>& gmax,
341-
const std::vector<std::size_t>& gbin ) {
354+
const std::vector<std::size_t>& gbin, std::vector<double>& gspacing ) {
342355
gridobject.setup( gtype, ipbc, nfermi, 0.0 );
343-
std::vector<double> gspacing;
344356
if( gtype=="flat" ) {
345357
gridobject.setBounds( gmin, gmax, gbin, gspacing );
346358
// Now create the value

0 commit comments

Comments
 (0)