OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CMAPTorsionForce.h
1 #ifndef OPENMM_CMAPTORSIONFORCE_H_
2 #define OPENMM_CMAPTORSIONFORCE_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-2015 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 "Vec3.h"
37 #include <vector>
38 #include "internal/windowsExport.h"
39 
40 namespace OpenMM {
41 
55 class OPENMM_EXPORT CMAPTorsionForce : public Force {
56 public:
64  int getNumMaps() const {
65  return maps.size();
66  }
70  int getNumTorsions() const {
71  return torsions.size();
72  }
83  int addMap(int size, const std::vector<double>& energy);
94  void getMapParameters(int index, int& size, std::vector<double>& energy) const;
105  void setMapParameters(int index, int size, const std::vector<double>& energy);
120  int addTorsion(int map, int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4);
135  void getTorsionParameters(int index, int& map, int& a1, int& a2, int& a3, int& a4, int& b1, int& b2, int& b3, int& b4) const;
150  void setTorsionParameters(int index, int map, int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4);
161  void updateParametersInContext(Context& context);
169  return false;
170  }
171 protected:
172  ForceImpl* createImpl() const;
173 private:
174  class MapInfo;
175  class CMAPTorsionInfo;
176  std::vector<MapInfo> maps;
177  std::vector<CMAPTorsionInfo> torsions;
178 };
179 
184 class CMAPTorsionForce::MapInfo {
185 public:
186  int size;
187  std::vector<double> energy;
188  MapInfo() {
189  size = -1;
190  }
191  MapInfo(int size, const std::vector<double>& energy) :
192  size(size), energy(energy) {
193  }
194 };
195 
200 class CMAPTorsionForce::CMAPTorsionInfo {
201 public:
202  int map, a1, a2, a3, a4, b1, b2, b3, b4;
203  CMAPTorsionInfo() {
204  map = a1 = a2 = a3 = a4 = b1 = b2 = b3 = b4 = -1;
205  }
206  CMAPTorsionInfo(int map, int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4) :
207  map(map), a1(a1), a2(a2), a3(a3), a4(a4), b1(b1), b2(b2), b3(b3), b4(b4) {
208  }
209 };
210 
211 } // namespace OpenMM
212 
213 #endif /*OPENMM_CMAPTORSIONFORCE_H_*/
A Context stores the complete state of a simulation.
Definition: Context.h:67
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: CMAPTorsionForce.h:168
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
int getNumMaps() const
Get the number of maps that have been defined.
Definition: CMAPTorsionForce.h:64
This class implements an interaction between pairs of dihedral angles.
Definition: CMAPTorsionForce.h:55
int getNumTorsions() const
Get the number of CMAP torsion terms in the potential function.
Definition: CMAPTorsionForce.h:70
Definition: AndersenThermostat.h:40