OpenMM
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends
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 
51 class OPENMM_EXPORT GBVIForce : public Force {
52 public:
61  NoCutoff = 0,
65  CutoffNonPeriodic = 1,
70  CutoffPeriodic = 2,
71  };
72 
80  NoScaling = 0,
84  QuinticSpline = 1
85  };
86 
87  /*
88  * Create a GBVIForce.
89  */
90  GBVIForce();
94  int getNumParticles() const {
95  return particles.size();
96  }
106  int addParticle(double charge, double radius, double gamma);
115  void getParticleParameters(int index, double& charge, double& radius, double& gamma) const;
124  void setParticleParameters(int index, double charge, double radius, double gamma);
133  int addBond(int particle1, int particle2, double distance);
134 
143  void getBondParameters(int index, int& particle1, int& particle2, double& distance) const;
152  void setBondParameters( int index, int particle1, int particle2, double bondLength);
158  int getNumBonds( void ) const;
159 
163  double getSolventDielectric() const {
164  return solventDielectric;
165  }
169  void setSolventDielectric(double dielectric) {
170  solventDielectric = dielectric;
171  }
175  double getSoluteDielectric() const {
176  return soluteDielectric;
177  }
181  void setSoluteDielectric(double dielectric) {
182  soluteDielectric = dielectric;
183  }
187  NonbondedMethod getNonbondedMethod() const;
191  void setNonbondedMethod(NonbondedMethod method);
198  double getCutoffDistance() const;
205  void setCutoffDistance(double distance);
209  BornRadiusScalingMethod getBornRadiusScalingMethod( void ) const;
213  void setBornRadiusScalingMethod( BornRadiusScalingMethod method);
217  double getQuinticLowerLimitFactor( void ) const;
221  void setQuinticLowerLimitFactor(double quinticLowerLimitFactor );
225  double getQuinticUpperBornRadiusLimit( void ) const;
229  void setQuinticUpperBornRadiusLimit(double quinticUpperBornRadiusLimit);
230 protected:
231  ForceImpl* createImpl() const;
232 private:
233  class ParticleInfo;
234  NonbondedMethod nonbondedMethod;
235  double cutoffDistance, solventDielectric, soluteDielectric;
236 
237  BornRadiusScalingMethod scalingMethod;
238  double quinticLowerLimitFactor, quinticUpperBornRadiusLimit;
239 
240  class BondInfo;
241  std::vector<ParticleInfo> particles;
242  std::vector<BondInfo> bonds;
243 };
244 
249 class GBVIForce::ParticleInfo {
250 public:
251  double charge, radius, gamma;
252  ParticleInfo() {
253  charge = radius = gamma = 0.0;
254  }
255  ParticleInfo(double charge, double radius, double gamma) :
256  charge(charge), radius(radius), gamma(gamma) {
257  }
258 };
259 
264 class GBVIForce::BondInfo {
265 public:
266  int particle1, particle2;
267  double bondLength;
268  BondInfo() {
269  bondLength = 0.0;
270  particle1 = -1;
271  particle2 = -1;
272  }
273  BondInfo(int atomIndex1, int atomIndex2, double bondLength) :
274  particle1(atomIndex1), particle2(atomIndex2), bondLength(bondLength) {
275  }
276 };
277 
278 } // namespace OpenMM
279 
280 #endif /*OPENMM_GBVIFORCEFIELD_H_*/