Action: REFERENCE_GRID
| Module | gridtools |
|---|---|
| Description | Usage |
| Setup a constant grid by either reading values from a file or definining a function in input | |
| output value | type |
| the constant function on the grid that was specified in input | grid |
Details and examples
Setup a constant grid by either reading values from a file or definining a function in input
This action allows you to create a constant function and store the values that this function takes at a grid of points. There are two ways that you can create the constant function. You can either read in the value of the function at a set of grid points from a file as is done in this example input:
#SETTINGS INPUTFILES=regtest/gridtools/rt-test-fib-read/kde.grid ffg: REFERENCE_GRIDSetup a constant grid by either reading values from a file or definining a function in input More details FILEthe name of the file that contains the reference data=regtest/gridtools/rt-test-fib-read/kde.gridClick here to see an extract from this file.VALUEthe name of the value that should be read from the grid=h 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=ffg FILE the file on which to write the grid=output.grid
The input file in this case has the format for grids that is discussed in the documentation for DUMPGRID.
The second way you can create these constant functions is illustrated below.
d2: REFERENCE_GRIDSetup a constant grid by either reading values from a file or definining a function in input More details GRID_MIN the lower bounds for the grid=0 GRID_MAX the upper bounds for the grid=10 GRID_BINthe number of bins for the grid=20 FUNCthe function to compute on the grid=d1*d1 VARthe names to give each of the grid directions in the function=d1 PERIODICare the grid directions periodic=NO d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 ff: EVALUATE_FUNCTION_FROM_GRIDCalculate the function stored on the input grid at an arbitrary point More details GRIDthe name of the grid that we are using to evaluate the function=d2 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1,ff FMT the format that should be used to output real numbers=%8.4f FILEthe name of the file on which to output these quantities=colvar
This input illustrates a rather elaborate (and approximate) method for evaluating the square of the distance between atoms 1 and 2. As you can see, the option involves using the GRID_MIN, GRID_MAX and GRID_BIN options to create a grid of points. You can then use the FUNC option to specify the function that should be evaluated at each of those grid points. If you use this option the lepton library that is discussed in the documentation for CUSTOM is used to evaluate the function at the various grid points.
N.B. This method with lepton was implemented to facilitate the implementation of the normalisation in the implementation of the RDF shortcut.
Lastly note that you can specify the grid spacing in the input to this action rather than the number of bins as shown below:
d2: REFERENCE_GRIDSetup a constant grid by either reading values from a file or definining a function in input More details GRID_MIN the lower bounds for the grid=0 GRID_MAX the upper bounds for the grid=10 GRID_SPACINGthe approximate grid spacing (to be used as an alternative or together with GRID_BIN)=0.5 FUNCthe function to compute on the grid=d1*d1 VARthe names to give each of the grid directions in the function=d1 PERIODICare the grid directions periodic=NO d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 ff: EVALUATE_FUNCTION_FROM_GRIDCalculate the function stored on the input grid at an arbitrary point More details GRIDthe name of the grid that we are using to evaluate the function=d2 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1,ff FMT the format that should be used to output real numbers=%8.4f FILEthe name of the file on which to output these quantities=colvar
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| GRID_MIN | compulsory | auto | the lower bounds for the grid |
| GRID_MAX | compulsory | auto | the upper bounds for the grid |
| PERIODIC | compulsory | none | are the grid directions periodic |
| FILE | compulsory | none | the name of the file that contains the reference data |
| VALUE | compulsory | none | the name of the value that should be read from the grid |
| FUNC | optional | not used | the function to compute on the grid |
| GRID_BIN | optional | not used | the number of bins for the grid |
| GRID_SPACING | optional | not used | the approximate grid spacing (to be used as an alternative or together with GRID_BIN) |
| VAR | optional | not used | the names to give each of the grid directions in the function |