This is part of the gridtools module |
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 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.
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.
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.
r1: TORSIONATOMS=1,2,3,4 r2: TORSIONthe four atoms involved in the torsional angleATOMS=2,3,4,5 hh: HISTOGRAM ...the four atoms involved in the torsional angleARG=r1,r2the quantities that are being used to construct the histogramGRID_MIN=-3.14,-3.14compulsory keyword ( default=auto ) the lower bounds for the gridGRID_MAX=3.14,3.14compulsory keyword ( default=auto ) the upper bounds for the gridGRID_BIN=200,200the number of bins for the gridBANDWIDTH=0.05,0.05 ... DUMPGRIDthe bandwidths for kernel density esimtationGRID=hhthe grid you would like to print (can also use ARG for specifying what is being printed)FILE=histocompulsory keyword ( default=density ) the file on which to write the grid.
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.
r1: TORSIONATOMS=1,2,3,4 r2: TORSIONthe four atoms involved in the torsional angleATOMS=2,3,4,5 hh: HISTOGRAM ...the four atoms involved in the torsional angleARG=r1,r2the quantities that are being used to construct the histogramKERNEL=DISCRETEcompulsory keyword ( default=GAUSSIAN ) the kernel function you are using.GRID_MIN=-3.14,-3.14compulsory keyword ( default=auto ) the lower bounds for the gridGRID_MAX=3.14,3.14compulsory keyword ( default=auto ) the upper bounds for the gridGRID_BIN=200,200 ... DUMPGRIDthe number of bins for the gridGRID=hhthe grid you would like to print (can also use ARG for specifying what is being printed)FILE=histocompulsory keyword ( default=density ) the file on which to write the grid.
The following input monitors two torsional angles during a simulation and outputs the histogram accumulated thus far every 100000 steps.
r1: TORSIONATOMS=1,2,3,4 r2: TORSIONthe four atoms involved in the torsional angleATOMS=2,3,4,5 hh: HISTOGRAM ...the four atoms involved in the torsional angleARG=r1,r2the quantities that are being used to construct the histogramGRID_MIN=-3.14,-3.14compulsory keyword ( default=auto ) the lower bounds for the gridGRID_MAX=3.14,3.14compulsory keyword ( default=auto ) the upper bounds for the gridGRID_BIN=200,200the number of bins for the gridBANDWIDTH=0.05,0.05 ... DUMPGRIDthe bandwidths for kernel density esimtationGRID=hhthe grid you would like to print (can also use ARG for specifying what is being printed)FILE=histocompulsory keyword ( default=density ) the file on which to write the grid.STRIDE=100000compulsory keyword ( default=0 ) the frequency with which the grid should be output to the file.
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.
r1: TORSIONATOMS=1,2,3,4 r2: TORSIONthe four atoms involved in the torsional angleATOMS=2,3,4,5 hh: HISTOGRAM ...the four atoms involved in the torsional angleARG=r1,r2the quantities that are being used to construct the histogramCLEAR=100000compulsory keyword ( default=0 ) the frequency with whihc to clear the data that is being averagedGRID_MIN=-3.14,-3.14compulsory keyword ( default=auto ) the lower bounds for the gridGRID_MAX=3.14,3.14compulsory keyword ( default=auto ) the upper bounds for the gridGRID_BIN=200,200the number of bins for the gridBANDWIDTH=0.05,0.05 ... DUMPGRIDthe bandwidths for kernel density esimtationGRID=hhthe grid you would like to print (can also use ARG for specifying what is being printed)FILE=histocompulsory keyword ( default=density ) the file on which to write the grid.STRIDE=100000compulsory keyword ( default=0 ) the frequency with which the grid should be output to the file.
ARG | the label for the grid that you would like to output |
STRIDE | ( default=0 ) the frequency with which the grid should be output to the file. Default of zero means dump at end of calculation |
FILE | ( default=density ) the file on which to write the grid. |
PRINT_XYZ | ( default=off ) output coordinates on fibonacci grid to xyz file |
PRINT_ONE_FILE | ( default=off ) output grids one after the other in a single file |
GRID | the grid you would like to print (can also use ARG for specifying what is being printed) |
FMT | the format that should be used to output real numbers |