# MonteCarloMembraneBarostat Class Reference

This is a Monte Carlo barostat designed specifically for membrane simulations. More...

`#include <MonteCarloMembraneBarostat.h>`

Inheritance diagram for MonteCarloMembraneBarostat:

List of all members.

## Public Types
enum | XYMode { XYIsotropic = 0, XYAnisotropic = 1 }
| This is an enumeration of the different behaviors for the X and Y axes. More...
enum | ZMode { ZFree = 0, ZFixed = 1, ConstantVolume = 2 }
| This is an enumeration of the different behaviors for Z axis. More...
## Public Member Functions
| MonteCarloMembraneBarostat (double defaultPressure, double defaultSurfaceTension, double temperature, XYMode xymode, ZMode zmode, int frequency=25)
| Create a MonteCarloMembraneBarostat.
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.
double | getDefaultSurfaceTension () const
| Get the default surface tension acting on the system (in bar*nm).
void | setDefaultSurfaceTension (double surfaceTension)
| Set the default surface tension acting on the system.
int | getFrequency () const
| Get the frequency (in time steps) at which Monte Carlo volume changes should be attempted.
void | setFrequency (int freq)
| Set the frequency (in time steps) at which Monte Carlo volume 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.
XYMode | getXYMode () const
| Get the mode specifying the behavior of the X and Y axes.
void | setXYMode (XYMode mode)
| Set the mode specifying the behavior of the X and Y axes.
ZMode | getZMode () const
| Get the mode specifying the behavior of the Z axis.
void | setZMode (ZMode mode)
| Set the mode specifying the behavior of the Z axis.
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).
static const std::string & | SurfaceTension ()
| This is the name of the parameter which stores the current surface tension acting on the system (in bar*nm).
## Protected Member Functions
ForceImpl * | createImpl () const
| When a Context is created, it invokes this method on each Force in the System.

## Detailed Description

This is a Monte Carlo barostat designed specifically for membrane simulations.

It assumes the membrane lies in the XY plane. The Monte Carlo acceptance criterion includes a term to model isotropic pressure, which depends on the volume of the periodic box, and a second term to model surface tension, which depends on the cross sectional area of the box in the XY plane. Note that pressure and surface tension are defined with opposite senses: a larger pressure tends to make the box smaller, but a larger surface tension tends to make the box larger.

There are options for configuring exactly how the various box dimensions are allowed to change:

- The X and Y axes may be treated isotropically, in which case they always scale by the same amount and remain in proportion to each other; or they may be treated anisotropically, in which case they can vary independently of each other.
- The Z axis can be allowed to vary independently of the other axes; or held fixed; or constrained to vary in inverse proportion to the other two axes, so that the total box volume remains fixed.

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.

## Member Enumeration Documentation

enum XYMode

This is an enumeration of the different behaviors for the X and Y axes.

Enumerator:

  XYIsotropic | The X and Y axes are always scaled by the same amount, so the ratio of their lengths remains constant.
  XYAnisotropic | The X and Y axes are allowed to vary independently of each other.

enum ZMode

This is an enumeration of the different behaviors for Z axis.

Enumerator:

  ZFree | The Z axis is allowed to vary freely, independent of the other two axes.
  ZFixed | The Z axis is held fixed and does not change.
  ConstantVolume | The Z axis is always scaled in inverse proportion to the other two axes so the box volume remains fixed. Note that in this mode pressure has no effect on the system, only surface tension.

## Constructor & Destructor Documentation

MonteCarloMembraneBarostat | ( | double | defaultPressure,
|  | double | defaultSurfaceTension,
|  | double | temperature,
|  | XYMode | xymode,
|  | ZMode | zmode,
|  | int | frequency = `25` |
| ) |  |  |

Create a MonteCarloMembraneBarostat.

Parameters:

  | defaultPressure | the default pressure acting on the system (in bar)
  | defaultSurfaceTension | the default surface tension acting on the system (in bar*nm)
  | temperature | the temperature at which the system is being maintained (in Kelvin)
  | xymode | the mode specifying the behavior of the X and Y axes
  | zmode | the mode specifying the behavior of the Z axis
  | frequency | the frequency at which Monte Carlo volume 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.

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

Get the default surface tension acting on the system (in bar*nm).

Returns:
  the default surface tension acting on the system, measured in bar*nm.

int getFrequency | ( |  | ) | const`[inline]`

Get the frequency (in time steps) at which Monte Carlo volume 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.

XYMode getXYMode | ( |  | ) | const`[inline]`

Get the mode specifying the behavior of the X and Y axes.

ZMode getZMode | ( |  | ) | const`[inline]`

Get the mode specifying the behavior of the Z axis.

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 setDefaultSurfaceTension | ( | double | surfaceTension | ) | `[inline]`

Set the default surface tension acting on the system.

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

Parameters:

  | surfaceTension | the default surface tension acting on the system, measured in bar.

void setFrequency | ( | int | freq | ) | `[inline]`

Set the frequency (in time steps) at which Monte Carlo volume 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.

void setXYMode | ( | XYMode | mode | ) | `[inline]`

Set the mode specifying the behavior of the X and Y axes.

void setZMode | ( | ZMode | mode | ) | `[inline]`

Set the mode specifying the behavior of the Z axis.

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

This is the name of the parameter which stores the current surface tension acting on the system (in bar*nm).

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

- MonteCarloMembraneBarostat.h