espressopp.integrator.LangevinBarostat¶
This is the barostat implementation to perform Langevin dynamics in a Hoover style extended system according to the paper [Quigley04]. It includes corrections of Hoover approach which were introduced by Martyna et al [Martyna94]. If LangevinBarostat is defined (as a property of integrator) the integration equations will be modified. The volume of system \(V\) is introduced as a dynamical variable:
where volume has a fictitious mass \(W\) and associated momentum \(p_{\epsilon}\), \(\gamma_{p}\) - friction coefficient, \(P_{ext}\) - external pressure and \(X\) - instantaneous pressure without white noise contribution from thermostat, \(n\) - dimension, \(N_{f}\) - degrees of freedom (if there are no constrains and \(N\) is the number of particles in system \(N_{f}=nN\)). \(R_{p}\) - values which are drawn from Gaussian distribution of zero mean and unit variance scaled by
!IMPORTANT Terms \(- \gamma\boldsymbol{p}_{i} + \boldsymbol{R}_{i}\) correspond to the termostat. They are not included here and will not be calculated if the Langevin Thermostat is not defined.
Example:
>>> rng = espressopp.esutil.RNG()
>>> langevinP = espressopp.integrator.LangevinBarostat(system, rng, desiredTemperature)
>>> langevinP.gammaP = 0.05
>>> langevinP.pressure = 1.0
>>> langevinP.mass = pow(10.0, 4)
>>> integrator.addExtension(langevinP)
!IMPORTANT This barostat is supposed to be run in a couple with thermostat in order to simulate the npt ensamble, because the term \(R_{p}\) needs the temperature as a parameter.
Definition:
Properties:
langevinP.gammaP
The property ‘gammaP’ defines the friction coefficient \(\gamma_{p}\).
langevinP.pressure
The property ‘pressure’ defines the external pressure \(P_{ext}\).
langevinP.mass
The property ‘mass’ defines the fictitious mass \(W\).
Methods:
setMassByFrequency( frequency )
Set the proper langevinP.mass using expression \(W=dNk_{b}T/\omega_{b}^{2}\), where frequency, \(\omega_{b}\), is the frequency of required volume fluctuations. The value of \(\omega_{b}\) should be less then the lowest frequency which appears in the NVT temperature spectrum [Quigley04] in order to match the canonical distribution. \(d\) - dimensions, \(N\) - number of particles, \(k_{b}\) - Boltzmann constant, \(T\) - desired temperature.
NOTE The langevinP.mass can be set both directly and using the (setMassByFrequency( frequency ))
Adding to the integration:
>>> integrator.addExtension(langevinP)It will define Langevin-Hoover barostat as a property of integrator.
One more example:
>>> rngBaro = espressopp.esutil.RNG()
>>> lP = espressopp.integrator.LangevinBarostat(system, rngBaro, desiredTemperature)
>>> lP.gammaP = .5
>>> lP.pressure = 1.0
>>> lP.mass = pow(10.0, 5)
>>> integrator.addExtension(lP)
Canceling the barostat:
If one do not need the pressure regulation in system anymore or need to switch the ensamble or whatever :)
>>> # define barostat with parameters >>> rngBaro = espressopp.esutil.RNG() >>> lP = espressopp.integrator.LangevinBarostat(system, rngBaro, desiredTemperature) >>> lP.gammaP = .5 >>> lP.pressure = 1.0 >>> lP.mass = pow(10.0, 5) >>> integrator.langevinBarostat = lP >>> ... >>> # some runs >>> ... >>> # disconnect barostat >>> langevinBarostat.disconnect() >>> # the next runs will not include the modification of integration equationsConnecting the barostat back after the disconnection
>>> langevinBarostat.connect()
References:
[Quigley04] | (1, 2)
|
[Martyna94] |
|
-
espressopp.integrator.
LangevinBarostat
(system, rng, temperature)¶ Parameters: - system –
- rng –
- temperature –