OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
GBVIForce.h
1 #ifndef OPENMM_GBVIFORCEFIELD_H_
2 #define OPENMM_GBVIFORCEFIELD_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) 2008-2009 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 <vector>
37 #include "internal/windowsExport.h"
38 
39 namespace OpenMM {
40 
53 class OPENMM_EXPORT GBVIForce : public Force {
54 public:
63  NoCutoff = 0,
67  CutoffNonPeriodic = 1,
72  CutoffPeriodic = 2,
73  };
74 
82  NoScaling = 0,
86  QuinticSpline = 1
87  };
88 
89  /*
90  * Create a GBVIForce.
91  */
92  GBVIForce();
96  int getNumParticles() const {
97  return particles.size();
98  }
108  int addParticle(double charge, double radius, double gamma);
117  void getParticleParameters(int index, double& charge, double& radius, double& gamma) const;
126  void setParticleParameters(int index, double charge, double radius, double gamma);
135  int addBond(int particle1, int particle2, double distance);
136 
145  void getBondParameters(int index, int& particle1, int& particle2, double& distance) const;
154  void setBondParameters( int index, int particle1, int particle2, double bondLength);
160  int getNumBonds() const;
161 
165  double getSolventDielectric() const {
166  return solventDielectric;
167  }
171  void setSolventDielectric(double dielectric) {
172  solventDielectric = dielectric;
173  }
177  double getSoluteDielectric() const {
178  return soluteDielectric;
179  }
183  void setSoluteDielectric(double dielectric) {
184  soluteDielectric = dielectric;
185  }
189  NonbondedMethod getNonbondedMethod() const;
193  void setNonbondedMethod(NonbondedMethod method);
200  double getCutoffDistance() const;
207  void setCutoffDistance(double distance);
211  BornRadiusScalingMethod getBornRadiusScalingMethod() const;
215  void setBornRadiusScalingMethod( BornRadiusScalingMethod method);
219  double getQuinticLowerLimitFactor() const;
223  void setQuinticLowerLimitFactor(double quinticLowerLimitFactor );
227  double getQuinticUpperBornRadiusLimit() const;
231  void setQuinticUpperBornRadiusLimit(double quinticUpperBornRadiusLimit);
239  return nonbondedMethod == GBVIForce::CutoffPeriodic;
240  }
241 protected:
242  ForceImpl* createImpl() const;
243 private:
244  class ParticleInfo;
245  NonbondedMethod nonbondedMethod;
246  double cutoffDistance, solventDielectric, soluteDielectric;
247 
248  BornRadiusScalingMethod scalingMethod;
249  double quinticLowerLimitFactor, quinticUpperBornRadiusLimit;
250 
251  class BondInfo;
252  std::vector<ParticleInfo> particles;
253  std::vector<BondInfo> bonds;
254 };
255 
260 class GBVIForce::ParticleInfo {
261 public:
262  double charge, radius, gamma;
263  ParticleInfo() {
264  charge = radius = gamma = 0.0;
265  }
266  ParticleInfo(double charge, double radius, double gamma) :
267  charge(charge), radius(radius), gamma(gamma) {
268  }
269 };
270 
275 class GBVIForce::BondInfo {
276 public:
277  int particle1, particle2;
278  double bondLength;
279  BondInfo() {
280  bondLength = 0.0;
281  particle1 = -1;
282  particle2 = -1;
283  }
284  BondInfo(int atomIndex1, int atomIndex2, double bondLength) :
285  particle1(atomIndex1), particle2(atomIndex2), bondLength(bondLength) {
286  }
287 };
288 
289 } // namespace OpenMM
290 
291 #endif /*OPENMM_GBVIFORCEFIELD_H_*/
double getSoluteDielectric() const
Get the dielectric constant for the solute.
Definition: GBVIForce.h:177
Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic...
Definition: GBVIForce.h:72
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
BornRadiusScalingMethod
This is an enumeration of the different methods that may be used for scaling of the Born radii...
Definition: GBVIForce.h:78
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: GBVIForce.h:238
void setSoluteDielectric(double dielectric)
Set the dielectric constant for the solute.
Definition: GBVIForce.h:183
void setSolventDielectric(double dielectric)
Set the dielectric constant for the solvent.
Definition: GBVIForce.h:171
int getNumParticles() const
Get the number of particles in the system.
Definition: GBVIForce.h:96
double getSolventDielectric() const
Get the dielectric constant for the solvent.
Definition: GBVIForce.h:165
Definition: AndersenThermostat.h:40
This class implements an implicit solvation force using the GB/VI model.
Definition: GBVIForce.h:53
NonbondedMethod
This is an enumeration of the different methods that may be used for handling long range nonbonded fo...
Definition: GBVIForce.h:58