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
5.683947 5.681868 0.002079000000000164 100.0
5.682743 5.674456 0.008287000000000155 100.0
5.680166 5.661606 0.01855999999999991 100.0
5.676354 5.643549 0.03280499999999975 100.0
5.671285 5.622423 0.05089599999999983 96.0036152153409
5.665068 5.596418 0.07268199999999947 94.4525467103277
5.657502 5.567502 0.09797999999999973 91.85548071034916
5.649101 5.534336 0.12658799999999992 90.66025215660277
5.639401 5.49667 0.15826800000000052 90.18310713473345
5.628792 5.457041 0.19277299999999986 89.09494586897524
5.617623 5.414064 0.2298429999999998 88.56436785109855
5.605162 5.367292 0.26915699999999987 88.3759292903399
5.59127 5.31871 0.3103869999999995 87.81295608385656
5.575997 5.266791 0.35319400000000023 87.54565479594794
5.559915 5.212385 0.39726399999999984 87.48086914495148
5.543135 5.155911 0.4422510000000006 87.55751824190338
5.525593 5.09764 0.48778699999999997 87.73358043572289
5.507604 5.039841 0.5335339999999995 87.67257569339539
5.488983 4.980987 0.5791060000000003 87.72072815684866
5.469354 4.921074 0.6240860000000001 87.85327663174625