Action: DUMPFORCES
| Module | generic |
|---|---|
| Description | Usage |
| Dump the force acting on one of a values in a file. | |
| This action outputs data to a file. You can read more about how PLUMED manages output files here |
Details and examples
Dump the force acting on one of a values in a file.
Consider the following PLUMED input:
r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100
This input will ultimately apply forces on the , and components of two atoms as well as the 9 cell vectors. The force on the th of these 15 quantities is given by:
where is the , or component of the position of one of the two atoms or one of the cell vectors. If we modify the input above by adding the DUMPFORCES command as shown below:
r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100 DUMPFORCESDump the force acting on one of a values in a file. More details ARGthe labels of the values whose forces should be output=r FILEthe name of the file on which to output the forces=forces STRIDE the frequency with which the forces should be output=5 FMT the format with which the derivatives should be output=%10.5f
we can then monitor the value of in the output file
forces. As explained by the equation above to get the forces on the atom this 'input force' needs to
be multiplied by . To view the various components of the
you would use the DUMPDERIVATIVES command. To control the buffering of output you use the
FLUSH command.
DUMPFORCES and RESTART
If you run a calculation with the following input:
r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100 DUMPFORCESDump the force acting on one of a values in a file. More details ARGthe labels of the values whose forces should be output=r FILEthe name of the file on which to output the forces=forces
and a file called forces is already present in the directory where the calculation is running, the existing file is backed up
and renamed to bck.0.forces so that new data can be output to a new file called forces. If you would like to append to the
existing file you can use the RESTART command as shown below:
r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100 DUMPFORCESDump the force acting on one of a values in a file. More details ARGthe labels of the values whose forces should be output=r FILEthe name of the file on which to output the forces=forces RESTARTallows per-action setting of restart (YES/NO/AUTO)=YES
You can achieve the same result by using the RESTART action as shown below:
RESTARTActivate restart. More details r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100 DUMPFORCESDump the force acting on one of a values in a file. More details ARGthe labels of the values whose forces should be output=r FILEthe name of the file on which to output the forces=forces
However, the advantage of using the RESTART keyword is that you can apped to some files and back up others. If you use the RESTART action instead data will be appended to all output files.
Switching printing on and off
You can use the UPDATE_FROM and UPDATE_UNTIL flags to make the DUMPFORCES command only output data at certain points during the trajectory. To see how this works consider the following example:
r: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 V: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=r ATthe position of the restraint=0.2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100 DUMPFORCESDump the force acting on one of a values in a file. More details ... ARGthe labels of the values whose forces should be output=r FILEthe name of the file on which to output the forces=forces UPDATE_FROMOnly update this action from this time=100 UPDATE_UNTILOnly update this action until this time=500 STRIDE the frequency with which the forces should be output=1 ...
During the first 100 ps of the simulation with this input the force is not output to the file called forces. The force is instead first output after the first 100 ps of trajectory have elapsed. Furthermore, output of the force stops once the trajectory is longer than 500 ps. In other words, the force is only output during the 400 ps time interval after the first 100 ps of the simulation.
Input
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 | scalar/vector/matrix/grid | the labels of the values whose forces should be output |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ARG | input | none | the labels of the values whose forces should be output |
| STRIDE | compulsory | 1 | the frequency with which the forces should be output |
| FILE | compulsory | none | the name of the file on which to output the forces |
| FMT | compulsory | %15.10f | the format with which the derivatives should be output |
| RESTART | optional | not used | allows per-action setting of restart (YES/NO/AUTO) |
| UPDATE_FROM | optional | not used | Only update this action from this time |
| UPDATE_UNTIL | optional | not used | Only update this action until this time |