# MonteCarloBarostat 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 <MonteCarloBarostat.h>`

Inheritance diagram for MonteCarloBarostat:

List of all members.

## Public Member Functions

| MonteCarloBarostat (double defaultPressure, double temperature, int frequency=25)
| Create a MonteCarloBarostat.
double | getDefaultPressure () const
| Get the default pressure acting on the system (in bar).
void | setDefaultPressure (double pressure)
| Set the default pressure acting on the system.
int | getFrequency () const
| Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.
void | setFrequency (int freq)
| Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.
double | getTemperature () const
| Get the temperature at which the system is being maintained, measured in Kelvin.
void | setTemperature (double temp)
| Set the temperature at which the system is being maintained.
int | getRandomNumberSeed () const
| Get the random number seed.
void | setRandomNumberSeed (int seed)
| Set the random number seed.

## Static Public Member Functions

static const std::string & | Pressure ()
| This is the name of the parameter which stores the current pressure acting on the system (in bar).

## Protected Member Functions

ForceImpl * | createImpl () const
| When a Context is created, it invokes this method on each Force in the System.

## 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 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

MonteCarloBarostat | ( | double | defaultPressure,
|  | double | temperature,
|  | int | frequency = `25` |
| ) |  |  |

Create a MonteCarloBarostat.

Parameters:

  | defaultPressure | the default pressure acting on the system (in bar)
  | temperature | the 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)

## Member Function Documentation

ForceImpl* createImpl | ( |  | ) | const`[protected, virtual]`

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.

double getDefaultPressure | ( |  | ) | const`[inline]`

Get the default pressure acting on the system (in bar).

Returns:
  the default pressure acting on the system, 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.

double getTemperature | ( |  | ) | const`[inline]`

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

static const std::string& Pressure | ( |  | ) | `[inline, static]`

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

void setDefaultPressure | ( | double | 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:

  | pressure | the 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:

  | temp | the system temperature, measured in Kelvin.

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

- MonteCarloBarostat.h