OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MonteCarloMembraneBarostat.h
1 #ifndef OPENMM_MONTECARLOMEMBRANEBAROSTAT_H_
2 #define OPENMM_MONTECARLOMEMBRANEBAROSTAT_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-2014 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 
65 class OPENMM_EXPORT MonteCarloMembraneBarostat : public Force {
66 public:
70  enum XYMode {
74  XYIsotropic = 0,
78  XYAnisotropic = 1
79  };
83  enum ZMode {
87  ZFree = 0,
91  ZFixed = 1,
96  ConstantVolume = 2
97  };
102  static const std::string& Pressure() {
103  static const std::string key = "MembraneMonteCarloPressure";
104  return key;
105  }
110  static const std::string& SurfaceTension() {
111  static const std::string key = "MembraneMonteCarloSurfaceTension";
112  return key;
113  }
124  MonteCarloMembraneBarostat(double defaultPressure, double defaultSurfaceTension, double temperature, XYMode xymode, ZMode zmode, int frequency = 25);
130  double getDefaultPressure() const {
131  return defaultPressure;
132  }
139  void setDefaultPressure(double pressure) {
140  defaultPressure = pressure;
141  }
147  double getDefaultSurfaceTension() const {
148  return defaultSurfaceTension;
149  }
156  void setDefaultSurfaceTension(double surfaceTension) {
157  defaultSurfaceTension = surfaceTension;
158  }
163  int getFrequency() const {
164  return frequency;
165  }
170  void setFrequency(int freq) {
171  frequency = freq;
172  }
176  double getTemperature() const {
177  return temperature;
178  }
184  void setTemperature(double temp) {
185  temperature = temp;
186  }
190  XYMode getXYMode() const {
191  return xymode;
192  }
196  void setXYMode(XYMode mode) {
197  xymode = mode;
198  }
202  ZMode getZMode() const {
203  return zmode;
204  }
208  void setZMode(ZMode mode) {
209  zmode = mode;
210  }
214  int getRandomNumberSeed() const {
215  return randomNumberSeed;
216  }
228  void setRandomNumberSeed(int seed) {
229  randomNumberSeed = seed;
230  }
238  return true;
239  }
240 protected:
241  ForceImpl* createImpl() const;
242 private:
243  double defaultPressure, defaultSurfaceTension, temperature;
244  XYMode xymode;
245  ZMode zmode;
246  int frequency, randomNumberSeed;
247 };
248 
249 } // namespace OpenMM
250 
251 #endif /*OPENMM_MONTECARLOMEMBRANEBAROSTAT_H_*/
double getDefaultPressure() const
Get the default pressure acting on the system (in bar).
Definition: MonteCarloMembraneBarostat.h:130
This is a Monte Carlo barostat designed specifically for membrane simulations.
Definition: MonteCarloMembraneBarostat.h:65
void setZMode(ZMode mode)
Set the mode specifying the behavior of the Z axis.
Definition: MonteCarloMembraneBarostat.h:208
XYMode getXYMode() const
Get the mode specifying the behavior of the X and Y axes.
Definition: MonteCarloMembraneBarostat.h:190
XYMode
This is an enumeration of the different behaviors for the X and Y axes.
Definition: MonteCarloMembraneBarostat.h:70
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: MonteCarloMembraneBarostat.h:237
static const std::string & Pressure()
This is the name of the parameter which stores the current pressure acting on the system (in bar)...
Definition: MonteCarloMembraneBarostat.h:102
void setFrequency(int freq)
Set the frequency (in time steps) at which Monte Carlo volume changes should be attempted.
Definition: MonteCarloMembraneBarostat.h:170
void setDefaultSurfaceTension(double surfaceTension)
Set the default surface tension acting on the system.
Definition: MonteCarloMembraneBarostat.h:156
double getTemperature() const
Get the temperature at which the system is being maintained, measured in Kelvin.
Definition: MonteCarloMembraneBarostat.h:176
void setRandomNumberSeed(int seed)
Set the random number seed.
Definition: MonteCarloMembraneBarostat.h:228
int getRandomNumberSeed() const
Get the random number seed.
Definition: MonteCarloMembraneBarostat.h:214
int getFrequency() const
Get the frequency (in time steps) at which Monte Carlo volume changes should be attempted.
Definition: MonteCarloMembraneBarostat.h:163
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: MonteCarloMembraneBarostat.h:139
void setXYMode(XYMode mode)
Set the mode specifying the behavior of the X and Y axes.
Definition: MonteCarloMembraneBarostat.h:196
static const std::string & SurfaceTension()
This is the name of the parameter which stores the current surface tension acting on the system (in b...
Definition: MonteCarloMembraneBarostat.h:110
ZMode
This is an enumeration of the different behaviors for Z axis.
Definition: MonteCarloMembraneBarostat.h:83
Definition: AndersenThermostat.h:40
double getDefaultSurfaceTension() const
Get the default surface tension acting on the system (in bar*nm).
Definition: MonteCarloMembraneBarostat.h:147
ZMode getZMode() const
Get the mode specifying the behavior of the Z axis.
Definition: MonteCarloMembraneBarostat.h:202
void setTemperature(double temp)
Set the temperature at which the system is being maintained.
Definition: MonteCarloMembraneBarostat.h:184