OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
MonteCarloAnisotropicBarostat Class Reference

This class uses a Monte Carlo algorithm to adjust the size of the periodic box, simulating the effect of constant pressure. More...

#include <MonteCarloAnisotropicBarostat.h>

+ Inheritance diagram for MonteCarloAnisotropicBarostat:

Public Member Functions

 MonteCarloAnisotropicBarostat (const Vec3 &defaultPressure, double temperature, bool scaleX=true, bool scaleY=true, bool scaleZ=true, int frequency=25)
 Create a MonteCarloAnisotropicBarostat. More...
 
const Vec3getDefaultPressure () const
 Get the default pressure (in bar). More...
 
void setDefaultPressure (const Vec3 &pressure)
 Set the default pressure acting on the system. More...
 
bool getScaleX () const
 Get whether to allow the X dimension of the periodic box to change size. More...
 
bool getScaleY () const
 Get whether to allow the Y dimension of the periodic box to change size. More...
 
bool getScaleZ () const
 Get whether to allow the Z dimension of the periodic box to change size. More...
 
int getFrequency () const
 Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. More...
 
void setFrequency (int freq)
 Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. More...
 
double getTemperature () const
 Get the temperature at which the system is being maintained, measured in Kelvin. More...
 
void setTemperature (double temp)
 Set the temperature at which the system is being maintained. More...
 
int getRandomNumberSeed () const
 Get the random number seed. More...
 
void setRandomNumberSeed (int seed)
 Set the random number seed. More...
 
- Public Member Functions inherited from Force
 Force ()
 
virtual ~Force ()
 
int getForceGroup () const
 Get the force group this Force belongs to. More...
 
void setForceGroup (int group)
 Set the force group this Force belongs to. More...
 

Static Public Member Functions

static const std::string & PressureX ()
 This is the name of the parameter which stores the current pressure acting on the X-axis (in bar). More...
 
static const std::string & PressureY ()
 This is the name of the parameter which stores the current pressure acting on the Y-axis (in bar). More...
 
static const std::string & PressureZ ()
 This is the name of the parameter which stores the current pressure acting on the Z-axis (in bar). More...
 

Protected Member Functions

ForceImplcreateImpl () const
 When a Context is created, it invokes this method on each Force in the System. More...
 
- Protected Member Functions inherited from Force
ForceImplgetImplInContext (Context &context)
 Get the ForceImpl corresponding to this Force in a Context. More...
 
ContextImplgetContextImpl (Context &context)
 Get the ContextImpl corresponding to a Context. More...
 

Detailed Description

This class uses a Monte Carlo algorithm to adjust the size of the periodic box, simulating the effect of constant pressure.

This class is similar to MonteCarloBarostat, but each Monte Carlo move is applied to only one axis of the periodic box (unlike MonteCarloBarostat, which scales the entire box isotropically). This means that the box may change shape as well as size over the course of the simulation. It also allows you to specify a different pressure for each axis of the box, or to keep the box size fixed along certain axes while still allowing it to change along others.

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.

Constructor & Destructor Documentation

MonteCarloAnisotropicBarostat ( const Vec3 defaultPressure,
double  temperature,
bool  scaleX = true,
bool  scaleY = true,
bool  scaleZ = true,
int  frequency = 25 
)

Create a MonteCarloAnisotropicBarostat.

Parameters
defaultPressureThe default pressure acting on each axis (in bar)
temperaturethe temperature at which the system is being maintained (in Kelvin)
scaleXwhether to allow the X dimension of the periodic box to change size
scaleYwhether to allow the Y dimension of the periodic box to change size
scaleZwhether to allow the Z dimension of the periodic box to change size
frequencythe frequency at which Monte Carlo pressure changes should be attempted (in time steps)

Member Function Documentation

ForceImpl* createImpl ( ) const
protectedvirtual

When a Context is created, it invokes this method on each Force in the System.

It should create a new ForceImpl object which can be used by the context for calculating forces. The ForceImpl will be deleted automatically when the Context is deleted.

Implements Force.

const Vec3& getDefaultPressure ( ) const
inline

Get the default pressure (in bar).

Returns
the default pressure acting along each axis, measured in bar.
int getFrequency ( ) const
inline

Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.

If this is set to 0, the barostat is disabled.

int getRandomNumberSeed ( ) const
inline

Get the random number seed.

See setRandomNumberSeed() for details.

bool getScaleX ( ) const
inline

Get whether to allow the X dimension of the periodic box to change size.

bool getScaleY ( ) const
inline

Get whether to allow the Y dimension of the periodic box to change size.

bool getScaleZ ( ) const
inline

Get whether to allow the Z dimension of the periodic box to change size.

double getTemperature ( ) const
inline

Get the temperature at which the system is being maintained, measured in Kelvin.

static const std::string& PressureX ( )
inlinestatic

This is the name of the parameter which stores the current pressure acting on the X-axis (in bar).

static const std::string& PressureY ( )
inlinestatic

This is the name of the parameter which stores the current pressure acting on the Y-axis (in bar).

static const std::string& PressureZ ( )
inlinestatic

This is the name of the parameter which stores the current pressure acting on the Z-axis (in bar).

void setDefaultPressure ( const Vec3 pressure)
inline

Set the default pressure acting on the system.

This will affect any new Contexts you create, but not ones that already exist.

Parameters
pressurethe default pressure acting on the system, measured in bar.
void setFrequency ( int  freq)
inline

Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.

If this is set to 0, the barostat is disabled.

void setRandomNumberSeed ( int  seed)
inline

Set the random number seed.

It is guaranteed that if two simulations are run with different random number seeds, the sequence of Monte Carlo steps 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.

void setTemperature ( double  temp)
inline

Set the temperature at which the system is being maintained.

Parameters
tempthe system temperature, measured in Kelvin.

The documentation for this class was generated from the following file: