OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
VirtualSite.h
1 #ifndef OPENMM_VIRTUALSITE_H_
2 #define OPENMM_VIRTUALSITE_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) 2012-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 <openmm/Vec3.h>
36 #include "internal/windowsExport.h"
37 #include <vector>
38 
39 namespace OpenMM {
40 
48 class OPENMM_EXPORT VirtualSite {
49 public:
50  virtual ~VirtualSite() {
51  }
55  int getNumParticles() const;
62  int getParticle(int particle) const;
63 protected:
65  }
66  void setParticles(const std::vector<int>& particleIndices);
67 private:
68  std::vector<int> particles;
69 };
70 
76 class OPENMM_EXPORT TwoParticleAverageSite : public VirtualSite {
77 public:
87  TwoParticleAverageSite(int particle1, int particle2, double weight1, double weight2);
94  double getWeight(int particle) const;
95 private:
96  double weight1, weight2;
97 };
98 
104 class OPENMM_EXPORT ThreeParticleAverageSite : public VirtualSite {
105 public:
117  ThreeParticleAverageSite(int particle1, int particle2, int particle3, double weight1, double weight2, double weight3);
124  double getWeight(int particle) const;
125 private:
126  double weight1, weight2, weight3;
127 };
128 
141 class OPENMM_EXPORT OutOfPlaneSite : public VirtualSite {
142 public:
153  OutOfPlaneSite(int particle1, int particle2, int particle3, double weight12, double weight13, double weightCross);
157  double getWeight12() const;
161  double getWeight13() const;
165  double getWeightCross() const;
166 private:
167  double weight12, weight13, weightCross;
168 };
169 
195 class OPENMM_EXPORT LocalCoordinatesSite : public VirtualSite {
196 public:
208  LocalCoordinatesSite(int particle1, int particle2, int particle3, const Vec3& originWeights, const Vec3& xWeights, const Vec3& yWeights, const Vec3& localPosition);
212  const Vec3& getOriginWeights() const;
216  const Vec3& getXWeights() const;
220  const Vec3& getYWeights() const;
224  const Vec3& getLocalPosition() const;
225 private:
226  Vec3 originWeights, xWeights, yWeights, localPosition;
227 };
228 
229 } // namespace OpenMM
230 
231 #endif /*OPENMM_VIRTUALSITE_H_*/
This is a VirtualSite that computes the particle location as a weighted average of three other partic...
Definition: VirtualSite.h:104
virtual ~VirtualSite()
Definition: VirtualSite.h:50
VirtualSite()
Definition: VirtualSite.h:64
A VirtualSite describes the rules for computing a particle's position based on other particles...
Definition: VirtualSite.h:48
This is a VirtualSite that computes the particle location based on three other particles' locations...
Definition: VirtualSite.h:141
This class represents a three component vector.
Definition: Vec3.h:45
This is a VirtualSite that uses the locations of three other particles to compute a local coordinate ...
Definition: VirtualSite.h:195
This is a VirtualSite that computes the particle location as a weighted average of two other particle...
Definition: VirtualSite.h:76
Definition: AndersenThermostat.h:40