# RPMDMonteCarloBarostat¶

class OpenMM::RPMDMonteCarloBarostat

This class is very similar to MonteCarloBarostat, but it is specifically designed for use with RPMDIntegrator. For each trial move, it scales all copies of the system by the same amount, then accepts or rejects the move based on the change to the total energy of the ring polymer (as returned by the integrator’s getTotalEnergy() method).

Methods

 RPMDMonteCarloBarostat() Create a MonteCarloBarostat. getDefaultPressure() Get the default pressure acting on the system (in bar). setDefaultPressure() Set the default pressure acting on the system. getFrequency() Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. setFrequency() Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. getRandomNumberSeed() Get the random number seed. setRandomNumberSeed() Set the random number seed. usesPeriodicBoundaryConditions() Returns whether or not this force makes use of periodic boundary conditions.
const std::string &Pressure()

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

RPMDMonteCarloBarostat(double defaultPressure, int frequency = 25)

Create a MonteCarloBarostat.

• defaultPressure – the default pressure acting on the system (in bar)
• frequency – the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
double getDefaultPressure() const

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

Returns: the default pressure acting on the system, measured in bar.
void setDefaultPressure(double pressure)

Set the default pressure acting on the system. This will affect any new Contexts you create, but not ones that already exist.

• pressure – the default pressure acting on the system, measured in bar.
int getFrequency() const

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.

void setFrequency(int freq)

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.

int getRandomNumberSeed() const

Get the random number seed. See setRandomNumberSeed() for details.

void setRandomNumberSeed(int seed)

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.

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.

bool usesPeriodicBoundaryConditions() const

Returns whether or not this force makes use of periodic boundary conditions.

Returns: true if force uses PBC and false otherwise