Output a three dimensional grid using the Gaussian cube file format.
Suppose you have calculated the value of a function on a three dimensional grid. This function might be a HISTOGRAM or it might be a free energy energy surface that was calculated from this histogram by using CONVERT_TO_FES. Alternatively, your function might be a phase-field that was calculated using MULTICOLVARDENS. Whatever the function is, however, you obviously cannot show it using a typical contour plotting program such as gnuplot as you have three input variables.
Tools like VMD have nice features for plotting these types of three dimensional functions but typically you are required to use a Gaussian cube file format to input the data. This action thus allows you to output a function evaluated on a grid to a Gaussian cube file format.
Examples
The input below can be used to post process a trajectory. A histogram as a function of the distance between atoms 1 and 2, the distance between atom 1 and 3 and the angle between the vector connecting atoms 1 and 2 and 1 and 3 is computed using kernel density estimation. Once all the data contained in the trajectory has been read in and all the kernels have been added the resulting histogram is output to a file called histoA1.cube. This file has the Gaussian cube file format. The histogram can thus be visualized using tools such as VMD.
Click on the labels of the actions for more information on what each action computes
x1: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,2 The DISTANCE action with label x1 calculates a single scalar valuex2: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,3 The DISTANCE action with label x2 calculates a single scalar valuex3: ANGLEATOMSthe list of atoms involved in this collective variable (either 3 or 4 atoms). =1,2,3 The ANGLE action with label x3 calculates a single scalar valuehA1: HISTOGRAMARGthe quantity that is being averaged =x1,x2,x3GRID_MINcompulsory keyword ( default=auto )
the lower bounds for the grid =0.0,0.0,0.0 GRID_MAXcompulsory keyword ( default=auto )
the upper bounds for the grid =3.0,3.0,3.0 GRID_BINthe number of bins for the grid =10,10,10 BANDWIDTHthe bandwidths for kernel density esimtation =1.0,1.0,1.0 The HISTOGRAM action with label hA1 calculates a single scalar valueDUMPCUBEGRIDthe grid you would like to print (can also use ARG for specifying what is being printed)
=hA1FILEcompulsory keyword ( default=density )
the file on which to write the grid. =histoA1.cube The DUMPCUBE action with label
x1: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,2 The DISTANCE action with label x1 calculates a single scalar valuex2: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,3 The DISTANCE action with label x2 calculates a single scalar valuex3: ANGLEATOMSthe list of atoms involved in this collective variable (either 3 or 4 atoms). =1,2,3 The ANGLE action with label x3 calculates a single scalar valuehA1_weight: ONESSIZEcompulsory keyword
the number of ones that you would like to create =1 The ONES action with label hA1_weight calculates a single scalar valuehA1_kde: KDEARGthe input for this action is the scalar output from one or more other actions. =x1,x2,x3GRID_MINcompulsory keyword ( default=auto )
the lower bounds for the grid =0.0,0.0,0.0 GRID_MAXcompulsory keyword ( default=auto )
the upper bounds for the grid =3.0,3.0,3.0 GRID_BINthe number of bins for the grid =10,10,10 BANDWIDTHthe bandwidths for kernel density esimtation =1.0,1.0,1.0 The KDE action with label hA1_kde calculates a single scalar valuehA1_kdep: CUSTOMARGthe input to this function. =hA1_kde,hA1_weightFUNCcompulsory keyword
the function you wish to evaluate =x*y PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label hA1_kdep calculates a single scalar valuehA1_u: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =hA1_kdepSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =0 The ACCUMULATE action with label hA1_u calculates a single scalar valuehA1_nsum: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =hA1_weightSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =0 The ACCUMULATE action with label hA1_nsum calculates a single scalar valuehA1: CUSTOMARGthe input to this function. =hA1_u,hA1_nsumFUNCcompulsory keyword
the function you wish to evaluate =x/y PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label hA1 calculates a single scalar valueDUMPCUBEGRIDthe grid you would like to print (can also use ARG for specifying what is being printed)
=hA1FILEcompulsory keyword ( default=density )
the file on which to write the grid. =histoA1.cube The DUMPCUBE action with label
Glossary of keywords and components
Compulsory keywords
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.
Options
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
ARG
the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or . appears the scalars calculated by all the proceeding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three components x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting Started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...
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