Check virial contribution
If you are running simulations at constant pressure then the virial forces cause the cell parameters to change with time. Any CVs calculated by PLUMED contribute to these virial forces and PLUMED must, therefore, have a mechanism to pass virial forces back to the MD code.
To debug this mechanism we run a constant pressure simulation at 1 bar using the MD code. During this simulation we use the following PLUMED input to monitor the cell volume:
v:VOLUMECalculate the volume of the simulation box. More detailsPrint quantities to a file. More detailsARG=vthe labels of the values that you would like to print to the fileFILE=volumethe name of the file on which to output these quantities
We then run a second constant pressure MD simulation at a pressure of 1001 bar and the input above.
If the virial has been implemented correctly within PLUMED the following PLUMED restraint will apply a negative pressure of 1000bar, which should compensate the fact that the second calculation was run at higher pressure. We thus run a third MD calculation with the following input file:
v:VOLUME# slope should be just 10 times the Avogadro constant:Calculate the volume of the simulation box. More detailsRESTRAINTAdds harmonic and/or linear restraints on one or more variables. More detailsAT=0.0the position of the restraintARG=vthe values the harmonic restraint acts uponSLOPE=-60.2214129specifies that the restraint is linear and what the values of the force constants on each of the variables arePrint quantities to a file. More detailsARG=vthe labels of the values that you would like to print to the fileFILE=volume2the name of the file on which to output these quantities
The time series for the volumes that are output by the files volume
and volume2
above should thus be close to identical.
Trajectories
- Input and output files for the unpeturbed calculation are available in this zip archive
-
Input and output files for the peturbed calculation are available in this zip archive
- Input and output files for the peturbed calculation in which a PLUMED restraint is used to undo the effect of the changed MD parameters are available in this zip archive
Results
The table below includes some of the results from the calculation. The columns contain:
- The time series for the volume that was obtained from the simulation in that was performed at 1 bar, $x_{md}$.
- The time series for the volume that was obtained from the simulation that was performed at 1001 bar and in which PLUMED applied a restraint on the volume, $x_{pl}$.
- The absolute value of the difference between the time series of volumes that were obtained from the simulations running at 1001 bar and 1 bar, $\vert x_{md}’-x_{md}\vert$. No PLUMED restraints were applied in either of these simulations.
- The values of $100\frac{\vert x_{md} - x_{pl}\vert }{ \vert x_{md}’-x_{md} \vert }$.
If the PLUMED interface is working correctly the first two sets of numbers should be identical and the final column should be filled with zeros.
Original result | Result with PLUMED | Effect of peturbation | % Difference |
---|---|---|---|
11.634586 | 11.634586 | 0.0 | 0.0 |
11.634586 | 11.634586 | 0.0 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |
11.647548 | 11.647548 | 0.05117599999999989 | 0.0 |