Module |
gridtools |
Description |
Usage |
Output the function on the grid to a file with the PLUMED grid format. |
  |
This action outputs data to a file. You can read more about how PLUMED manages output files here |
|
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
Keyword |
Type |
Description |
ARG |
grid |
the label for the grid that you would like to output |
Further details and examples
Output the function on the grid to a file with the PLUMED grid format.
PLUMED provides a number of actions that calculate the values of functions on grids.
For instance, whenever you calculate a free energy as a function of a collective variable using
KDE, HISTOGRAM and CONVERT_TO_FES you will generally want to output the value of the free energy at a number of points on a
discrete grid that covers the CV space uniformly. Alternatively you may want to calculate
what value some symmetry function takes at different points inside your simulation cell using MULTICOLVARDENS or some suitable combination of CUSTOM actions.
This action allows you to output these functions calculated on a grid using a format that can be read in using gnuplot
and other such plotting programs. The file output using this action will have a header that contains some essential
information about the function plotted and that looks something like this:
#! FIELDS x y hA1 dhA1_x dhA1_x
#! SET normalisation 2.0000
#! SET min_x 0.0
#! SET max_x 3.0
#! SET nbins_x 100
#! SET periodic_x false
#! SET min_y 0.0
#! SET max_y 3.0
#! SET nbins_y 100
#! SET periodic_y false
The header shown here tells us that we have grid showing the values that a function with two arguments x and y
takes at various points in our cell. The lines beneath the first line then tell us a little bit about these two
input arguments.
The remaining lines of the file give us information on the positions of our grid points and the value the function and
its partial derivatives with respect to x and y. If the header is as above a list of values of the function that have
x=0 and 100 values of y between 0.0 and 3.0 will be provided. This block of data will be followed with a blank line.
There will then be a second block of values which will all have been evaluated the same value of x and all possible values
for y. This block is then followed by a blank line again and this pattern continues until all points of the grid have been covered.
Examples
The following input monitors two torsional angles during a simulation
and outputs a continuous histogram as a function of them at the end of the simulation.
r1The TORSION action with label r1 calculates the following quantities: Quantity | Type | Description |
r1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
r2The TORSION action with label r2 calculates the following quantities: Quantity | Type | Description |
r2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=2,3,4,5
hhThe HISTOGRAM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the estimate of the histogram as a function of the argument that was obtained |
: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
...
hh: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and uses the defaults shown here. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
NORMALIZATION This controls how the data is normalized it can be set equal to true, false or ndata=ndata STRIDE the frequency with which to store data for averaging=1 CLEAR the frequency with whihc to clear the data that is being averaged=0
...
# hh: HISTOGRAM ...
hh_weightThe CONSTANT action with label hh_weight calculates the following quantities: Quantity | Type | Description |
hh_weight | scalar | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=1
hh_kdeThe KDE action with label hh_kde calculates the following quantities: Quantity | Type | Description |
hh_kde | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: KDECreate a histogram from the input scalar/vector/matrix using KDE More details ARGthe label for the value that should be used to construct the histogram=r1,r2 GRID_MIN the lower bounds for the grid=-3.14,-3.14 GRID_MAX the upper bounds for the grid=3.14,3.14 GRID_BINthe number of bins for the grid=200,200 BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
hh_kdepThe CUSTOM action with label hh_kdep calculates the following quantities: Quantity | Type | Description |
hh_kdep | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_kde,hh_weight FUNCthe function you wish to evaluate=x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
hh_uThe ACCUMULATE action with label hh_u calculates the following quantities: Quantity | Type | Description |
hh_u | grid | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_kdep STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hh_nsumThe ACCUMULATE action with label hh_nsum calculates the following quantities: Quantity | Type | Description |
hh_nsum | scalar | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_weight STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hhThe CUSTOM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_u,hh_nsum FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input ---
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=hh FILE the file on which to write the grid=histo
The following input monitors two torsional angles during a simulation
and outputs a discrete histogram as a function of them at the end of the simulation.
r1The TORSION action with label r1 calculates the following quantities: Quantity | Type | Description |
r1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
r2The TORSION action with label r2 calculates the following quantities: Quantity | Type | Description |
r2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=2,3,4,5
hhThe HISTOGRAM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the estimate of the histogram as a function of the argument that was obtained |
: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
KERNEL the kernel function you are using=DISCRETE
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
...
hh: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and uses the defaults shown here. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
KERNEL the kernel function you are using=DISCRETE
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
NORMALIZATION This controls how the data is normalized it can be set equal to true, false or ndata=ndata STRIDE the frequency with which to store data for averaging=1 CLEAR the frequency with whihc to clear the data that is being averaged=0
...
# hh: HISTOGRAM ...
hh_weightThe CONSTANT action with label hh_weight calculates the following quantities: Quantity | Type | Description |
hh_weight | scalar | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=1
hh_kdeThe KDE action with label hh_kde calculates the following quantities: Quantity | Type | Description |
hh_kde | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: KDECreate a histogram from the input scalar/vector/matrix using KDE More details ARGthe label for the value that should be used to construct the histogram=r1,r2 KERNEL the kernel function you are using=DISCRETE GRID_MIN the lower bounds for the grid=-3.14,-3.14 GRID_MAX the upper bounds for the grid=3.14,3.14 GRID_BINthe number of bins for the grid=200,200
hh_kdepThe CUSTOM action with label hh_kdep calculates the following quantities: Quantity | Type | Description |
hh_kdep | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_kde,hh_weight FUNCthe function you wish to evaluate=x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
hh_uThe ACCUMULATE action with label hh_u calculates the following quantities: Quantity | Type | Description |
hh_u | grid | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_kdep STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hh_nsumThe ACCUMULATE action with label hh_nsum calculates the following quantities: Quantity | Type | Description |
hh_nsum | scalar | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_weight STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hhThe CUSTOM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_u,hh_nsum FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input ---
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=hh FILE the file on which to write the grid=histo
The following input monitors two torsional angles during a simulation
and outputs the histogram accumulated thus far every 100000 steps.
r1The TORSION action with label r1 calculates the following quantities: Quantity | Type | Description |
r1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
r2The TORSION action with label r2 calculates the following quantities: Quantity | Type | Description |
r2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=2,3,4,5
hhThe HISTOGRAM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the estimate of the histogram as a function of the argument that was obtained |
: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
...
hh: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and uses the defaults shown here. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
NORMALIZATION This controls how the data is normalized it can be set equal to true, false or ndata=ndata STRIDE the frequency with which to store data for averaging=1 CLEAR the frequency with whihc to clear the data that is being averaged=0
...
# hh: HISTOGRAM ...
hh_weightThe CONSTANT action with label hh_weight calculates the following quantities: Quantity | Type | Description |
hh_weight | scalar | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=1
hh_kdeThe KDE action with label hh_kde calculates the following quantities: Quantity | Type | Description |
hh_kde | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: KDECreate a histogram from the input scalar/vector/matrix using KDE More details ARGthe label for the value that should be used to construct the histogram=r1,r2 GRID_MIN the lower bounds for the grid=-3.14,-3.14 GRID_MAX the upper bounds for the grid=3.14,3.14 GRID_BINthe number of bins for the grid=200,200 BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
hh_kdepThe CUSTOM action with label hh_kdep calculates the following quantities: Quantity | Type | Description |
hh_kdep | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_kde,hh_weight FUNCthe function you wish to evaluate=x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
hh_uThe ACCUMULATE action with label hh_u calculates the following quantities: Quantity | Type | Description |
hh_u | grid | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_kdep STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hh_nsumThe ACCUMULATE action with label hh_nsum calculates the following quantities: Quantity | Type | Description |
hh_nsum | scalar | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_weight STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
hhThe CUSTOM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_u,hh_nsum FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input ---
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=hh FILE the file on which to write the grid=histo STRIDE the frequency with which the grid should be output to the file=100000
The following input monitors two torsional angles during a simulation
and outputs a separate histogram for each 100000 steps worth of trajectory.
Notice how the CLEAR keyword is used here and how it is not used in the
previous example.
r1The TORSION action with label r1 calculates the following quantities: Quantity | Type | Description |
r1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
r2The TORSION action with label r2 calculates the following quantities: Quantity | Type | Description |
r2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=2,3,4,5
hhThe HISTOGRAM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the estimate of the histogram as a function of the argument that was obtained |
: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2 CLEAR the frequency with whihc to clear the data that is being averaged=100000
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
...
hh: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and uses the defaults shown here. More details ...
ARGthe quantities that are being used to construct the histogram=r1,r2 CLEAR the frequency with whihc to clear the data that is being averaged=100000
GRID_MIN the lower bounds for the grid=-3.14,-3.14
GRID_MAX the upper bounds for the grid=3.14,3.14
GRID_BINthe number of bins for the grid=200,200
BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
NORMALIZATION This controls how the data is normalized it can be set equal to true, false or ndata=ndata STRIDE the frequency with which to store data for averaging=1
...
# hh: HISTOGRAM ...
hh_weightThe CONSTANT action with label hh_weight calculates the following quantities: Quantity | Type | Description |
hh_weight | scalar | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=1
hh_kdeThe KDE action with label hh_kde calculates the following quantities: Quantity | Type | Description |
hh_kde | grid | a function on a grid that was obtained by doing a Kernel Density Estimation using the input arguments |
: KDECreate a histogram from the input scalar/vector/matrix using KDE More details ARGthe label for the value that should be used to construct the histogram=r1,r2 GRID_MIN the lower bounds for the grid=-3.14,-3.14 GRID_MAX the upper bounds for the grid=3.14,3.14 GRID_BINthe number of bins for the grid=200,200 BANDWIDTHthe bandwidths for kernel density esimtation=0.05,0.05
hh_kdepThe CUSTOM action with label hh_kdep calculates the following quantities: Quantity | Type | Description |
hh_kdep | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_kde,hh_weight FUNCthe function you wish to evaluate=x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
hh_uThe ACCUMULATE action with label hh_u calculates the following quantities: Quantity | Type | Description |
hh_u | grid | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_kdep STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=100000
hh_nsumThe ACCUMULATE action with label hh_nsum calculates the following quantities: Quantity | Type | Description |
hh_nsum | scalar | a sum calculated from the time series of the input quantity |
: ACCUMULATESum the elements of this value over the course of the trajectory More details ARGthe label of the argument that is being added to on each timestep=hh_weight STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=100000
hhThe CUSTOM action with label hh calculates the following quantities: Quantity | Type | Description |
hh | grid | the grid obtained by doing an element-wise application of an arbitrary function to the input grid |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=hh_u,hh_nsum FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input ---
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=hh FILE the file on which to write the grid=histo STRIDE the frequency with which the grid should be output to the file=100000
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
input |
none |
the label for the grid that you would like to output |
STRIDE |
compulsory |
0 |
the frequency with which the grid should be output to the file |
FILE |
compulsory |
density |
the file on which to write the grid |
GRID |
optional |
not used |
the grid you would like to print (can also use ARG for specifying what is being printed) |
FMT |
optional |
not used |
the format that should be used to output real numbers |
PRINT_XYZ |
optional |
false |
output coordinates on fibonacci grid to xyz file |
PRINT_ONE_FILE |
optional |
false |
output grids one after the other in a single file |