OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MonteCarloBarostat.h
1 #ifndef OPENMM_MONTECARLOBAROSTAT_H_
2 #define OPENMM_MONTECARLOBAROSTAT_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * OpenMM *
6  * -------------------------------------------------------------------------- *
7  * This is part of the OpenMM molecular simulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org. *
11  * *
12  * Portions copyright (c) 2010 Stanford University and the Authors. *
13  * Authors: Peter Eastman *
14  * Contributors: *
15  * *
16  * Permission is hereby granted, free of charge, to any person obtaining a *
17  * copy of this software and associated documentation files (the "Software"), *
18  * to deal in the Software without restriction, including without limitation *
19  * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
20  * and/or sell copies of the Software, and to permit persons to whom the *
21  * Software is furnished to do so, subject to the following conditions: *
22  * *
23  * The above copyright notice and this permission notice shall be included in *
24  * all copies or substantial portions of the Software. *
25  * *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
27  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
28  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
29  * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
30  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
31  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
32  * USE OR OTHER DEALINGS IN THE SOFTWARE. *
33  * -------------------------------------------------------------------------- */
34 
35 #include "Force.h"
36 #include <string>
37 #include "internal/windowsExport.h"
38 
39 namespace OpenMM {
40 
51 class OPENMM_EXPORT MonteCarloBarostat : public Force {
52 public:
57  static const std::string& Pressure() {
58  static const std::string key = "MonteCarloPressure";
59  return key;
60  }
68  MonteCarloBarostat(double defaultPressure, double temperature, int frequency = 25);
74  double getDefaultPressure() const {
75  return defaultPressure;
76  }
83  void setDefaultPressure(double pressure) {
84  defaultPressure = pressure;
85  }
90  int getFrequency() const {
91  return frequency;
92  }
97  void setFrequency(int freq) {
98  frequency = freq;
99  }
103  double getTemperature() const {
104  return temperature;
105  }
111  void setTemperature(double temp) {
112  temperature = temp;
113  }
117  int getRandomNumberSeed() const {
118  return randomNumberSeed;
119  }
131  void setRandomNumberSeed(int seed) {
132  randomNumberSeed = seed;
133  }
141  return true;
142  }
143 protected:
144  ForceImpl* createImpl() const;
145 private:
146  double defaultPressure, temperature;
147  int frequency, randomNumberSeed;
148 };
149 
150 } // namespace OpenMM
151 
152 #endif /*OPENMM_MONTECARLOBAROSTAT_H_*/
void setRandomNumberSeed(int seed)
Set the random number seed.
Definition: MonteCarloBarostat.h:131
void setFrequency(int freq)
Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted...
Definition: MonteCarloBarostat.h:97
double getTemperature() const
Get the temperature at which the system is being maintained, measured in Kelvin.
Definition: MonteCarloBarostat.h:103
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
void setDefaultPressure(double pressure)
Set the default pressure acting on the system.
Definition: MonteCarloBarostat.h:83
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: MonteCarloBarostat.h:140
static const std::string & Pressure()
This is the name of the parameter which stores the current pressure acting on the system (in bar)...
Definition: MonteCarloBarostat.h:57
double getDefaultPressure() const
Get the default pressure acting on the system (in bar).
Definition: MonteCarloBarostat.h:74
void setTemperature(double temp)
Set the temperature at which the system is being maintained.
Definition: MonteCarloBarostat.h:111
int getRandomNumberSeed() const
Get the random number seed.
Definition: MonteCarloBarostat.h:117
int getFrequency() const
Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted...
Definition: MonteCarloBarostat.h:90
This class uses a Monte Carlo algorithm to adjust the size of the periodic box, simulating the effect...
Definition: MonteCarloBarostat.h:51
Definition: AndersenThermostat.h:40