AndersenThermostat

class AndersenThermostat : public OpenMM::Force

This class uses the Andersen method to maintain constant temperature.

Public Functions

AndersenThermostat(double defaultTemperature, double defaultCollisionFrequency)

Create an AndersenThermostat.

Parameters
  • defaultTemperature – the default temperature of the heat bath (in Kelvin)

  • defaultCollisionFrequency – the default collision frequency (in 1/ps)

inline double getDefaultTemperature() const

Get the default temperature of the heat bath (in Kelvin).

Returns

the default temperature of the heat bath, measured in Kelvin.

inline void setDefaultTemperature(double temperature)

Set the default temperature of the heat bath. This will affect any new Contexts you create, but not ones that already exist.

Parameters

temperature – the default temperature of the heat bath (in Kelvin)

inline double getDefaultCollisionFrequency() const

Get the default collision frequency (in 1/ps).

Returns

the default collision frequency, measured in 1/ps.

inline void setDefaultCollisionFrequency(double frequency)

Set the default collision frequency. This will affect any new Contexts you create, but not ones that already exist.

Parameters

frequency – the default collision frequency (in 1/ps)

inline int getRandomNumberSeed() const

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

inline 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 collisions 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.

inline virtual bool usesPeriodicBoundaryConditions() const

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

Returns

true if force uses PBC and false otherwise

Public Static Functions

static inline const std::string &Temperature()

This is the name of the parameter which stores the current temperature of the heat bath (in Kelvin).

static inline const std::string &CollisionFrequency()

This is the name of the parameter which store the current collision frequency (in 1/ps).