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 input for this action is the scalar output from one or more other actionsFILE=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 arguments on which the bias is actingSLOPE=-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 input for this action is the scalar output from one or more other actionsFILE=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 |
---|---|---|---|
20.506401 | 20.506401 | 0.0 | 0.0 |
20.506472 | 20.506472 | 3.999999997006398e-06 | 0.0 |
20.506682 | 20.506682 | 1.3000000002705292e-05 | 0.0 |
20.507027 | 20.507027 | 2.9000000001389026e-05 | 0.0 |
20.507498 | 20.507498 | 5.199999999661031e-05 | 0.0 |
20.508083 | 20.508083 | 8.099999999799934e-05 | 0.0 |
20.508766 | 20.508766 | 0.00011700000000303135 | 0.0 |
20.509528 | 20.509528 | 0.00015900000000002024 | 0.0 |
20.510349 | 20.510349 | 0.00020700000000317686 | 0.0 |
20.511207 | 20.511207 | 0.00026199999999931833 | 0.0 |
20.512078 | 20.512078 | 0.0003239999999991028 | 0.0 |
20.512937 | 20.512937 | 0.0003910000000004743 | 0.0 |
20.513761 | 20.513761 | 0.0004649999999983834 | 0.0 |
20.514526 | 20.514526 | 0.0005459999999999354 | 0.0 |
20.515209 | 20.515209 | 0.0006329999999969971 | 0.0 |
20.515789 | 20.515789 | 0.0007260000000002265 | 0.0 |
20.516248 | 20.516248 | 0.0008270000000010214 | 0.0 |
20.516568 | 20.516568 | 0.0009329999999998506 | 0.0 |
20.516736 | 20.516736 | 0.001045000000001295 | 0.0 |
20.516741 | 20.516741 | 0.0011639999999992767 | 0.0 |