"platforms/reference/vscode:/vscode.git/clone" did not exist on "c29a33221fffa9987e0a922d5d5aa5893fc9b856"
ReferenceVariableStochasticDynamics.h 5.39 KB
Newer Older
1

2
/* Portions copyright (c) 2006-2024 Stanford University and Simbios.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Contributors: Pande Group
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef __ReferenceVariableStochasticDynamics_H__
#define __ReferenceVariableStochasticDynamics_H__

#include "ReferenceDynamics.h"

30
namespace OpenMM {
31
32
33
34
35

class ReferenceVariableStochasticDynamics : public ReferenceDynamics {

   private:

36
      std::vector<OpenMM::Vec3> xPrime, oldx;
peastman's avatar
peastman committed
37
38
      std::vector<double> inverseMasses;
      double friction, _accuracy;
39
40
41
42
43
44
45
46

   public:

      /**---------------------------------------------------------------------------------------

         Constructor

         @param numberOfAtoms  number of atoms
47
         @param friction       friction coefficient
48
49
50
51
52
         @param temperature    temperature
         @param accuracy       required accuracy

         --------------------------------------------------------------------------------------- */

peastman's avatar
peastman committed
53
       ReferenceVariableStochasticDynamics(int numberOfAtoms, double friction, double temperature, double accuracy);
54
55
56
57
58
59
60

      /**---------------------------------------------------------------------------------------

         Destructor

         --------------------------------------------------------------------------------------- */

61
       ~ReferenceVariableStochasticDynamics();
62
63
64

      /**---------------------------------------------------------------------------------------

65
         Get friction coefficient
66
67
68

         --------------------------------------------------------------------------------------- */

peastman's avatar
peastman committed
69
      double getFriction() const;
70
71
72
73
74
75
76
77
78
      
      /**---------------------------------------------------------------------------------------

         Get the required accuracy

         @return accuracy

         --------------------------------------------------------------------------------------- */

peastman's avatar
peastman committed
79
      double getAccuracy() const;
80
81
82
83
84
85
86

      /**---------------------------------------------------------------------------------------

         Set the required accuracy

         --------------------------------------------------------------------------------------- */

peastman's avatar
peastman committed
87
      void setAccuracy(double accuracy);
88
89
90
91
92

      /**---------------------------------------------------------------------------------------

         Update

93
         @param system              the System to be integrated
94
95
96
97
98
         @param atomCoordinates     atom coordinates
         @param velocities          velocities
         @param forces              forces
         @param masses              atom masses
         @param maxStepSize         maximum time step
99
         @param tolerance           the constraint tolerance
100
101
102

         --------------------------------------------------------------------------------------- */

peastman's avatar
peastman committed
103
104
      void update(const OpenMM::System& system, std::vector<OpenMM::Vec3>& atomCoordinates,
                  std::vector<OpenMM::Vec3>& velocities, std::vector<OpenMM::Vec3>& forces, std::vector<double>& masses, double maxStepSize, double tolerance);
105
106

      /**---------------------------------------------------------------------------------------
107
            
108
109
110
111
112
         @param numberOfAtoms       number of atoms
         @param velocities          velocities
         @param forces              forces
         @param inverseMasses       inverse atom masses
         @param maxStepSize         maximum time step
113
      
114
         --------------------------------------------------------------------------------------- */
115
116
      
      void updatePart1(int numberOfAtoms, std::vector<OpenMM::Vec3>& velocities,  std::vector<OpenMM::Vec3>& forces, std::vector<double>& inverseMasses, double maxStepSize);
117
118

      /**---------------------------------------------------------------------------------------
119
      
120
         Second update
121
      
122
123
124
         @param numberOfAtoms       number of atoms
         @param atomCoordinates     atom coordinates
         @param velocities          velocities
125
126
127
         @param inverseMasses       inverse atom masses
         @param xPrime              xPrime
      
128
         --------------------------------------------------------------------------------------- */
129
      
peastman's avatar
peastman committed
130
      void updatePart2(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, std::vector<OpenMM::Vec3>& velocities,
131
                               std::vector<double>& inverseMasses, std::vector<OpenMM::Vec3>& xPrime);
132
133
134
      
};

135
} // namespace OpenMM
136
137

#endif // __ReferenceVariableStochasticDynamics_H__