Package ffx.openmm
Class MonteCarloFlexibleBarostat
java.lang.Object
ffx.openmm.Force
ffx.openmm.MonteCarloFlexibleBarostat
This class uses a Monte Carlo algorithm to adjust the size of the periodic box,
simulating the effect of constant pressure. It assumes the simulation is running
at constant temperature, and the box size is adjusted to maintain constant pressure.
Unlike MonteCarloBarostat, this version allows flexible scaling of molecules,
making it suitable for systems where molecular flexibility is important.
This class is most useful for simulating a system at constant pressure when flexible molecular scaling is desired, such as for systems with significant intramolecular flexibility or conformational changes.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMonteCarloFlexibleBarostat
(double defaultPressure, double defaultTemperature, int frequency, int scaleMoleculesAsRigid) Create a MonteCarloFlexibleBarostat. -
Method Summary
Modifier and TypeMethodDescriptionvoid
computeCurrentPressure
(Context context, com.sun.jna.ptr.PointerByReference pressure) Compute the current pressure in the system.void
destroy()
Destroy the force.double
Get the default pressure (in bar).double
Get the default temperature at which the system is being maintained (in Kelvin).int
Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.int
Get the random number seed.int
Get whether molecules are scaled as rigid bodies.void
setDefaultPressure
(double pressure) Set the default pressure acting on the system (in bar).void
setDefaultTemperature
(double temperature) Set the default temperature at which the system is being maintained (in Kelvin).void
setFrequency
(int frequency) Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.void
setRandomNumberSeed
(int seed) Set the random number seed.void
setScaleMoleculesAsRigid
(int scaleMoleculesAsRigid) Set whether molecules should be scaled as rigid bodies.boolean
Returns whether this force makes use of periodic boundary conditions.Methods inherited from class ffx.openmm.Force
getForceGroup, getForceIndex, getName, getPointer, setForceGroup, setForceIndex, setName
-
Constructor Details
-
MonteCarloFlexibleBarostat
public MonteCarloFlexibleBarostat(double defaultPressure, double defaultTemperature, int frequency, int scaleMoleculesAsRigid) Create a MonteCarloFlexibleBarostat.- Parameters:
defaultPressure
- The default pressure acting on the system (in bar).defaultTemperature
- 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).scaleMoleculesAsRigid
- Whether to scale molecules as rigid bodies (1) or allow flexible scaling (0).
-
-
Method Details
-
computeCurrentPressure
Compute the current pressure in the system.- Parameters:
context
- The context for which to compute the pressure.pressure
- The computed pressure (output).
-
destroy
public void destroy()Destroy the force. -
getDefaultPressure
public double getDefaultPressure()Get the default pressure (in bar).- Returns:
- The default pressure acting on the system.
-
getDefaultTemperature
public double getDefaultTemperature()Get the default temperature at which the system is being maintained (in Kelvin).- Returns:
- The default temperature.
-
getFrequency
public int getFrequency()Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.- Returns:
- The frequency of pressure change attempts.
-
getRandomNumberSeed
public int getRandomNumberSeed()Get the random number seed. See setRandomNumberSeed() for details.- Returns:
- The random number seed.
-
getScaleMoleculesAsRigid
public int getScaleMoleculesAsRigid()Get whether molecules are scaled as rigid bodies.- Returns:
- 1 if molecules are scaled as rigid bodies, 0 if flexible scaling is used.
-
setDefaultPressure
public void setDefaultPressure(double pressure) Set the default pressure acting on the system (in bar).- Parameters:
pressure
- The default pressure acting on the system.
-
setDefaultTemperature
public void setDefaultTemperature(double temperature) Set the default temperature at which the system is being maintained (in Kelvin).- Parameters:
temperature
- The default temperature.
-
setFrequency
public void setFrequency(int frequency) Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.- Parameters:
frequency
- The frequency of pressure change attempts.
-
setRandomNumberSeed
public void setRandomNumberSeed(int seed) Set the random number seed. The precise meaning of this parameter is undefined, and is left up to each Platform to interpret in an appropriate way. It is guaranteed that if two simulations are run with different random number seeds, the sequence of random numbers will be different. On the other hand, no guarantees are made about the behavior of simulations that use the same seed. In particular, Platforms are permitted to use non-deterministic algorithms which produce different results on successive runs, even if those runs were initialized identically.If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context is created from this Force. This is done to ensure that each Context receives unique random seeds without you needing to set them explicitly.
- Parameters:
seed
- The random number seed.
-
setScaleMoleculesAsRigid
public void setScaleMoleculesAsRigid(int scaleMoleculesAsRigid) Set whether molecules should be scaled as rigid bodies.- Parameters:
scaleMoleculesAsRigid
- 1 to scale molecules as rigid bodies, 0 for flexible scaling.
-
usesPeriodicBoundaryConditions
public boolean usesPeriodicBoundaryConditions()Returns whether this force makes use of periodic boundary conditions.- Overrides:
usesPeriodicBoundaryConditions
in classForce
- Returns:
- True if the force uses periodic boundary conditions.
-