Class MonteCarloBarostat
This class assumes the simulation is also being run at constant temperature, and requires you to specify the system temperature (since it affects the acceptance probability for Monte Carlo moves). It does not actually perform temperature regulation, however. You must use another mechanism along with it to maintain the temperature, such as LangevinIntegrator or AndersenThermostat.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMonteCarloBarostat
(double pressure, double temperature, int frequency) Create a MonteCarloBarostat. -
Method Summary
Modifier and TypeMethodDescriptiondouble
computeCurrentPressure
(Context context) Compute the instantaneous pressure of a system to which this barostat is applied.void
destroy()
Destroy the force.double
Get the default pressure acting on the system (in bar).double
Get the default temperature at which the system is being maintained, measured in Kelvin.int
Get the frequency.int
Get the random number seed.void
setDefaultPressure
(double pressure) Set the default pressure acting on the system.void
setDefaultTemperature
(double temperature) Set the default temperature at which the system is being maintained.void
setFrequency
(int frequency) Set the frequency.void
setRandomNumberSeed
(int seed) Set the random number seed.boolean
Does the force use periodic boundary conditions?Methods inherited from class ffx.openmm.Force
getForceGroup, getForceIndex, getName, getPointer, setForceGroup, setForceIndex, setName
-
Constructor Details
-
MonteCarloBarostat
public MonteCarloBarostat(double pressure, double temperature, int frequency) Create a MonteCarloBarostat.- Parameters:
pressure
- the default pressure acting on the system (in bar)temperature
- the default temperature at which the system is being maintained (in Kelvin)frequency
- the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
-
-
Method Details
-
computeCurrentPressure
Compute the instantaneous pressure of a system to which this barostat is applied.The pressure is computed from the molecular virial, using a finite difference to calculate the derivative of potential energy with respect to volume. For most systems in equilibrium, the time average of the instantaneous pressure should equal the pressure applied by the barostat. Fluctuations around the average value can be extremely large, however, and it may take a very long simulation to accurately compute the average.
- Parameters:
context
- the Context for which to compute the current pressure- Returns:
- the instantaneous pressure
-
destroy
public void destroy()Destroy the force. -
getDefaultPressure
public double getDefaultPressure()Get the default pressure acting on the system (in bar).- Returns:
- the default pressure acting on the system, measured in bar.
-
getDefaultTemperature
public double getDefaultTemperature()Get the default temperature at which the system is being maintained, measured in Kelvin.- Returns:
- the default temperature at which the system is being maintained, measured in Kelvin.
-
getFrequency
public int getFrequency()Get the frequency.- Returns:
- The frequency.
-
getRandomNumberSeed
public int getRandomNumberSeed()Get the random number seed.- Returns:
- The random number seed.
-
setDefaultPressure
public void setDefaultPressure(double pressure) Set the default pressure acting on the system. This will affect any new Contexts you create, but not ones that already exist.- Parameters:
pressure
- the default pressure acting on the system, measured in bar.
-
setDefaultTemperature
public void setDefaultTemperature(double temperature) Set the default temperature at which the system is being maintained. This will affect any new Contexts you create, but not ones that already exist.- Parameters:
temperature
- the system temperature, measured in Kelvin.
-
setFrequency
public void setFrequency(int frequency) Set the frequency.- Parameters:
frequency
- The frequency.
-
setRandomNumberSeed
public void setRandomNumberSeed(int seed) Set the random number seed.- Parameters:
seed
- The random number seed.
-
usesPeriodicBoundaryConditions
public boolean usesPeriodicBoundaryConditions()Does the force use periodic boundary conditions?- Overrides:
usesPeriodicBoundaryConditions
in classForce
- Returns:
- True if the force uses periodic boundary conditions.
-