This is part of the gridtools module |
Evaluate the average value of a multicolvar on a grid.
This keyword allows one to construct a phase field representation for a symmetry function from an atomistic description. If each atom has an associated order parameter, \(\phi_i\) then a smooth phase field function \(\phi(r)\) can be computed using:
\[ \phi(\mathbf{r}) = \frac{\sum_i K(\mathbf{r}-\mathbf{r}_i) \phi_i }{ \sum_i K(\mathbf{r} - \mathbf{r}_i )} \]
where \(\mathbf{r}_i\) is the position of atom \(i\), the sums run over all the atoms input and \(K(\mathbf{r} - \mathbf{r}_i)\) is one of the kernelfunctions implemented in plumed. This action calculates the above function on a grid, which can then be used in the input to further actions.
The following example shows perhaps the simplest way in which this action can be used. The following input computes the density of atoms at each point on the grid and outputs this quantity to a file. In other words this input instructs plumed to calculate \(\rho(\mathbf{r}) = \sum_i K(\mathbf{r} - \mathbf{r}_i )\)
dens: DENSITYSPECIES=1-100 grid: MULTICOLVARDENScompulsory keyword the atoms in the groupDATA=densthe multicolvar which you would like to calculate the density profile forORIGIN=1compulsory keyword we will use the position of this atom as the originDIR=xyzcompulsory keyword the direction in which to calculate the density profileNBINS=100,100,100the number of bins to use in each direction (alternative to GRID_NBIN)BANDWIDTH=0.05,0.05,0.05the bandwidths for kernel density esimtationSTRIDE=1 DUMPGRIDcompulsory keyword ( default=1 ) the frequency with which to accumulate the densitiesGRID=gridthe grid you would like to print (can also use ARG for specifying what is being printed)STRIDE=500compulsory keyword ( default=0 ) the frequency with which the grid should be output to the file.FILE=densitycompulsory keyword ( default=density ) the file on which to write the grid.
In the above example density is added to the grid on every step. The PRINT_GRID instruction thus tells PLUMED to output the average density at each point on the grid every 500 steps of simulation. Notice that the that grid output on step 1000 is an average over all 1000 frames of the trajectory. If you would like to analyze these two blocks of data separately you must use the CLEAR flag.
This second example computes an order parameter (in this case FCCUBIC) and constructs a phase field model for this order parameter using the equation above.