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:

Click on the labels of the actions for more information on what each action computes
tested on2.9
tested onmaster
v: 
VOLUME
Calculate the volume of the simulation box. More details
PRINT
Print quantities to a file. More details
ARG
the input for this action is the scalar output from one or more other actions
=v
FILE
the name of the file on which to output these quantities
=volume

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:

Click on the labels of the actions for more information on what each action computes
tested on2.9
tested onmaster
v: 
VOLUME
Calculate the volume of the simulation box. More details
# slope should be just 10 times the Avogadro constant:
RESTRAINT
Adds harmonic and/or linear restraints on one or more variables. More details
AT
the position of the restraint
=0.0
ARG
the arguments on which the bias is acting
=v
SLOPE
specifies that the restraint is linear and what the values of the force constants on each of the variables are
=-60.2214129
PRINT
Print quantities to a file. More details
ARG
the input for this action is the scalar output from one or more other actions
=v
FILE
the name of the file on which to output these quantities
=volume2

The time series for the volumes that are output by the files volume and volume2 above should thus be close to identical.

Trajectories

  1. Input and output files for the unpeturbed calculation are available in this zip archive
  2. Input and output files for the peturbed calculation are available in this zip archive

  3. 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:

  1. The time series for the volume that was obtained from the simulation in that was performed at 1 bar, $x_{md}$.
  2. 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}$.
  3. 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.
  4. 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