OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
AmoebaVdwForce.h
1 #ifndef OPENMM_AMOEBA_VDW_FORCE_H_
2 #define OPENMM_AMOEBA_VDW_FORCE_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * OpenMMAmoeba *
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-2012 Stanford University and the Authors. *
13  * Authors: Mark Friedrichs, 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 "openmm/Force.h"
36 #include "internal/windowsExportAmoeba.h"
37 #include <vector>
38 
39 namespace OpenMM {
40 
55 class OPENMM_EXPORT_AMOEBA AmoebaVdwForce : public Force {
56 public:
65  NoCutoff = 0,
70  CutoffPeriodic = 1,
71  };
72 
77 
81  int getNumParticles() const {
82  return parameters.size();
83  }
84 
95  void setParticleParameters(int particleIndex, int parentIndex, double sigma, double epsilon, double reductionFactor);
96 
107  void getParticleParameters(int particleIndex, int& parentIndex, double& sigma, double& epsilon, double& reductionFactor) const;
108 
109 
120  int addParticle(int parentIndex, double sigma, double epsilon, double reductionFactor);
121 
127  void setSigmaCombiningRule(const std::string& sigmaCombiningRule);
128 
134  const std::string& getSigmaCombiningRule(void) const;
135 
141  void setEpsilonCombiningRule(const std::string& epsilonCombiningRule);
142 
148  const std::string& getEpsilonCombiningRule(void) const;
149 
157  return useDispersionCorrection;
158  }
159 
166  void setUseDispersionCorrection(bool useCorrection) {
167  useDispersionCorrection = useCorrection;
168  }
169 
176  void setParticleExclusions(int particleIndex, const std::vector<int>& exclusions);
177 
184  void getParticleExclusions(int particleIndex, std::vector<int>& exclusions) const;
185 
189  void setCutoff(double cutoff);
190 
194  double getCutoff(void) const;
195 
199  NonbondedMethod getNonbondedMethod() const;
200 
204  void setNonbondedMethod(NonbondedMethod method);
214  void updateParametersInContext(Context& context);
215 
216 protected:
217  ForceImpl* createImpl() const;
218 private:
219 
220  class VdwInfo;
221  NonbondedMethod nonbondedMethod;
222  double cutoff;
223  bool useDispersionCorrection;
224 
225  std::string sigmaCombiningRule;
226  std::string epsilonCombiningRule;
227 
228  std::vector< std::vector<int> > exclusions;
229  std::vector<VdwInfo> parameters;
230  std::vector< std::vector< std::vector<double> > > sigEpsTable;
231 };
232 
237 class AmoebaVdwForce::VdwInfo {
238 public:
239  int parentIndex;
240  double reductionFactor, sigma, epsilon, cutoff;
241  VdwInfo() {
242  parentIndex = -1;
243  reductionFactor = 0.0;
244  sigma = 1.0;
245  epsilon = 0.0;
246  }
247  VdwInfo(int parentIndex, double sigma, double epsilon, double reductionFactor) :
248  parentIndex(parentIndex), sigma(sigma), epsilon(epsilon), reductionFactor(reductionFactor) {
249  }
250 };
251 
252 } // namespace OpenMM
253 
254 #endif /*OPENMM_AMOEBA_VDW_FORCE_H_*/
255 
bool getUseDispersionCorrection() const
Get whether to add a contribution to the energy that approximately represents the effect of VdW inter...
Definition: AmoebaVdwForce.h:156
This class implements a buffered 14-7 potential used to model van der Waals forces.
Definition: AmoebaVdwForce.h:55
A Context stores the complete state of a simulation.
Definition: Context.h:67
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
int getNumParticles() const
Get the number of particles.
Definition: AmoebaVdwForce.h:81
A ForceImpl provides the internal implementation of a Force.
Definition: ForceImpl.h:57
void setUseDispersionCorrection(bool useCorrection)
Set whether to add a contribution to the energy that approximately represents the effect of VdW inter...
Definition: AmoebaVdwForce.h:166
NonbondedMethod
This is an enumeration of the different methods that may be used for handling long range nonbonded fo...
Definition: AmoebaVdwForce.h:60