Parsing constants

You might have noticed that from time to time constants are specified using strings rather than numbers. An example is the following

Click on the labels of the actions for more information on what each action computes
tested on master
#SETTINGS MOLFILE=regtest/basic/rt65/AA.pdb
MOLINFO 
STRUCTURE
compulsory keyword a file in pdb format containing a reference structure.
=AA.pdb
MOLTYPE
compulsory keyword ( default=protein ) what kind of molecule is contained in the pdb file - usually not needed since protein/RNA/DNA are compatible
=rna e1: TORSION
ATOMS
the four atoms involved in the torsional angle
=@epsilon-1 t: METAD
ARG
compulsory keyword the labels of the scalars on which the bias will act
=e1
SIGMA
compulsory keyword the widths of the Gaussian hills
=0.15
PACE
compulsory keyword the frequency for hill addition
=10
HEIGHT
the heights of the Gaussian hills.
=2
GRID_MIN
the lower bounds for the grid
=-pi
GRID_MAX
the upper bounds for the grid
=pi
GRID_BIN
the number of bins for the grid
=200

Notice that the boundaries for GRID_MIN and GRID_MAX are -pi and pi. Until PLUMED 2.3, we used a very dummy parses that could recognize only pi as a special string, plus strings such as 0.5pi and -pi. However, as of version 2.4, we use the Lepton library in order to parse every constant that we read. This means that you can also employ more complicated expressions such as 1+2 or exp(10):

Click on the labels of the actions for more information on what each action computes
tested on master




Notice that this applies to any quantity read by plumed as a real number, but does not apply yet to integer numbers (e.g.: the PACE argument of METAD).