Package ffx.openmm

Class MonteCarloAnisotropicBarostat

java.lang.Object
ffx.openmm.Force
ffx.openmm.MonteCarloAnisotropicBarostat

public class MonteCarloAnisotropicBarostat extends Force
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 independent scaling of the three box dimensions, making it suitable for anisotropic systems.

This class is most useful for simulating a system at constant pressure when anisotropic scaling is desired, such as for layered materials or systems with preferred orientations.

  • Constructor Details

    • MonteCarloAnisotropicBarostat

      public MonteCarloAnisotropicBarostat(edu.uiowa.jopenmm.OpenMM_Vec3 defaultPressure, double defaultTemperature, int scaleX, int scaleY, int scaleZ, int frequency)
      Create a MonteCarloAnisotropicBarostat.
      Parameters:
      defaultPressure - The default pressure acting on each axis (in bar).
      defaultTemperature - The default temperature at which the system is being maintained (in Kelvin).
      scaleX - Whether to scale the X dimension of the periodic box.
      scaleY - Whether to scale the Y dimension of the periodic box.
      scaleZ - Whether to scale the Z dimension of the periodic box.
      frequency - The frequency at which Monte Carlo pressure changes should be attempted (in time steps).
  • Method Details

    • destroy

      public void destroy()
      Destroy the force.
      Specified by:
      destroy in class Force
    • getDefaultPressure

      public edu.uiowa.jopenmm.OpenMM_Vec3 getDefaultPressure()
      Get the default pressure (in bar).
      Returns:
      The default pressure acting on each axis.
    • 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.
    • getScaleX

      public int getScaleX()
      Get whether to scale the X dimension of the periodic box.
      Returns:
      1 if the X dimension should be scaled, 0 otherwise.
    • getScaleY

      public int getScaleY()
      Get whether to scale the Y dimension of the periodic box.
      Returns:
      1 if the Y dimension should be scaled, 0 otherwise.
    • getScaleZ

      public int getScaleZ()
      Get whether to scale the Z dimension of the periodic box.
      Returns:
      1 if the Z dimension should be scaled, 0 otherwise.
    • setDefaultPressure

      public void setDefaultPressure(edu.uiowa.jopenmm.OpenMM_Vec3 pressure)
      Set the default pressure acting on each axis (in bar).
      Parameters:
      pressure - The default pressure acting on each axis.
    • 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.
    • usesPeriodicBoundaryConditions

      public boolean usesPeriodicBoundaryConditions()
      Returns whether this force makes use of periodic boundary conditions.
      Overrides:
      usesPeriodicBoundaryConditions in class Force
      Returns:
      True if the force uses periodic boundary conditions.