1 |
< |
/* |
1 |
> |
/* |
2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
|
* |
4 |
|
* The University of Notre Dame grants you ("Licensee") a |
6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
* documentation and/or other materials provided with the |
15 |
|
* distribution. |
28 |
|
* arising out of the use of or inability to use software, even if the |
29 |
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
* such damages. |
31 |
+ |
* |
32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
+ |
* research, please cite the appropriate papers when you publish your |
34 |
+ |
* work. Good starting points are: |
35 |
+ |
* |
36 |
+ |
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
+ |
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
+ |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
+ |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
/** |
47 |
|
* @version 1.0 |
48 |
|
*/ |
49 |
|
|
50 |
< |
#ifndef PRIMITIVES_STUNTDOUBLE_HPP |
51 |
< |
#define PRIMITIVES_STUNTDOUBLE_HPP |
50 |
> |
#ifndef PRIMITIVES_STUNTDOUBLE_HPP |
51 |
> |
#define PRIMITIVES_STUNTDOUBLE_HPP |
52 |
|
|
53 |
|
#include <vector> |
54 |
|
|
59 |
|
#include "utils/PropertyMap.hpp" |
60 |
|
#include "brains/Snapshot.hpp" |
61 |
|
#include "brains/SnapshotManager.hpp" |
62 |
< |
namespace oopse{ |
62 |
> |
namespace OpenMD{ |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
/** |
67 |
|
* @class StuntDouble StuntDouble.hpp "Primitives/StuntDouble.hpp" |
68 |
|
* @brief |
69 |
+ |
* "Don't move, or you're dead! Stand up! Captain, we've got them!" |
70 |
+ |
* |
71 |
+ |
* "Spectacular stunt, my friends, but all for naught. Turn around |
72 |
+ |
* please. Ha. What a pity. What a pity. So, Princess, you thought |
73 |
+ |
* you could outwit the imperious forces of...." |
74 |
+ |
* |
75 |
+ |
* "You idiots! These are not them. You've captured their stunt |
76 |
+ |
* doubles! Search the area. Find them! Find them!" |
77 |
+ |
* |
78 |
|
* StuntDouble is a very strange idea. A StuntDouble stands in for |
79 |
|
* some object that can be manipulated by the Integrators or |
80 |
|
* Minimizers. Some of the manipulable objects are Atoms, some are |
81 |
|
* DirectionalAtoms, and some are RigidBodies. StuntDouble |
82 |
|
* provides an interface for the Integrators and Minimizers to use, |
83 |
|
* and does some preliminary sanity checking so that the program |
84 |
< |
* doesn't try to do something stupid like torque an Atom |
85 |
< |
* @note the dynamic data of stuntdouble will be stored outside of the class |
84 |
> |
* doesn't try to do something stupid like torque an Atom (The |
85 |
> |
* quotes above are from Spaceballs...) |
86 |
> |
* |
87 |
> |
* @note the dynamic data of stuntDouble will be stored outside of the class |
88 |
|
*/ |
89 |
< |
class StuntDouble{ |
90 |
< |
public: |
89 |
> |
class StuntDouble{ |
90 |
> |
public: |
91 |
|
|
92 |
< |
enum ObjectType{ |
93 |
< |
otAtom, |
94 |
< |
otDAtom, |
95 |
< |
otRigidBody |
96 |
< |
}; |
92 |
> |
enum ObjectType{ |
93 |
> |
otAtom, |
94 |
> |
otDAtom, |
95 |
> |
otRigidBody |
96 |
> |
}; |
97 |
|
|
98 |
< |
virtual ~StuntDouble(); |
98 |
> |
virtual ~StuntDouble(); |
99 |
|
|
100 |
< |
/** |
101 |
< |
* Returns the global index of this stuntdouble. |
102 |
< |
* @return the global index of this stuntdouble |
103 |
< |
*/ |
104 |
< |
int getGlobalIndex() { |
105 |
< |
return globalIndex_; |
106 |
< |
} |
100 |
> |
/** |
101 |
> |
* Returns the global index of this stuntDouble. |
102 |
> |
* @return the global index of this stuntDouble |
103 |
> |
*/ |
104 |
> |
int getGlobalIndex() { |
105 |
> |
return globalIndex_; |
106 |
> |
} |
107 |
|
|
108 |
< |
/** |
109 |
< |
* Sets the global index of this stuntdouble. |
110 |
< |
* @param new global index to be set |
111 |
< |
*/ |
112 |
< |
void setGlobalIndex(int index) { |
113 |
< |
globalIndex_ = index; |
114 |
< |
} |
115 |
< |
|
116 |
< |
/** |
117 |
< |
* Returns the local index of this stuntdouble |
118 |
< |
* @return the local index of this stuntdouble |
119 |
< |
*/ |
120 |
< |
int getLocalIndex() { |
121 |
< |
return localIndex_; |
122 |
< |
} |
108 |
> |
/** |
109 |
> |
* Sets the global index of this stuntDouble. |
110 |
> |
* @param index new global index to be set |
111 |
> |
*/ |
112 |
> |
void setGlobalIndex(int index) { |
113 |
> |
globalIndex_ = index; |
114 |
> |
} |
115 |
> |
|
116 |
> |
/** |
117 |
> |
* Returns the local index of this stuntDouble |
118 |
> |
* @return the local index of this stuntDouble |
119 |
> |
*/ |
120 |
> |
int getLocalIndex() { |
121 |
> |
return localIndex_; |
122 |
> |
} |
123 |
|
|
124 |
< |
/** |
125 |
< |
* Sets the local index of this stuntdouble |
126 |
< |
* @param index new index to be set |
127 |
< |
*/ |
128 |
< |
void setLocalIndex(int index) { |
129 |
< |
localIndex_ = index; |
130 |
< |
} |
124 |
> |
/** |
125 |
> |
* Sets the local index of this stuntDouble |
126 |
> |
* @param index new index to be set |
127 |
> |
*/ |
128 |
> |
void setLocalIndex(int index) { |
129 |
> |
localIndex_ = index; |
130 |
> |
} |
131 |
> |
|
132 |
> |
int getGlobalIntegrableObjectIndex(){ |
133 |
> |
return globalIntegrableObjectIndex_; |
134 |
> |
} |
135 |
> |
void setGlobalIntegrableObjectIndex(int index) { |
136 |
> |
globalIntegrableObjectIndex_ = index; |
137 |
> |
} |
138 |
|
|
139 |
< |
/** |
140 |
< |
* Sets the Snapshot Manager of this stuntdouble |
141 |
< |
*/ |
142 |
< |
void setSnapshotManager(SnapshotManager* sman) { |
143 |
< |
snapshotMan_ = sman; |
144 |
< |
} |
139 |
> |
/** |
140 |
> |
* Sets the Snapshot Manager of this stuntDouble |
141 |
> |
*/ |
142 |
> |
void setSnapshotManager(SnapshotManager* sman) { |
143 |
> |
snapshotMan_ = sman; |
144 |
> |
} |
145 |
|
|
146 |
< |
/** |
147 |
< |
* Tests if this stuntdouble is an atom |
148 |
< |
* @return true is this stuntdouble is an atom(or a directional atom), return false otherwise |
149 |
< |
*/ |
150 |
< |
bool isAtom(){ |
151 |
< |
return objType_ == otAtom || objType_ == otDAtom; |
152 |
< |
} |
146 |
> |
/** |
147 |
> |
* Tests if this stuntDouble is an atom |
148 |
> |
* @return true is this stuntDouble is an atom(or a directional atom), return false otherwise |
149 |
> |
*/ |
150 |
> |
bool isAtom(){ |
151 |
> |
return objType_ == otAtom || objType_ == otDAtom; |
152 |
> |
} |
153 |
|
|
154 |
< |
/** |
155 |
< |
* Tests if this stuntdouble is an directional atom |
156 |
< |
* @return true if this stuntdouble is an directional atom, return false otherwise |
157 |
< |
*/ |
158 |
< |
bool isDirectionalAtom(){ |
159 |
< |
return objType_ == otDAtom; |
160 |
< |
} |
154 |
> |
/** |
155 |
> |
* Tests if this stuntDouble is an directional atom |
156 |
> |
* @return true if this stuntDouble is an directional atom, return false otherwise |
157 |
> |
*/ |
158 |
> |
bool isDirectionalAtom(){ |
159 |
> |
return objType_ == otDAtom; |
160 |
> |
} |
161 |
|
|
162 |
< |
/** |
163 |
< |
* Tests if this stuntdouble is a rigid body. |
164 |
< |
* @return true if this stuntdouble is a rigid body, otherwise return false |
165 |
< |
*/ |
166 |
< |
bool isRigidBody(){ |
167 |
< |
return objType_ == otRigidBody; |
168 |
< |
} |
162 |
> |
/** |
163 |
> |
* Tests if this stuntDouble is a rigid body. |
164 |
> |
* @return true if this stuntDouble is a rigid body, otherwise return false |
165 |
> |
*/ |
166 |
> |
bool isRigidBody(){ |
167 |
> |
return objType_ == otRigidBody; |
168 |
> |
} |
169 |
|
|
170 |
< |
/** |
171 |
< |
* Tests if this stuntdouble is a directional one. |
172 |
< |
* @return true is this stuntdouble is a directional atom or a rigid body, return false otherwise |
173 |
< |
*/ |
174 |
< |
bool isDirectional(){ |
175 |
< |
return isDirectionalAtom() || isRigidBody(); |
176 |
< |
} |
170 |
> |
/** |
171 |
> |
* Tests if this stuntDouble is a directional one. |
172 |
> |
* @return true is this stuntDouble is a directional atom or a rigid body, return false otherwise |
173 |
> |
*/ |
174 |
> |
bool isDirectional(){ |
175 |
> |
return isDirectionalAtom() || isRigidBody(); |
176 |
> |
} |
177 |
|
|
178 |
< |
/** |
179 |
< |
* Returns the previous position of this stuntdouble |
180 |
< |
* @return the position of this stuntdouble |
181 |
< |
*/ |
182 |
< |
Vector3d getPrevPos() { |
183 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_]; |
184 |
< |
} |
185 |
< |
|
186 |
< |
/** |
168 |
< |
* Returns the current position of this stuntdouble |
169 |
< |
* @return the position of this stuntdouble |
170 |
< |
*/ |
171 |
< |
Vector3d getPos() { |
172 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_]; |
173 |
< |
} |
178 |
> |
/** |
179 |
> |
* Freezes out all velocity, angular velocity, forces and torques |
180 |
> |
* on this StuntDouble. Also computes the number of frozen degrees |
181 |
> |
* of freedom. |
182 |
> |
* @return the total number of frozen degrees of freedom |
183 |
> |
*/ |
184 |
> |
int freeze() { |
185 |
> |
|
186 |
> |
int fdf = 3; |
187 |
|
|
188 |
< |
/** |
189 |
< |
* Returns the position of this stuntdouble in specified snapshot |
190 |
< |
* @return the position of this stuntdouble |
191 |
< |
* @param snapshotNo |
192 |
< |
*/ |
193 |
< |
Vector3d getPos(int snapshotNo) { |
194 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_]; |
195 |
< |
} |
188 |
> |
setVel(V3Zero); |
189 |
> |
setFrc(V3Zero); |
190 |
> |
if (isDirectional()){ |
191 |
> |
setJ(V3Zero); |
192 |
> |
setTrq(V3Zero); |
193 |
> |
if (isLinear()) |
194 |
> |
fdf +=2; |
195 |
> |
else |
196 |
> |
fdf +=3; |
197 |
> |
} |
198 |
> |
return fdf; |
199 |
> |
} |
200 |
|
|
201 |
< |
/** |
202 |
< |
* Sets the previous position of this stuntdouble |
203 |
< |
* @param pos new position |
204 |
< |
* @see #getPos |
205 |
< |
*/ |
206 |
< |
void setPrevPos(const Vector3d& pos) { |
207 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_] = pos; |
191 |
< |
} |
201 |
> |
/** |
202 |
> |
* Returns the previous position of this stuntDouble |
203 |
> |
* @return the position of this stuntDouble |
204 |
> |
*/ |
205 |
> |
Vector3d getPrevPos() { |
206 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_]; |
207 |
> |
} |
208 |
|
|
209 |
< |
/** |
210 |
< |
* Sets the current position of this stuntdouble |
211 |
< |
* @param pos new position |
212 |
< |
*/ |
213 |
< |
void setPos(const Vector3d& pos) { |
214 |
< |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
215 |
< |
data.position[localIndex_] = pos; |
200 |
< |
//((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_] = pos; |
201 |
< |
} |
209 |
> |
/** |
210 |
> |
* Returns the current position of this stuntDouble |
211 |
> |
* @return the position of this stuntDouble |
212 |
> |
*/ |
213 |
> |
Vector3d getPos() { |
214 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_]; |
215 |
> |
} |
216 |
|
|
217 |
< |
/** |
218 |
< |
* Sets the position of this stuntdouble in specified snapshot |
219 |
< |
* @param pos position to be set |
220 |
< |
* @param snapshotNo |
221 |
< |
* @see #getPos |
222 |
< |
*/ |
223 |
< |
void setPos(const Vector3d& pos, int snapshotNo) { |
224 |
< |
|
211 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_] = pos; |
217 |
> |
/** |
218 |
> |
* Returns the position of this stuntDouble in specified snapshot |
219 |
> |
* @return the position of this stuntDouble |
220 |
> |
* @param snapshotNo |
221 |
> |
*/ |
222 |
> |
Vector3d getPos(int snapshotNo) { |
223 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_]; |
224 |
> |
} |
225 |
|
|
226 |
< |
} |
226 |
> |
/** |
227 |
> |
* Sets the previous position of this stuntDouble |
228 |
> |
* @param pos new position |
229 |
> |
* @see #getPos |
230 |
> |
*/ |
231 |
> |
void setPrevPos(const Vector3d& pos) { |
232 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_] = pos; |
233 |
> |
} |
234 |
|
|
235 |
< |
/** |
236 |
< |
* Returns the previous velocity of this stuntdouble |
237 |
< |
* @return the velocity of this stuntdouble |
238 |
< |
*/ |
239 |
< |
Vector3d getPrevVel() { |
240 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_]; |
241 |
< |
} |
235 |
> |
/** |
236 |
> |
* Sets the current position of this stuntDouble |
237 |
> |
* @param pos new position |
238 |
> |
*/ |
239 |
> |
void setPos(const Vector3d& pos) { |
240 |
> |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
241 |
> |
data.position[localIndex_] = pos; |
242 |
> |
//((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_] = pos; |
243 |
> |
} |
244 |
> |
|
245 |
> |
/** |
246 |
> |
* Sets the position of this stuntDouble in specified snapshot |
247 |
> |
* @param pos position to be set |
248 |
> |
* @param snapshotNo |
249 |
> |
* @see #getPos |
250 |
> |
*/ |
251 |
> |
void setPos(const Vector3d& pos, int snapshotNo) { |
252 |
> |
|
253 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_] = pos; |
254 |
> |
|
255 |
> |
} |
256 |
|
|
257 |
< |
/** |
258 |
< |
* Returns the current velocity of this stuntdouble |
259 |
< |
* @return the velocity of this stuntdouble |
260 |
< |
*/ |
261 |
< |
Vector3d getVel() { |
262 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_]; |
263 |
< |
} |
257 |
> |
/** |
258 |
> |
* Returns the previous velocity of this stuntDouble |
259 |
> |
* @return the velocity of this stuntDouble |
260 |
> |
*/ |
261 |
> |
Vector3d getPrevVel() { |
262 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_]; |
263 |
> |
} |
264 |
> |
|
265 |
> |
/** |
266 |
> |
* Returns the current velocity of this stuntDouble |
267 |
> |
* @return the velocity of this stuntDouble |
268 |
> |
*/ |
269 |
> |
Vector3d getVel() { |
270 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_]; |
271 |
> |
} |
272 |
|
|
273 |
< |
/** |
274 |
< |
* Returns the velocity of this stuntdouble in specified snapshot |
275 |
< |
* @return the velocity of this stuntdouble |
276 |
< |
* @param snapshotNo |
277 |
< |
*/ |
278 |
< |
Vector3d getVel(int snapshotNo) { |
279 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_]; |
280 |
< |
} |
273 |
> |
/** |
274 |
> |
* Returns the velocity of this stuntDouble in specified snapshot |
275 |
> |
* @return the velocity of this stuntDouble |
276 |
> |
* @param snapshotNo |
277 |
> |
*/ |
278 |
> |
Vector3d getVel(int snapshotNo) { |
279 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_]; |
280 |
> |
} |
281 |
|
|
282 |
< |
/** |
283 |
< |
* Sets the previous velocity of this stuntdouble |
284 |
< |
* @param vel new velocity |
285 |
< |
* @see #getVel |
286 |
< |
*/ |
287 |
< |
void setPrevVel(const Vector3d& vel) { |
288 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_] = vel; |
289 |
< |
} |
282 |
> |
/** |
283 |
> |
* Sets the previous velocity of this stuntDouble |
284 |
> |
* @param vel new velocity |
285 |
> |
* @see #getVel |
286 |
> |
*/ |
287 |
> |
void setPrevVel(const Vector3d& vel) { |
288 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_] = vel; |
289 |
> |
} |
290 |
|
|
291 |
< |
/** |
292 |
< |
* Sets the current velocity of this stuntdouble |
293 |
< |
* @param vel new velocity |
294 |
< |
*/ |
295 |
< |
void setVel(const Vector3d& vel) { |
296 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_] = vel; |
297 |
< |
} |
291 |
> |
/** |
292 |
> |
* Sets the current velocity of this stuntDouble |
293 |
> |
* @param vel new velocity |
294 |
> |
*/ |
295 |
> |
void setVel(const Vector3d& vel) { |
296 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_] = vel; |
297 |
> |
} |
298 |
|
|
299 |
< |
/** |
300 |
< |
* Sets the velocity of this stuntdouble in specified snapshot |
301 |
< |
* @param vel velocity to be set |
302 |
< |
* @param snapshotNo |
303 |
< |
* @see #getVel |
304 |
< |
*/ |
305 |
< |
void setVel(const Vector3d& vel, int snapshotNo) { |
306 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_] = vel; |
307 |
< |
} |
299 |
> |
/** |
300 |
> |
* Sets the velocity of this stuntDouble in specified snapshot |
301 |
> |
* @param vel velocity to be set |
302 |
> |
* @param snapshotNo |
303 |
> |
* @see #getVel |
304 |
> |
*/ |
305 |
> |
void setVel(const Vector3d& vel, int snapshotNo) { |
306 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_] = vel; |
307 |
> |
} |
308 |
|
|
309 |
< |
/** |
310 |
< |
* Returns the previous rotation matrix of this stuntdouble |
311 |
< |
* @return the rotation matrix of this stuntdouble |
312 |
< |
*/ |
313 |
< |
RotMat3x3d getPrevA() { |
314 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_]; |
315 |
< |
} |
309 |
> |
/** |
310 |
> |
* Returns the previous rotation matrix of this stuntDouble |
311 |
> |
* @return the rotation matrix of this stuntDouble |
312 |
> |
*/ |
313 |
> |
RotMat3x3d getPrevA() { |
314 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_]; |
315 |
> |
} |
316 |
|
|
317 |
< |
/** |
318 |
< |
* Returns the current rotation matrix of this stuntdouble |
319 |
< |
* @return the rotation matrix of this stuntdouble |
320 |
< |
*/ |
321 |
< |
RotMat3x3d getA() { |
322 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_]; |
323 |
< |
} |
317 |
> |
/** |
318 |
> |
* Returns the current rotation matrix of this stuntDouble |
319 |
> |
* @return the rotation matrix of this stuntDouble |
320 |
> |
*/ |
321 |
> |
RotMat3x3d getA() { |
322 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_]; |
323 |
> |
} |
324 |
|
|
325 |
< |
/** |
326 |
< |
* Returns the rotation matrix of this stuntdouble in specified snapshot |
327 |
< |
* |
328 |
< |
* @return the rotation matrix of this stuntdouble |
329 |
< |
* @param snapshotNo |
330 |
< |
*/ |
331 |
< |
RotMat3x3d getA(int snapshotNo) { |
332 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_]; |
333 |
< |
} |
325 |
> |
/** |
326 |
> |
* Returns the rotation matrix of this stuntDouble in specified snapshot |
327 |
> |
* |
328 |
> |
* @return the rotation matrix of this stuntDouble |
329 |
> |
* @param snapshotNo |
330 |
> |
*/ |
331 |
> |
RotMat3x3d getA(int snapshotNo) { |
332 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_]; |
333 |
> |
} |
334 |
|
|
335 |
< |
/** |
336 |
< |
* Sets the previous rotation matrix of this stuntdouble |
337 |
< |
* @param a new rotation matrix |
338 |
< |
* @see #getA |
339 |
< |
*/ |
340 |
< |
virtual void setPrevA(const RotMat3x3d& a) { |
341 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = a; |
342 |
< |
} |
335 |
> |
/** |
336 |
> |
* Sets the previous rotation matrix of this stuntDouble |
337 |
> |
* @param a new rotation matrix |
338 |
> |
* @see #getA |
339 |
> |
*/ |
340 |
> |
virtual void setPrevA(const RotMat3x3d& a) { |
341 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = a; |
342 |
> |
} |
343 |
|
|
344 |
< |
/** |
345 |
< |
* Sets the current rotation matrix of this stuntdouble |
346 |
< |
* @param a new rotation matrix |
347 |
< |
*/ |
348 |
< |
virtual void setA(const RotMat3x3d& a) { |
349 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a; |
350 |
< |
} |
344 |
> |
/** |
345 |
> |
* Sets the current rotation matrix of this stuntDouble |
346 |
> |
* @param a new rotation matrix |
347 |
> |
*/ |
348 |
> |
virtual void setA(const RotMat3x3d& a) { |
349 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a; |
350 |
> |
} |
351 |
|
|
352 |
< |
/** |
353 |
< |
* Sets the rotation matrix of this stuntdouble in specified snapshot |
354 |
< |
* @param a rotation matrix to be set |
355 |
< |
* @param snapshotNo |
356 |
< |
* @see #getA |
357 |
< |
*/ |
358 |
< |
virtual void setA(const RotMat3x3d& a, int snapshotNo) { |
359 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a; |
360 |
< |
} |
352 |
> |
/** |
353 |
> |
* Sets the rotation matrix of this stuntDouble in specified snapshot |
354 |
> |
* @param a rotation matrix to be set |
355 |
> |
* @param snapshotNo |
356 |
> |
* @see #getA |
357 |
> |
*/ |
358 |
> |
virtual void setA(const RotMat3x3d& a, int snapshotNo) { |
359 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a; |
360 |
> |
} |
361 |
|
|
362 |
< |
/** |
363 |
< |
* Returns the previous angular momentum of this stuntdouble (body-fixed). |
364 |
< |
* @return the angular momentum of this stuntdouble |
365 |
< |
*/ |
366 |
< |
Vector3d getPrevJ() { |
367 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_]; |
368 |
< |
} |
362 |
> |
/** |
363 |
> |
* Returns the previous angular momentum of this stuntDouble (body-fixed). |
364 |
> |
* @return the angular momentum of this stuntDouble |
365 |
> |
*/ |
366 |
> |
Vector3d getPrevJ() { |
367 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_]; |
368 |
> |
} |
369 |
|
|
370 |
< |
/** |
371 |
< |
* Returns the current angular momentum of this stuntdouble (body -fixed). |
372 |
< |
* @return the angular momentum of this stuntdouble |
373 |
< |
*/ |
374 |
< |
Vector3d getJ() { |
375 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_]; |
376 |
< |
} |
370 |
> |
/** |
371 |
> |
* Returns the current angular momentum of this stuntDouble (body -fixed). |
372 |
> |
* @return the angular momentum of this stuntDouble |
373 |
> |
*/ |
374 |
> |
Vector3d getJ() { |
375 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_]; |
376 |
> |
} |
377 |
|
|
378 |
< |
/** |
379 |
< |
* Returns the angular momentum of this stuntdouble in specified snapshot (body-fixed). |
380 |
< |
* @return the angular momentum of this stuntdouble |
381 |
< |
* @param snapshotNo |
382 |
< |
*/ |
383 |
< |
Vector3d getJ(int snapshotNo) { |
384 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_]; |
385 |
< |
} |
378 |
> |
/** |
379 |
> |
* Returns the angular momentum of this stuntDouble in specified snapshot (body-fixed). |
380 |
> |
* @return the angular momentum of this stuntDouble |
381 |
> |
* @param snapshotNo |
382 |
> |
*/ |
383 |
> |
Vector3d getJ(int snapshotNo) { |
384 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_]; |
385 |
> |
} |
386 |
|
|
387 |
< |
/** |
388 |
< |
* Sets the previous angular momentum of this stuntdouble (body-fixed). |
389 |
< |
* @param angMom new angular momentum |
390 |
< |
* @see #getJ |
391 |
< |
*/ |
392 |
< |
void setPrevJ(const Vector3d& angMom) { |
393 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
394 |
< |
} |
387 |
> |
/** |
388 |
> |
* Sets the previous angular momentum of this stuntDouble (body-fixed). |
389 |
> |
* @param angMom new angular momentum |
390 |
> |
* @see #getJ |
391 |
> |
*/ |
392 |
> |
void setPrevJ(const Vector3d& angMom) { |
393 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
394 |
> |
} |
395 |
|
|
396 |
< |
/** |
397 |
< |
* Sets the current angular momentum of this stuntdouble (body-fixed). |
398 |
< |
* @param angMom new angular momentum |
399 |
< |
*/ |
400 |
< |
void setJ(const Vector3d& angMom) { |
401 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
402 |
< |
} |
396 |
> |
/** |
397 |
> |
* Sets the current angular momentum of this stuntDouble (body-fixed). |
398 |
> |
* @param angMom new angular momentum |
399 |
> |
*/ |
400 |
> |
void setJ(const Vector3d& angMom) { |
401 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
402 |
> |
} |
403 |
|
|
404 |
< |
/** |
405 |
< |
* Sets the angular momentum of this stuntdouble in specified snapshot(body-fixed). |
406 |
< |
* @param angMom angular momentum to be set |
407 |
< |
* @param snapshotNo |
408 |
< |
* @see #getJ |
409 |
< |
*/ |
410 |
< |
void setJ(const Vector3d& angMom, int snapshotNo) { |
411 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom; |
412 |
< |
} |
413 |
< |
|
414 |
< |
/** |
415 |
< |
* Returns the previous quaternion of this stuntdouble |
416 |
< |
* @return the quaternion of this stuntdouble |
417 |
< |
*/ |
418 |
< |
Quat4d getPrevQ() { |
419 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
420 |
< |
} |
404 |
> |
/** |
405 |
> |
* Sets the angular momentum of this stuntDouble in specified snapshot(body-fixed). |
406 |
> |
* @param angMom angular momentum to be set |
407 |
> |
* @param snapshotNo |
408 |
> |
* @see #getJ |
409 |
> |
*/ |
410 |
> |
void setJ(const Vector3d& angMom, int snapshotNo) { |
411 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom; |
412 |
> |
} |
413 |
> |
|
414 |
> |
/** |
415 |
> |
* Returns system Center of Mass for stuntDouble frame from snapshot |
416 |
> |
* |
417 |
> |
*/ |
418 |
> |
Vector3d getCOM(){ |
419 |
> |
return (snapshotMan_->getCurrentSnapshot())->getCOM(); |
420 |
> |
} |
421 |
> |
|
422 |
> |
/** |
423 |
> |
* Returns system Center of Mass velocity for stuntDouble frame from snapshot |
424 |
> |
* |
425 |
> |
*/ |
426 |
> |
|
427 |
> |
Vector3d getCOMvel(){ |
428 |
> |
return (snapshotMan_->getCurrentSnapshot())->getCOMvel(); |
429 |
> |
} |
430 |
> |
|
431 |
> |
/** |
432 |
> |
* Returns system Center of Mass angular momentum for stuntDouble frame from snapshot |
433 |
> |
* |
434 |
> |
*/ |
435 |
> |
Vector3d getCOMw(){ |
436 |
> |
return (snapshotMan_->getCurrentSnapshot())->getCOMw(); |
437 |
> |
} |
438 |
> |
|
439 |
> |
/** |
440 |
> |
* Returns system Center of Mass for stuntDouble frame from snapshot |
441 |
> |
* |
442 |
> |
*/ |
443 |
> |
Vector3d getCOM(int snapshotNo){ |
444 |
> |
return (snapshotMan_->getSnapshot(snapshotNo))->getCOM(); |
445 |
> |
} |
446 |
> |
|
447 |
> |
/** |
448 |
> |
* Returns system Center of Mass velocity for stuntDouble frame from snapshot |
449 |
> |
* |
450 |
> |
*/ |
451 |
> |
|
452 |
> |
Vector3d getCOMvel(int snapshotNo){ |
453 |
> |
return (snapshotMan_->getSnapshot(snapshotNo))->getCOMvel(); |
454 |
> |
} |
455 |
> |
|
456 |
> |
/** |
457 |
> |
* Returns system Center of Mass angular momentum for stuntDouble frame from snapshot |
458 |
> |
* |
459 |
> |
*/ |
460 |
> |
Vector3d getCOMw(int snapshotNo){ |
461 |
> |
return (snapshotMan_->getSnapshot(snapshotNo))->getCOMw(); |
462 |
> |
} |
463 |
> |
|
464 |
> |
/** |
465 |
> |
* Returns the previous quaternion of this stuntDouble |
466 |
> |
* @return the quaternion of this stuntDouble |
467 |
> |
*/ |
468 |
> |
Quat4d getPrevQ() { |
469 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
470 |
> |
} |
471 |
|
|
472 |
< |
/** |
473 |
< |
* Returns the current quaternion of this stuntdouble |
474 |
< |
* @return the quaternion of this stuntdouble |
475 |
< |
*/ |
476 |
< |
Quat4d getQ() { |
477 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
478 |
< |
} |
472 |
> |
/** |
473 |
> |
* Returns the current quaternion of this stuntDouble |
474 |
> |
* @return the quaternion of this stuntDouble |
475 |
> |
*/ |
476 |
> |
Quat4d getQ() { |
477 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
478 |
> |
} |
479 |
|
|
480 |
< |
/** |
481 |
< |
* Returns the quaternion of this stuntdouble in specified snapshot |
482 |
< |
* @return the quaternion of this stuntdouble |
483 |
< |
* @param snapshotNo |
484 |
< |
*/ |
485 |
< |
Quat4d getQ(int snapshotNo) { |
486 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toQuaternion(); |
487 |
< |
} |
480 |
> |
/** |
481 |
> |
* Returns the quaternion of this stuntDouble in specified snapshot |
482 |
> |
* @return the quaternion of this stuntDouble |
483 |
> |
* @param snapshotNo |
484 |
> |
*/ |
485 |
> |
Quat4d getQ(int snapshotNo) { |
486 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toQuaternion(); |
487 |
> |
} |
488 |
|
|
489 |
< |
/** |
490 |
< |
* Sets the previous quaternion of this stuntdouble |
491 |
< |
* @param q new quaternion |
492 |
< |
* @note actual storage data is rotation matrix |
493 |
< |
*/ |
494 |
< |
void setPrevQ(const Quat4d& q) { |
495 |
< |
setPrevA(q); |
496 |
< |
} |
489 |
> |
/** |
490 |
> |
* Sets the previous quaternion of this stuntDouble |
491 |
> |
* @param q new quaternion |
492 |
> |
* @note actual storage data is rotation matrix |
493 |
> |
*/ |
494 |
> |
void setPrevQ(const Quat4d& q) { |
495 |
> |
setPrevA(q); |
496 |
> |
} |
497 |
|
|
498 |
< |
/** |
499 |
< |
* Sets the current quaternion of this stuntdouble |
500 |
< |
* @param q new quaternion |
501 |
< |
* @note actual storage data is rotation matrix |
502 |
< |
*/ |
503 |
< |
void setQ(const Quat4d& q) { |
504 |
< |
setA(q); |
505 |
< |
} |
498 |
> |
/** |
499 |
> |
* Sets the current quaternion of this stuntDouble |
500 |
> |
* @param q new quaternion |
501 |
> |
* @note actual storage data is rotation matrix |
502 |
> |
*/ |
503 |
> |
void setQ(const Quat4d& q) { |
504 |
> |
setA(q); |
505 |
> |
} |
506 |
|
|
507 |
< |
/** |
508 |
< |
* Sets the quaternion of this stuntdouble in specified snapshot |
509 |
< |
* |
510 |
< |
* @param q quaternion to be set |
511 |
< |
* @param snapshotNo |
512 |
< |
* @note actual storage data is rotation matrix |
513 |
< |
*/ |
514 |
< |
void setQ(const Quat4d& q, int snapshotNo) { |
515 |
< |
setA(q, snapshotNo); |
516 |
< |
} |
507 |
> |
/** |
508 |
> |
* Sets the quaternion of this stuntDouble in specified snapshot |
509 |
> |
* |
510 |
> |
* @param q quaternion to be set |
511 |
> |
* @param snapshotNo |
512 |
> |
* @note actual storage data is rotation matrix |
513 |
> |
*/ |
514 |
> |
void setQ(const Quat4d& q, int snapshotNo) { |
515 |
> |
setA(q, snapshotNo); |
516 |
> |
} |
517 |
|
|
518 |
< |
/** |
519 |
< |
* Returns the previous euler angles of this stuntdouble |
520 |
< |
* @return the euler angles of this stuntdouble |
521 |
< |
*/ |
522 |
< |
Vector3d getPrevEuler() { |
523 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
524 |
< |
} |
518 |
> |
/** |
519 |
> |
* Returns the previous euler angles of this stuntDouble |
520 |
> |
* @return the euler angles of this stuntDouble |
521 |
> |
*/ |
522 |
> |
Vector3d getPrevEuler() { |
523 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
524 |
> |
} |
525 |
|
|
526 |
< |
/** |
527 |
< |
* Returns the current euler angles of this stuntdouble |
528 |
< |
* @return the euler angles of this stuntdouble |
529 |
< |
*/ |
530 |
< |
Vector3d getEuler() { |
531 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
532 |
< |
} |
526 |
> |
/** |
527 |
> |
* Returns the current euler angles of this stuntDouble |
528 |
> |
* @return the euler angles of this stuntDouble |
529 |
> |
*/ |
530 |
> |
Vector3d getEuler() { |
531 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
532 |
> |
} |
533 |
|
|
534 |
< |
/** |
535 |
< |
* Returns the euler angles of this stuntdouble in specified snapshot. |
536 |
< |
* @return the euler angles of this stuntdouble |
537 |
< |
* @param snapshotNo |
538 |
< |
*/ |
539 |
< |
Vector3d getEuler(int snapshotNo) { |
540 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toEulerAngles(); |
541 |
< |
} |
534 |
> |
/** |
535 |
> |
* Returns the euler angles of this stuntDouble in specified snapshot. |
536 |
> |
* @return the euler angles of this stuntDouble |
537 |
> |
* @param snapshotNo |
538 |
> |
*/ |
539 |
> |
Vector3d getEuler(int snapshotNo) { |
540 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toEulerAngles(); |
541 |
> |
} |
542 |
|
|
543 |
< |
/** |
544 |
< |
* Sets the previous euler angles of this stuntdouble. |
545 |
< |
* @param euler new euler angles |
546 |
< |
* @see #getEuler |
547 |
< |
* @note actual storage data is rotation matrix |
548 |
< |
*/ |
549 |
< |
void setPrevEuler(const Vector3d& euler) { |
550 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = euler; |
551 |
< |
} |
543 |
> |
/** |
544 |
> |
* Sets the previous euler angles of this stuntDouble. |
545 |
> |
* @param euler new euler angles |
546 |
> |
* @see #getEuler |
547 |
> |
* @note actual storage data is rotation matrix |
548 |
> |
*/ |
549 |
> |
void setPrevEuler(const Vector3d& euler) { |
550 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = euler; |
551 |
> |
} |
552 |
|
|
553 |
< |
/** |
554 |
< |
* Sets the current euler angles of this stuntdouble |
555 |
< |
* @param euler new euler angles |
556 |
< |
*/ |
557 |
< |
void setEuler(const Vector3d& euler) { |
558 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = euler; |
559 |
< |
} |
553 |
> |
/** |
554 |
> |
* Sets the current euler angles of this stuntDouble |
555 |
> |
* @param euler new euler angles |
556 |
> |
*/ |
557 |
> |
void setEuler(const Vector3d& euler) { |
558 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = euler; |
559 |
> |
} |
560 |
|
|
561 |
< |
/** |
562 |
< |
* Sets the euler angles of this stuntdouble in specified snapshot |
563 |
< |
* |
564 |
< |
* @param euler euler angles to be set |
565 |
< |
* @param snapshotNo |
566 |
< |
* @note actual storage data is rotation matrix |
567 |
< |
*/ |
568 |
< |
void setEuler(const Vector3d& euler, int snapshotNo) { |
569 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = euler; |
570 |
< |
} |
479 |
< |
|
480 |
< |
/** |
481 |
< |
* Returns the previous unit vectors of this stuntdouble |
482 |
< |
* @return the unit vectors of this stuntdouble |
483 |
< |
*/ |
484 |
< |
RotMat3x3d getPrevElectroFrame() { |
485 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_]; |
486 |
< |
} |
487 |
< |
|
488 |
< |
/** |
489 |
< |
* Returns the current unit vectors of this stuntdouble |
490 |
< |
* @return the unit vectors of this stuntdouble |
491 |
< |
*/ |
492 |
< |
RotMat3x3d getElectroFrame() { |
493 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_]; |
494 |
< |
} |
561 |
> |
/** |
562 |
> |
* Sets the euler angles of this stuntDouble in specified snapshot |
563 |
> |
* |
564 |
> |
* @param euler euler angles to be set |
565 |
> |
* @param snapshotNo |
566 |
> |
* @note actual storage data is rotation matrix |
567 |
> |
*/ |
568 |
> |
void setEuler(const Vector3d& euler, int snapshotNo) { |
569 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = euler; |
570 |
> |
} |
571 |
|
|
572 |
< |
/** |
573 |
< |
* Returns the unit vectors of this stuntdouble in specified snapshot |
574 |
< |
* |
575 |
< |
* @return the unit vectors of this stuntdouble |
576 |
< |
* @param snapshotNo |
577 |
< |
*/ |
578 |
< |
RotMat3x3d getElectroFrame(int snapshotNo) { |
579 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electroFrame[localIndex_]; |
580 |
< |
} |
572 |
> |
/** |
573 |
> |
* Returns the previous dipole vector of this stuntDouble |
574 |
> |
* @return the dipole vector of this stuntDouble |
575 |
> |
*/ |
576 |
> |
Vector3d getPrevDipole() { |
577 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).dipole[localIndex_]; |
578 |
> |
} |
579 |
> |
|
580 |
> |
/** |
581 |
> |
* Returns the current dipole vector of this stuntDouble |
582 |
> |
* @return the dipole vector of this stuntDouble |
583 |
> |
*/ |
584 |
> |
Vector3d getDipole() { |
585 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).dipole[localIndex_]; |
586 |
> |
} |
587 |
> |
|
588 |
> |
/** |
589 |
> |
* Returns the dipole vector of this stuntDouble in specified snapshot |
590 |
> |
* |
591 |
> |
* @return the dipole vector of this stuntDouble |
592 |
> |
* @param snapshotNo |
593 |
> |
*/ |
594 |
> |
Vector3d getDipole(int snapshotNo) { |
595 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).dipole[localIndex_]; |
596 |
> |
} |
597 |
|
|
598 |
< |
/** |
599 |
< |
* Returns the previous force of this stuntdouble |
600 |
< |
* @return the force of this stuntdouble |
601 |
< |
*/ |
602 |
< |
Vector3d getPrevFrc() { |
603 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_]; |
604 |
< |
} |
598 |
> |
|
599 |
> |
/** |
600 |
> |
* Returns the previous quadrupole tensor of this stuntDouble |
601 |
> |
* @return the quadrupole tensor of this stuntDouble |
602 |
> |
*/ |
603 |
> |
Mat3x3d getPrevQuadrupole() { |
604 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).quadrupole[localIndex_]; |
605 |
> |
} |
606 |
> |
|
607 |
> |
/** |
608 |
> |
* Returns the current quadrupole tensor of this stuntDouble |
609 |
> |
* @return the quadrupole tensor of this stuntDouble |
610 |
> |
*/ |
611 |
> |
Mat3x3d getQuadrupole() { |
612 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).quadrupole[localIndex_]; |
613 |
> |
} |
614 |
> |
|
615 |
> |
/** |
616 |
> |
* Returns the quadrupole tensor of this stuntDouble in specified snapshot |
617 |
> |
* |
618 |
> |
* @return the quadrupole tensor of this stuntDouble |
619 |
> |
* @param snapshotNo |
620 |
> |
*/ |
621 |
> |
Mat3x3d getQuadrupole(int snapshotNo) { |
622 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).quadrupole[localIndex_]; |
623 |
> |
} |
624 |
> |
|
625 |
> |
/** |
626 |
> |
* Returns the previous force of this stuntDouble |
627 |
> |
* @return the force of this stuntDouble |
628 |
> |
*/ |
629 |
> |
Vector3d getPrevFrc() { |
630 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_]; |
631 |
> |
} |
632 |
|
|
633 |
< |
/** |
634 |
< |
* Returns the current force of this stuntdouble |
635 |
< |
* @return the force of this stuntdouble |
636 |
< |
*/ |
637 |
< |
Vector3d getFrc() { |
638 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_]; |
639 |
< |
} |
633 |
> |
/** |
634 |
> |
* Returns the current force of this stuntDouble |
635 |
> |
* @return the force of this stuntDouble |
636 |
> |
*/ |
637 |
> |
Vector3d getFrc() { |
638 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_]; |
639 |
> |
} |
640 |
|
|
641 |
< |
/** |
642 |
< |
* Returns the force of this stuntdouble in specified snapshot |
643 |
< |
* |
644 |
< |
* @return the force of this stuntdouble |
645 |
< |
* @param snapshotNo |
646 |
< |
*/ |
647 |
< |
Vector3d getFrc(int snapshotNo) { |
648 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_]; |
649 |
< |
} |
641 |
> |
/** |
642 |
> |
* Returns the force of this stuntDouble in specified snapshot |
643 |
> |
* |
644 |
> |
* @return the force of this stuntDouble |
645 |
> |
* @param snapshotNo |
646 |
> |
*/ |
647 |
> |
Vector3d getFrc(int snapshotNo) { |
648 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_]; |
649 |
> |
} |
650 |
|
|
651 |
< |
/** |
652 |
< |
* Sets the previous force of this stuntdouble |
653 |
< |
* |
654 |
< |
* @param frc new force |
655 |
< |
* @see #getFrc |
656 |
< |
*/ |
657 |
< |
void setPrevFrc(const Vector3d& frc) { |
658 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] = frc; |
659 |
< |
} |
651 |
> |
/** |
652 |
> |
* Sets the previous force of this stuntDouble |
653 |
> |
* |
654 |
> |
* @param frc new force |
655 |
> |
* @see #getFrc |
656 |
> |
*/ |
657 |
> |
void setPrevFrc(const Vector3d& frc) { |
658 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] = frc; |
659 |
> |
} |
660 |
|
|
661 |
< |
/** |
662 |
< |
* Sets the current force of this stuntdouble |
663 |
< |
* @param frc new force |
664 |
< |
*/ |
665 |
< |
void setFrc(const Vector3d& frc) { |
666 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] = frc; |
667 |
< |
} |
661 |
> |
/** |
662 |
> |
* Sets the current force of this stuntDouble |
663 |
> |
* @param frc new force |
664 |
> |
*/ |
665 |
> |
void setFrc(const Vector3d& frc) { |
666 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] = frc; |
667 |
> |
} |
668 |
|
|
669 |
< |
/** |
670 |
< |
* Sets the force of this stuntdouble in specified snapshot |
671 |
< |
* |
672 |
< |
* @param frc force to be set |
673 |
< |
* @param snapshotNo |
674 |
< |
* @see #getFrc |
675 |
< |
*/ |
676 |
< |
void setFrc(const Vector3d& frc, int snapshotNo) { |
677 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] = frc; |
678 |
< |
} |
669 |
> |
/** |
670 |
> |
* Sets the force of this stuntDouble in specified snapshot |
671 |
> |
* |
672 |
> |
* @param frc force to be set |
673 |
> |
* @param snapshotNo |
674 |
> |
* @see #getFrc |
675 |
> |
*/ |
676 |
> |
void setFrc(const Vector3d& frc, int snapshotNo) { |
677 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] = frc; |
678 |
> |
} |
679 |
|
|
680 |
< |
/** |
681 |
< |
* Adds force into the previous force of this stuntdouble |
682 |
< |
* |
683 |
< |
* @param frc new force |
684 |
< |
* @see #getFrc |
685 |
< |
*/ |
686 |
< |
void addPrevFrc(const Vector3d& frc) { |
687 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] += frc; |
688 |
< |
} |
680 |
> |
/** |
681 |
> |
* Adds force into the previous force of this stuntDouble |
682 |
> |
* |
683 |
> |
* @param frc new force |
684 |
> |
* @see #getFrc |
685 |
> |
*/ |
686 |
> |
void addPrevFrc(const Vector3d& frc) { |
687 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] += frc; |
688 |
> |
} |
689 |
|
|
690 |
< |
/** |
691 |
< |
* Adds force into the current force of this stuntdouble |
692 |
< |
* @param frc new force |
693 |
< |
*/ |
694 |
< |
void addFrc(const Vector3d& frc) { |
695 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] += frc; |
696 |
< |
} |
690 |
> |
/** |
691 |
> |
* Adds force into the current force of this stuntDouble |
692 |
> |
* @param frc new force |
693 |
> |
*/ |
694 |
> |
void addFrc(const Vector3d& frc) { |
695 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] += frc; |
696 |
> |
} |
697 |
|
|
698 |
< |
/** |
699 |
< |
* Adds force into the force of this stuntdouble in specified snapshot |
700 |
< |
* |
701 |
< |
* @param frc force to be set |
702 |
< |
* @param snapshotNo |
703 |
< |
* @see #getFrc |
704 |
< |
*/ |
705 |
< |
void addFrc(const Vector3d& frc, int snapshotNo) { |
706 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] += frc; |
707 |
< |
} |
698 |
> |
/** |
699 |
> |
* Adds force into the force of this stuntDouble in specified snapshot |
700 |
> |
* |
701 |
> |
* @param frc force to be set |
702 |
> |
* @param snapshotNo |
703 |
> |
* @see #getFrc |
704 |
> |
*/ |
705 |
> |
void addFrc(const Vector3d& frc, int snapshotNo) { |
706 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] += frc; |
707 |
> |
} |
708 |
|
|
709 |
< |
/** |
710 |
< |
* Returns the previous torque of this stuntdouble |
711 |
< |
* @return the torque of this stuntdouble |
712 |
< |
*/ |
713 |
< |
Vector3d getPrevTrq() { |
714 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_]; |
715 |
< |
} |
709 |
> |
/** |
710 |
> |
* Returns the previous torque of this stuntDouble |
711 |
> |
* @return the torque of this stuntDouble |
712 |
> |
*/ |
713 |
> |
Vector3d getPrevTrq() { |
714 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_]; |
715 |
> |
} |
716 |
|
|
717 |
< |
/** |
718 |
< |
* Returns the current torque of this stuntdouble |
719 |
< |
* @return the torque of this stuntdouble |
720 |
< |
*/ |
721 |
< |
Vector3d getTrq() { |
722 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_]; |
723 |
< |
} |
717 |
> |
/** |
718 |
> |
* Returns the current torque of this stuntDouble |
719 |
> |
* @return the torque of this stuntDouble |
720 |
> |
*/ |
721 |
> |
Vector3d getTrq() { |
722 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_]; |
723 |
> |
} |
724 |
|
|
725 |
< |
/** |
726 |
< |
* Returns the torque of this stuntdouble in specified snapshot |
727 |
< |
* |
728 |
< |
* @return the torque of this stuntdouble |
729 |
< |
* @param snapshotNo |
730 |
< |
*/ |
731 |
< |
Vector3d getTrq(int snapshotNo) { |
732 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_]; |
733 |
< |
} |
725 |
> |
/** |
726 |
> |
* Returns the torque of this stuntDouble in specified snapshot |
727 |
> |
* |
728 |
> |
* @return the torque of this stuntDouble |
729 |
> |
* @param snapshotNo |
730 |
> |
*/ |
731 |
> |
Vector3d getTrq(int snapshotNo) { |
732 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_]; |
733 |
> |
} |
734 |
|
|
735 |
< |
/** |
736 |
< |
* Sets the previous torque of this stuntdouble |
737 |
< |
* |
738 |
< |
* @param trq new torque |
739 |
< |
* @see #getTrq |
740 |
< |
*/ |
741 |
< |
void setPrevTrq(const Vector3d& trq) { |
742 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] = trq; |
743 |
< |
} |
735 |
> |
/** |
736 |
> |
* Sets the previous torque of this stuntDouble |
737 |
> |
* |
738 |
> |
* @param trq new torque |
739 |
> |
* @see #getTrq |
740 |
> |
*/ |
741 |
> |
void setPrevTrq(const Vector3d& trq) { |
742 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] = trq; |
743 |
> |
} |
744 |
|
|
745 |
< |
/** |
746 |
< |
* Sets the current torque of this stuntdouble |
747 |
< |
* @param trq new torque |
748 |
< |
*/ |
749 |
< |
void setTrq(const Vector3d& trq) { |
750 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] = trq; |
751 |
< |
} |
745 |
> |
/** |
746 |
> |
* Sets the current torque of this stuntDouble |
747 |
> |
* @param trq new torque |
748 |
> |
*/ |
749 |
> |
void setTrq(const Vector3d& trq) { |
750 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] = trq; |
751 |
> |
} |
752 |
|
|
753 |
< |
/** |
754 |
< |
* Sets the torque of this stuntdouble in specified snapshot |
755 |
< |
* |
756 |
< |
* @param trq torque to be set |
757 |
< |
* @param snapshotNo |
758 |
< |
* @see #getTrq |
759 |
< |
*/ |
760 |
< |
void setTrq(const Vector3d& trq, int snapshotNo) { |
761 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] = trq; |
762 |
< |
} |
753 |
> |
/** |
754 |
> |
* Sets the torque of this stuntDouble in specified snapshot |
755 |
> |
* |
756 |
> |
* @param trq torque to be set |
757 |
> |
* @param snapshotNo |
758 |
> |
* @see #getTrq |
759 |
> |
*/ |
760 |
> |
void setTrq(const Vector3d& trq, int snapshotNo) { |
761 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] = trq; |
762 |
> |
} |
763 |
|
|
764 |
< |
/** |
765 |
< |
* Adds torque into the previous torque of this stuntdouble |
766 |
< |
* |
767 |
< |
* @param trq new torque |
768 |
< |
* @see #getTrq |
769 |
< |
*/ |
770 |
< |
void addPrevTrq(const Vector3d& trq) { |
771 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] += trq; |
772 |
< |
} |
764 |
> |
/** |
765 |
> |
* Adds torque into the previous torque of this stuntDouble |
766 |
> |
* |
767 |
> |
* @param trq new torque |
768 |
> |
* @see #getTrq |
769 |
> |
*/ |
770 |
> |
void addPrevTrq(const Vector3d& trq) { |
771 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] += trq; |
772 |
> |
} |
773 |
|
|
774 |
< |
/** |
775 |
< |
* Adds torque into the current torque of this stuntdouble |
776 |
< |
* @param trq new torque |
777 |
< |
*/ |
778 |
< |
void addTrq(const Vector3d& trq) { |
779 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] += trq; |
780 |
< |
} |
774 |
> |
/** |
775 |
> |
* Adds torque into the current torque of this stuntDouble |
776 |
> |
* @param trq new torque |
777 |
> |
*/ |
778 |
> |
void addTrq(const Vector3d& trq) { |
779 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] += trq; |
780 |
> |
} |
781 |
|
|
782 |
< |
/** |
783 |
< |
* Adds torque into the torque of this stuntdouble in specified snapshot |
784 |
< |
* |
785 |
< |
* @param trq torque to be add |
786 |
< |
* @param snapshotNo |
787 |
< |
* @see #getTrq |
788 |
< |
*/ |
789 |
< |
void addTrq(const Vector3d& trq, int snapshotNo) { |
790 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] += trq; |
791 |
< |
} |
782 |
> |
/** |
783 |
> |
* Adds torque into the torque of this stuntDouble in specified snapshot |
784 |
> |
* |
785 |
> |
* @param trq torque to be add |
786 |
> |
* @param snapshotNo |
787 |
> |
* @see #getTrq |
788 |
> |
*/ |
789 |
> |
void addTrq(const Vector3d& trq, int snapshotNo) { |
790 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] += trq; |
791 |
> |
} |
792 |
|
|
793 |
|
|
675 |
– |
/** |
676 |
– |
* Returns the previous z-angle of this stuntdouble |
677 |
– |
* @return the z-angle of this stuntdouble |
678 |
– |
*/ |
679 |
– |
double getPrevZangle() { |
680 |
– |
return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_]; |
681 |
– |
} |
682 |
– |
|
683 |
– |
/** |
684 |
– |
* Returns the current z-angle of this stuntdouble |
685 |
– |
* @return the z-angle of this stuntdouble |
686 |
– |
*/ |
687 |
– |
double getZangle() { |
688 |
– |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_]; |
689 |
– |
} |
794 |
|
|
795 |
< |
/** |
796 |
< |
* Returns the z-angle of this stuntdouble in specified snapshot |
797 |
< |
* @return the z-angle of this stuntdouble |
798 |
< |
* @param snapshotNo |
799 |
< |
*/ |
800 |
< |
double getZangle(int snapshotNo) { |
801 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_]; |
698 |
< |
} |
699 |
< |
|
700 |
< |
/** |
701 |
< |
* Sets the previous z-angle of this stuntdouble |
702 |
< |
* @param angle new z-angle |
703 |
< |
* @see #getZangle |
704 |
< |
*/ |
705 |
< |
void setPrevZangle(double angle) { |
706 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle; |
707 |
< |
} |
795 |
> |
/** |
796 |
> |
* Returns the previous particlePot of this stuntDouble |
797 |
> |
* @return the particlePot of this stuntDouble |
798 |
> |
*/ |
799 |
> |
RealType getPrevParticlePot() { |
800 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_]; |
801 |
> |
} |
802 |
|
|
803 |
< |
/** |
804 |
< |
* Sets the current z-angle of this stuntdouble |
805 |
< |
* @param angle new z-angle |
806 |
< |
*/ |
807 |
< |
void setZangle(double angle) { |
808 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle; |
809 |
< |
} |
803 |
> |
/** |
804 |
> |
* Returns the current particlePot of this stuntDouble |
805 |
> |
* @return the particlePot of this stuntDouble |
806 |
> |
*/ |
807 |
> |
RealType getParticlePot() { |
808 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_]; |
809 |
> |
} |
810 |
|
|
811 |
< |
/** |
812 |
< |
* Sets the z-angle of this stuntdouble in specified snapshot |
813 |
< |
* @param angle z-angle to be set |
814 |
< |
* @param snapshotNo |
815 |
< |
* @see #getZangle |
816 |
< |
*/ |
817 |
< |
void setZangle(double angle, int snapshotNo) { |
818 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle; |
819 |
< |
} |
811 |
> |
/** |
812 |
> |
* Returns the particlePot of this stuntDouble in specified snapshot |
813 |
> |
* |
814 |
> |
* @return the particlePot of this stuntDouble |
815 |
> |
* @param snapshotNo |
816 |
> |
*/ |
817 |
> |
RealType getParticlePot(int snapshotNo) { |
818 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_]; |
819 |
> |
} |
820 |
|
|
821 |
< |
/** |
822 |
< |
* Adds z-angle into the previous z-angle of this stuntdouble |
823 |
< |
* @param angle new z-angle |
824 |
< |
* @see #getZangle |
825 |
< |
*/ |
826 |
< |
void addPrevZangle(double angle) { |
827 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle; |
828 |
< |
} |
821 |
> |
/** |
822 |
> |
* Sets the previous particlePot of this stuntDouble |
823 |
> |
* |
824 |
> |
* @param particlePot new particlePot |
825 |
> |
* @see #getParticlePot |
826 |
> |
*/ |
827 |
> |
void setPrevParticlePot(const RealType& particlePot) { |
828 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] = particlePot; |
829 |
> |
} |
830 |
|
|
831 |
< |
/** |
832 |
< |
* Adds z-angle into the current z-angle of this stuntdouble |
833 |
< |
* @param angle new z-angle |
834 |
< |
*/ |
835 |
< |
void addZangle(double angle) { |
836 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle; |
837 |
< |
} |
831 |
> |
/** |
832 |
> |
* Sets the current particlePot of this stuntDouble |
833 |
> |
* @param particlePot new particlePot |
834 |
> |
*/ |
835 |
> |
void setParticlePot(const RealType& particlePot) { |
836 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] = particlePot; |
837 |
> |
} |
838 |
|
|
839 |
< |
/** |
840 |
< |
* Adds z-angle into the z-angle of this stuntdouble in specified snapshot |
841 |
< |
* @param angle z-angle to be add |
842 |
< |
* @param snapshotNo |
843 |
< |
* @see #getZangle |
844 |
< |
*/ |
845 |
< |
void addZangle(double angle, int snapshotNo) { |
846 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle; |
847 |
< |
} |
839 |
> |
/** |
840 |
> |
* Sets the particlePot of this stuntDouble in specified snapshot |
841 |
> |
* |
842 |
> |
* @param particlePot particlePot to be set |
843 |
> |
* @param snapshotNo |
844 |
> |
* @see #getParticlePot |
845 |
> |
*/ |
846 |
> |
void setParticlePot(const RealType& particlePot, int snapshotNo) { |
847 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] = particlePot; |
848 |
> |
} |
849 |
|
|
850 |
< |
/** Set the force of this stuntdouble to zero */ |
851 |
< |
void zeroForcesAndTorques(); |
852 |
< |
/** |
853 |
< |
* Returns the inertia tensor of this stuntdouble |
854 |
< |
* @return the inertia tensor of this stuntdouble |
855 |
< |
*/ |
856 |
< |
virtual Mat3x3d getI() = 0; |
850 |
> |
/** |
851 |
> |
* Adds particlePot into the previous particlePot of this stuntDouble |
852 |
> |
* |
853 |
> |
* @param particlePot new particlePot |
854 |
> |
* @see #getParticlePot |
855 |
> |
*/ |
856 |
> |
void addPrevParticlePot(const RealType& particlePot) { |
857 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] += particlePot; |
858 |
> |
} |
859 |
> |
|
860 |
> |
/** |
861 |
> |
* Adds particlePot into the current particlePot of this stuntDouble |
862 |
> |
* @param particlePot new particlePot |
863 |
> |
*/ |
864 |
> |
void addParticlePot(const RealType& particlePot) { |
865 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] += particlePot; |
866 |
> |
} |
867 |
|
|
868 |
< |
/** |
869 |
< |
* Returns the gradient of this stuntdouble |
870 |
< |
* @return the gradient of this stuntdouble |
871 |
< |
*/ |
872 |
< |
virtual std::vector<double> getGrad() = 0; |
868 |
> |
/** |
869 |
> |
* Adds particlePot into the particlePot of this stuntDouble in specified snapshot |
870 |
> |
* |
871 |
> |
* @param particlePot particlePot to be add |
872 |
> |
* @param snapshotNo |
873 |
> |
* @see #getParticlePot |
874 |
> |
*/ |
875 |
> |
void addParticlePot(const RealType& particlePot, int snapshotNo) { |
876 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] += particlePot; |
877 |
> |
} |
878 |
|
|
879 |
< |
/** |
880 |
< |
* Tests the if this stuntdouble is a linear rigidbody |
881 |
< |
* |
882 |
< |
* @return true if this stuntdouble is a linear rigidbody, otherwise return false |
883 |
< |
* @note atom and directional atom will always return false |
884 |
< |
* |
885 |
< |
* @see #linearAxis |
886 |
< |
*/ |
887 |
< |
bool isLinear() { |
888 |
< |
return linear_; |
889 |
< |
} |
879 |
> |
/** |
880 |
> |
* Returns the previous fluctuating charge of this stuntDouble |
881 |
> |
* @return the fluctuating charge of this stuntDouble |
882 |
> |
*/ |
883 |
> |
RealType getPrevFlucQPos() { |
884 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_]; |
885 |
> |
} |
886 |
> |
|
887 |
> |
/** |
888 |
> |
* Returns the current fluctuating charge of this stuntDouble |
889 |
> |
* @return the fluctuating charge of this stuntDouble |
890 |
> |
*/ |
891 |
> |
RealType getFlucQPos() { |
892 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_]; |
893 |
> |
} |
894 |
|
|
895 |
< |
/** |
896 |
< |
* Returns the linear axis of the rigidbody, atom and directional atom will always return -1 |
897 |
< |
* |
898 |
< |
* @return the linear axis of the rigidbody |
899 |
< |
* |
900 |
< |
* @see #isLinear |
901 |
< |
*/ |
902 |
< |
int linearAxis() { |
788 |
< |
return linearAxis_; |
789 |
< |
} |
895 |
> |
/** |
896 |
> |
* Returns the fluctuating charge of this stuntDouble in specified snapshot |
897 |
> |
* @return the fluctuating charge of this stuntDouble |
898 |
> |
* @param snapshotNo |
899 |
> |
*/ |
900 |
> |
RealType getFlucQPos(int snapshotNo) { |
901 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_]; |
902 |
> |
} |
903 |
|
|
904 |
< |
/** Returns the mass of this stuntdouble */ |
905 |
< |
double getMass() { |
906 |
< |
return mass_; |
907 |
< |
} |
904 |
> |
/** |
905 |
> |
* Sets the previous fluctuating charge of this stuntDouble |
906 |
> |
* @param charge new fluctuating charge |
907 |
> |
* @see #getFlucQPos |
908 |
> |
*/ |
909 |
> |
void setPrevFlucQPos(RealType charge) { |
910 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] = charge; |
911 |
> |
} |
912 |
> |
|
913 |
> |
/** |
914 |
> |
* Sets the current fluctuating charge of this stuntDouble |
915 |
> |
* @param charge new fluctuating charge |
916 |
> |
*/ |
917 |
> |
void setFlucQPos(RealType charge) { |
918 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] = charge; |
919 |
> |
} |
920 |
|
|
921 |
< |
/** |
922 |
< |
* Sets the mass of this stuntdoulbe |
923 |
< |
* @param mass the mass to be set |
924 |
< |
*/ |
925 |
< |
void setMass(double mass) { |
926 |
< |
mass_ = mass; |
927 |
< |
} |
921 |
> |
/** |
922 |
> |
* Sets the fluctuating charge of this stuntDouble in specified snapshot |
923 |
> |
* @param charge fluctuating charge to be set |
924 |
> |
* @param snapshotNo |
925 |
> |
* @see #getFlucQPos |
926 |
> |
*/ |
927 |
> |
void setFlucQPos(RealType charge, int snapshotNo) { |
928 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] = charge; |
929 |
> |
} |
930 |
|
|
931 |
< |
/** Returns the name of this stuntdouble */ |
932 |
< |
virtual std::string getType() = 0; |
933 |
< |
|
934 |
< |
/** Sets the name of this stuntdouble*/ |
935 |
< |
virtual void setType(const std::string& name) {} |
931 |
> |
/** |
932 |
> |
* Adds fluctuating charge into the previous fluctuating charge of this stuntDouble |
933 |
> |
* @param charge new fluctuating charge |
934 |
> |
* @see #getFlucQPos |
935 |
> |
*/ |
936 |
> |
void addPrevFlucQPos(RealType charge) { |
937 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] += charge; |
938 |
> |
} |
939 |
> |
|
940 |
> |
/** |
941 |
> |
* Adds fluctuating charge into the current fluctuating charge of this stuntDouble |
942 |
> |
* @param charge new fluctuating charge |
943 |
> |
*/ |
944 |
> |
void addFlucQPos(RealType charge) { |
945 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] += charge; |
946 |
> |
} |
947 |
|
|
948 |
< |
/** |
949 |
< |
* Converts a lab fixed vector to a body fixed vector. |
950 |
< |
* @return body fixed vector |
951 |
< |
* @param v lab fixed vector |
952 |
< |
*/ |
953 |
< |
Vector3d lab2Body(const Vector3d& v) { |
954 |
< |
return getA() * v; |
955 |
< |
} |
948 |
> |
/** |
949 |
> |
* Adds fluctuating charge into the fluctuating charge of this stuntDouble in specified snapshot |
950 |
> |
* @param charge fluctuating charge to be add |
951 |
> |
* @param snapshotNo |
952 |
> |
* @see #getFlucQPos |
953 |
> |
*/ |
954 |
> |
void addflucQPos(RealType charge, int snapshotNo) { |
955 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] += charge; |
956 |
> |
} |
957 |
> |
|
958 |
> |
|
959 |
> |
/** |
960 |
> |
* Returns the previous charge velocity of this stuntDouble |
961 |
> |
* @return the charge velocity of this stuntDouble |
962 |
> |
*/ |
963 |
> |
RealType getPrevFlucQVel() { |
964 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_]; |
965 |
> |
} |
966 |
> |
|
967 |
> |
/** |
968 |
> |
* Returns the current charge velocity of this stuntDouble |
969 |
> |
* @return the charge velocity of this stuntDouble |
970 |
> |
*/ |
971 |
> |
RealType getFlucQVel() { |
972 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_]; |
973 |
> |
} |
974 |
|
|
975 |
< |
Vector3d lab2Body(const Vector3d& v, int frame) { |
976 |
< |
return getA(frame) * v; |
977 |
< |
} |
975 |
> |
/** |
976 |
> |
* Returns the charge velocity of this stuntDouble in specified snapshot |
977 |
> |
* @return the charge velocity of this stuntDouble |
978 |
> |
* @param snapshotNo |
979 |
> |
*/ |
980 |
> |
RealType getFlucQVel(int snapshotNo) { |
981 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_]; |
982 |
> |
} |
983 |
|
|
984 |
< |
/** |
985 |
< |
* Converts a body fixed vector to a lab fixed vector. |
986 |
< |
* @return corresponding lab fixed vector |
987 |
< |
* @param v body fixed vector |
988 |
< |
*/ |
989 |
< |
Vector3d body2Lab(const Vector3d& v){ |
990 |
< |
return getA().transpose() * v; |
991 |
< |
} |
984 |
> |
/** |
985 |
> |
* Sets the previous charge velocity of this stuntDouble |
986 |
> |
* @param cvel new charge velocity |
987 |
> |
* @see #getFlucQVel |
988 |
> |
*/ |
989 |
> |
void setPrevFlucQVel(RealType cvel) { |
990 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] = cvel; |
991 |
> |
} |
992 |
> |
|
993 |
> |
/** |
994 |
> |
* Sets the current charge velocity of this stuntDouble |
995 |
> |
* @param cvel new charge velocity |
996 |
> |
*/ |
997 |
> |
void setFlucQVel(RealType cvel) { |
998 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] = cvel; |
999 |
> |
} |
1000 |
|
|
1001 |
< |
Vector3d body2Lab(const Vector3d& v, int frame){ |
1002 |
< |
return getA(frame).transpose() * v; |
1003 |
< |
} |
1004 |
< |
/** |
1005 |
< |
* <p> |
1006 |
< |
* The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on |
1007 |
< |
* the elements of a data structure. In this way, you can change the operation being performed |
1008 |
< |
* on a structure without the need of changing the classes of the elements that you are operating |
1009 |
< |
* on. Using a Visitor pattern allows you to decouple the classes for the data structure and the |
841 |
< |
* algorithms used upon them |
842 |
< |
* </p> |
843 |
< |
* @param v visitor |
844 |
< |
*/ |
845 |
< |
virtual void accept(BaseVisitor* v) = 0; |
1001 |
> |
/** |
1002 |
> |
* Sets the charge velocity of this stuntDouble in specified snapshot |
1003 |
> |
* @param cvel charge velocity to be set |
1004 |
> |
* @param snapshotNo |
1005 |
> |
* @see #getFlucQVel |
1006 |
> |
*/ |
1007 |
> |
void setFlucQVel(RealType cvel, int snapshotNo) { |
1008 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] = cvel; |
1009 |
> |
} |
1010 |
|
|
1011 |
< |
//below functions are just forward functions |
1012 |
< |
/** |
1013 |
< |
* Adds property into property map |
1014 |
< |
* @param genData GenericData to be added into PropertyMap |
1015 |
< |
*/ |
1016 |
< |
void addProperty(GenericData* genData); |
1011 |
> |
/** |
1012 |
> |
* Adds charge velocity into the previous charge velocity of this stuntDouble |
1013 |
> |
* @param cvel new charge velocity |
1014 |
> |
* @see #getFlucQVel |
1015 |
> |
*/ |
1016 |
> |
void addPrevFlucQVel(RealType cvel) { |
1017 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] += cvel; |
1018 |
> |
} |
1019 |
> |
|
1020 |
> |
/** |
1021 |
> |
* Adds charge velocity into the current charge velocity of this stuntDouble |
1022 |
> |
* @param cvel new charge velocity |
1023 |
> |
*/ |
1024 |
> |
void addFlucQVel(RealType cvel) { |
1025 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] += cvel; |
1026 |
> |
} |
1027 |
|
|
1028 |
< |
/** |
1029 |
< |
* Removes property from PropertyMap by name |
1030 |
< |
* @param propName the name of property to be removed |
1031 |
< |
*/ |
1032 |
< |
void removeProperty(const std::string& propName); |
1028 |
> |
/** |
1029 |
> |
* Adds charge velocity into the charge velocity of this stuntDouble in specified snapshot |
1030 |
> |
* @param cvel charge velocity to be add |
1031 |
> |
* @param snapshotNo |
1032 |
> |
* @see #getFlucQVel |
1033 |
> |
*/ |
1034 |
> |
void addflucQVel(RealType cvel, int snapshotNo) { |
1035 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] += cvel; |
1036 |
> |
} |
1037 |
|
|
860 |
– |
/** |
861 |
– |
* clear all of the properties |
862 |
– |
*/ |
863 |
– |
void clearProperties(); |
1038 |
|
|
1039 |
< |
/** |
1040 |
< |
* Returns all names of properties |
1041 |
< |
* @return all names of properties |
1042 |
< |
*/ |
1043 |
< |
std::vector<std::string> getPropertyNames(); |
1039 |
> |
/** |
1040 |
> |
* Returns the previous charge force of this stuntDouble |
1041 |
> |
* @return the charge force of this stuntDouble |
1042 |
> |
*/ |
1043 |
> |
RealType getPrevFlucQFrc() { |
1044 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_]; |
1045 |
> |
} |
1046 |
> |
|
1047 |
> |
/** |
1048 |
> |
* Returns the current charge force of this stuntDouble |
1049 |
> |
* @return the charge force of this stuntDouble |
1050 |
> |
*/ |
1051 |
> |
RealType getFlucQFrc() { |
1052 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_]; |
1053 |
> |
} |
1054 |
|
|
1055 |
< |
/** |
1056 |
< |
* Returns all of the properties in PropertyMap |
1057 |
< |
* @return all of the properties in PropertyMap |
1058 |
< |
*/ |
1059 |
< |
std::vector<GenericData*> getProperties(); |
1055 |
> |
/** |
1056 |
> |
* Returns the charge force of this stuntDouble in specified snapshot |
1057 |
> |
* @return the charge force of this stuntDouble |
1058 |
> |
* @param snapshotNo |
1059 |
> |
*/ |
1060 |
> |
RealType getFlucQFrc(int snapshotNo) { |
1061 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_]; |
1062 |
> |
} |
1063 |
|
|
1064 |
< |
/** |
1065 |
< |
* Returns property |
1066 |
< |
* @param propName name of property |
1067 |
< |
* @return a pointer point to property with propName. If no property named propName |
1068 |
< |
* exists, return NULL |
1069 |
< |
*/ |
1070 |
< |
GenericData* getPropertyByName(const std::string& propName); |
1064 |
> |
/** |
1065 |
> |
* Sets the previous charge force of this stuntDouble |
1066 |
> |
* @param cfrc new charge force |
1067 |
> |
* @see #getFlucQFrc |
1068 |
> |
*/ |
1069 |
> |
void setPrevFlucQFrc(RealType cfrc) { |
1070 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc; |
1071 |
> |
} |
1072 |
> |
|
1073 |
> |
/** |
1074 |
> |
* Sets the current charge force of this stuntDouble |
1075 |
> |
* @param cfrc new charge force |
1076 |
> |
*/ |
1077 |
> |
void setFlucQFrc(RealType cfrc) { |
1078 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc; |
1079 |
> |
} |
1080 |
|
|
1081 |
< |
protected: |
1081 |
> |
/** |
1082 |
> |
* Sets the charge force of this stuntDouble in specified snapshot |
1083 |
> |
* @param cfrc charge force to be set |
1084 |
> |
* @param snapshotNo |
1085 |
> |
* @see #getFlucQFrc |
1086 |
> |
*/ |
1087 |
> |
void setFlucQFrc(RealType cfrc, int snapshotNo) { |
1088 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] = cfrc; |
1089 |
> |
} |
1090 |
> |
|
1091 |
> |
/** |
1092 |
> |
* Adds charge force into the previous charge force of this stuntDouble |
1093 |
> |
* @param cfrc charge force to be added |
1094 |
> |
* @see #getFlucQFrc |
1095 |
> |
*/ |
1096 |
> |
void addPrevFlucQFrc(RealType cfrc) { |
1097 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc; |
1098 |
> |
} |
1099 |
> |
|
1100 |
> |
/** |
1101 |
> |
* Adds charge force into the current charge force of this stuntDouble |
1102 |
> |
* @param cfrc charge force to be added |
1103 |
> |
*/ |
1104 |
> |
void addFlucQFrc(RealType cfrc) { |
1105 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc; |
1106 |
> |
} |
1107 |
> |
|
1108 |
> |
/** |
1109 |
> |
* Adds charge force into the charge force of this stuntDouble in specified snapshot |
1110 |
> |
* @param cfrc charge force to be added |
1111 |
> |
* @param snapshotNo |
1112 |
> |
* @see #getFlucQFrc |
1113 |
> |
*/ |
1114 |
> |
void addflucQFrc(RealType cfrc, int snapshotNo) { |
1115 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] += cfrc; |
1116 |
> |
} |
1117 |
> |
|
1118 |
> |
|
1119 |
> |
/** |
1120 |
> |
* Returns the previous electric field of this stuntDouble |
1121 |
> |
* @return the electric field of this stuntDouble |
1122 |
> |
*/ |
1123 |
> |
Vector3d getPrevElectricField() { |
1124 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_]; |
1125 |
> |
} |
1126 |
> |
|
1127 |
> |
/** |
1128 |
> |
* Returns the current electric field of this stuntDouble |
1129 |
> |
* @return the electric field of this stuntDouble |
1130 |
> |
*/ |
1131 |
> |
Vector3d getElectricField() { |
1132 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_]; |
1133 |
> |
} |
1134 |
> |
|
1135 |
> |
/** |
1136 |
> |
* Returns the electric field of this stuntDouble in specified snapshot |
1137 |
> |
* @return the electric field of this stuntDouble |
1138 |
> |
* @param snapshotNo |
1139 |
> |
*/ |
1140 |
> |
Vector3d getElectricField(int snapshotNo) { |
1141 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_]; |
1142 |
> |
} |
1143 |
> |
|
1144 |
> |
/** |
1145 |
> |
* Sets the previous electric field of this stuntDouble |
1146 |
> |
* @param pos new electric field |
1147 |
> |
* @see #getElectricField |
1148 |
> |
*/ |
1149 |
> |
void setPrevElectricField(const Vector3d& pos) { |
1150 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] = pos; |
1151 |
> |
} |
1152 |
> |
|
1153 |
> |
/** |
1154 |
> |
* Sets the current electric field of this stuntDouble |
1155 |
> |
* @param pos new electric field |
1156 |
> |
*/ |
1157 |
> |
void setElectricField(const Vector3d& pos) { |
1158 |
> |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
1159 |
> |
data.electricField[localIndex_] = pos; |
1160 |
> |
//((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] = pos; |
1161 |
> |
} |
1162 |
> |
|
1163 |
> |
/** |
1164 |
> |
* Sets the electric field of this stuntDouble in specified snapshot |
1165 |
> |
* @param pos electric field to be set |
1166 |
> |
* @param snapshotNo |
1167 |
> |
* @see #getElectricField |
1168 |
> |
*/ |
1169 |
> |
void setElectricField(const Vector3d& pos, int snapshotNo) { |
1170 |
> |
|
1171 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] = pos; |
1172 |
> |
|
1173 |
> |
} |
1174 |
> |
|
1175 |
> |
|
1176 |
> |
/** Set the force of this stuntDouble to zero */ |
1177 |
> |
void zeroForcesAndTorques(); |
1178 |
> |
/** |
1179 |
> |
* Returns the inertia tensor of this stuntDouble |
1180 |
> |
* @return the inertia tensor of this stuntDouble |
1181 |
> |
*/ |
1182 |
> |
virtual Mat3x3d getI() = 0; |
1183 |
> |
|
1184 |
> |
/** |
1185 |
> |
* Returns the gradient of this stuntDouble |
1186 |
> |
* @return the gradient of this stuntDouble |
1187 |
> |
*/ |
1188 |
> |
virtual std::vector<RealType> getGrad() = 0; |
1189 |
> |
|
1190 |
> |
/** |
1191 |
> |
* Tests the if this stuntDouble is a linear rigidbody |
1192 |
> |
* |
1193 |
> |
* @return true if this stuntDouble is a linear rigidbody, otherwise return false |
1194 |
> |
* @note atom and directional atom will always return false |
1195 |
> |
* |
1196 |
> |
* @see #linearAxis |
1197 |
> |
*/ |
1198 |
> |
bool isLinear() { |
1199 |
> |
return linear_; |
1200 |
> |
} |
1201 |
> |
|
1202 |
> |
/** |
1203 |
> |
* Returns the linear axis of the rigidbody, atom and directional atom will always return -1 |
1204 |
> |
* |
1205 |
> |
* @return the linear axis of the rigidbody |
1206 |
> |
* |
1207 |
> |
* @see #isLinear |
1208 |
> |
*/ |
1209 |
> |
int linearAxis() { |
1210 |
> |
return linearAxis_; |
1211 |
> |
} |
1212 |
> |
|
1213 |
> |
/** Returns the mass of this stuntDouble */ |
1214 |
> |
RealType getMass() { |
1215 |
> |
return mass_; |
1216 |
> |
} |
1217 |
> |
|
1218 |
> |
/** |
1219 |
> |
* Sets the mass of this stuntdoulbe |
1220 |
> |
* @param mass the mass to be set |
1221 |
> |
*/ |
1222 |
> |
void setMass(RealType mass) { |
1223 |
> |
mass_ = mass; |
1224 |
> |
} |
1225 |
> |
|
1226 |
> |
/** Returns the name of this stuntDouble */ |
1227 |
> |
virtual std::string getType() = 0; |
1228 |
|
|
1229 |
< |
StuntDouble(ObjectType objType, DataStoragePointer storage); |
1229 |
> |
/** Sets the name of this stuntDouble*/ |
1230 |
> |
virtual void setType(const std::string& name) {} |
1231 |
> |
|
1232 |
> |
/** |
1233 |
> |
* Converts a lab fixed vector to a body fixed vector. |
1234 |
> |
* @return body fixed vector |
1235 |
> |
* @param v lab fixed vector |
1236 |
> |
*/ |
1237 |
> |
Vector3d lab2Body(const Vector3d& v) { |
1238 |
> |
return getA() * v; |
1239 |
> |
} |
1240 |
> |
|
1241 |
> |
Vector3d lab2Body(const Vector3d& v, int frame) { |
1242 |
> |
return getA(frame) * v; |
1243 |
> |
} |
1244 |
> |
|
1245 |
> |
/** |
1246 |
> |
* Converts a body fixed vector to a lab fixed vector. |
1247 |
> |
* @return corresponding lab fixed vector |
1248 |
> |
* @param v body fixed vector |
1249 |
> |
*/ |
1250 |
> |
Vector3d body2Lab(const Vector3d& v){ |
1251 |
> |
return getA().transpose() * v; |
1252 |
> |
} |
1253 |
> |
|
1254 |
> |
Vector3d body2Lab(const Vector3d& v, int frame){ |
1255 |
> |
return getA(frame).transpose() * v; |
1256 |
> |
} |
1257 |
> |
|
1258 |
> |
/** |
1259 |
> |
* <p> |
1260 |
> |
* The purpose of the Visitor Pattern is to encapsulate an |
1261 |
> |
* operation that you want to perform on the elements of a data |
1262 |
> |
* structure. In this way, you can change the operation being |
1263 |
> |
* performed on a structure without the need of changing the |
1264 |
> |
* classes of the elements that you are operating on. Using a |
1265 |
> |
* Visitor pattern allows you to decouple the classes for the data |
1266 |
> |
* structure and the algorithms used upon them |
1267 |
> |
* </p> |
1268 |
> |
* @param v visitor |
1269 |
> |
*/ |
1270 |
> |
virtual void accept(BaseVisitor* v) = 0; |
1271 |
> |
|
1272 |
> |
//below functions are just forward functions |
1273 |
> |
/** |
1274 |
> |
* Adds property into property map |
1275 |
> |
* @param genData GenericData to be added into PropertyMap |
1276 |
> |
*/ |
1277 |
> |
void addProperty(GenericData* genData); |
1278 |
> |
|
1279 |
> |
/** |
1280 |
> |
* Removes property from PropertyMap by name |
1281 |
> |
* @param propName the name of property to be removed |
1282 |
> |
*/ |
1283 |
> |
void removeProperty(const std::string& propName); |
1284 |
> |
|
1285 |
> |
/** |
1286 |
> |
* clear all of the properties |
1287 |
> |
*/ |
1288 |
> |
void clearProperties(); |
1289 |
> |
|
1290 |
> |
/** |
1291 |
> |
* Returns all names of properties |
1292 |
> |
* @return all names of properties |
1293 |
> |
*/ |
1294 |
> |
std::vector<std::string> getPropertyNames(); |
1295 |
> |
|
1296 |
> |
/** |
1297 |
> |
* Returns all of the properties in PropertyMap |
1298 |
> |
* @return all of the properties in PropertyMap |
1299 |
> |
*/ |
1300 |
> |
std::vector<GenericData*> getProperties(); |
1301 |
> |
|
1302 |
> |
/** |
1303 |
> |
* Returns property |
1304 |
> |
* @param propName name of property |
1305 |
> |
* @return a pointer point to property with propName. If no property named propName |
1306 |
> |
* exists, return NULL |
1307 |
> |
*/ |
1308 |
> |
GenericData* getPropertyByName(const std::string& propName); |
1309 |
> |
|
1310 |
> |
protected: |
1311 |
|
|
1312 |
< |
StuntDouble(const StuntDouble& sd); |
1313 |
< |
StuntDouble& operator=(const StuntDouble& sd); |
1312 |
> |
StuntDouble(ObjectType objType, DataStoragePointer storage); |
1313 |
> |
|
1314 |
> |
StuntDouble(const StuntDouble& sd); |
1315 |
> |
StuntDouble& operator=(const StuntDouble& sd); |
1316 |
|
|
1317 |
< |
ObjectType objType_; |
1318 |
< |
DataStoragePointer storage_; |
1319 |
< |
SnapshotManager* snapshotMan_; |
1317 |
> |
ObjectType objType_; |
1318 |
> |
DataStoragePointer storage_; |
1319 |
> |
SnapshotManager* snapshotMan_; |
1320 |
|
|
1321 |
< |
bool linear_; |
1322 |
< |
int linearAxis_; |
1321 |
> |
bool linear_; |
1322 |
> |
int linearAxis_; |
1323 |
|
|
1324 |
|
|
1325 |
< |
int globalIndex_; |
1326 |
< |
int localIndex_; |
1325 |
> |
int globalIndex_; |
1326 |
> |
int globalIntegrableObjectIndex_; |
1327 |
> |
int localIndex_; |
1328 |
|
|
1329 |
|
|
1330 |
< |
double mass_; |
1330 |
> |
RealType mass_; |
1331 |
|
|
1332 |
< |
private: |
1332 |
> |
private: |
1333 |
|
|
1334 |
< |
PropertyMap properties_; |
1335 |
< |
}; |
1334 |
> |
PropertyMap properties_; |
1335 |
> |
}; |
1336 |
|
|
1337 |
< |
}//end namespace oopse |
1337 |
> |
}//end namespace OpenMD |
1338 |
|
#endif //PRIMITIVES_STUNTDOUBLE_HPP |