ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/primitives/StuntDouble.hpp
(Generate patch)

Comparing:
trunk/src/primitives/StuntDouble.hpp (file contents), Revision 2 by gezelter, Fri Sep 24 04:16:43 2004 UTC vs.
branches/development/src/primitives/StuntDouble.hpp (file contents), Revision 1714 by gezelter, Sat May 19 18:12:46 2012 UTC

# Line 1 | Line 1
1 < #ifndef __STUNTDOUBLE_HPP__
2 < #define __STUNTDOUBLE_HPP__
1 > /*
2 > * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3 > *
4 > * The University of Notre Dame grants you ("Licensee") a
5 > * non-exclusive, royalty free, license to use, modify and
6 > * redistribute this software in source and binary code form, provided
7 > * that the following conditions are met:
8 > *
9 > * 1. Redistributions of source code must retain the above copyright
10 > *    notice, this list of conditions and the following disclaimer.
11 > *
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.
16 > *
17 > * This software is provided "AS IS," without a warranty of any
18 > * kind. All express or implied conditions, representations and
19 > * warranties, including any implied warranty of merchantability,
20 > * fitness for a particular purpose or non-infringement, are hereby
21 > * excluded.  The University of Notre Dame and its licensors shall not
22 > * be liable for any damages suffered by licensee as a result of
23 > * using, modifying or distributing the software or its
24 > * derivatives. In no event will the University of Notre Dame or its
25 > * licensors be liable for any lost revenue, profit or data, or for
26 > * direct, indirect, special, consequential, incidental or punitive
27 > * damages, however caused and regardless of the theory of liability,
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 > /**
44 > * @file StuntDouble.hpp
45 > * @author    tlin
46 > * @date  10/22/2004
47 > * @version 1.0
48 > */
49 >  
50 > #ifndef PRIMITIVES_STUNTDOUBLE_HPP
51 > #define PRIMITIVES_STUNTDOUBLE_HPP
52  
53 < #include <map>
5 < #include "GenericData.hpp"
53 > #include <vector>
54  
55 < #define OT_ATOM 0
56 < #define OT_DATOM 1
57 < #define OT_RIGIDBODY 2
55 > #include "visitors/BaseVisitor.hpp"
56 > #include "math/Quaternion.hpp"
57 > #include "math/SquareMatrix3.hpp"
58 > #include "math/Vector3.hpp"
59 > #include "utils/PropertyMap.hpp"
60 > #include "brains/Snapshot.hpp"
61 > #include "brains/SnapshotManager.hpp"
62 > namespace OpenMD{
63  
11 using namespace std;
12 class BaseVisitor;
64  
65 < class StuntDouble {
66 < public:
67 <  virtual ~StuntDouble();
68 <  
69 <  int getObjType();
70 <  
71 <  bool isAtom(){
72 <    return objType == OT_ATOM || objType == OT_DATOM;
73 <  }
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 (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:    
91  
92 <  bool isDirectionalAtom(){
93 <    return objType == OT_DATOM;
94 <  }
92 >    enum ObjectType{
93 >      otAtom,
94 >      otDAtom,
95 >      otRigidBody
96 >    };
97  
98 <  bool isRigidBody(){
99 <    return objType == OT_RIGIDBODY;
100 <  }
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 >    }
107  
108 <  bool isDirectional(){
109 <    return isDirectionalAtom() || isRigidBody();
110 <  }
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 >    }
123  
124 <  virtual double getMass(void);
125 <  
126 <  virtual void   getPos(double pos[3]);
127 <  virtual void   setPos(double pos[3]);
128 <  
129 <  virtual void   getVel(double vel[3]);
130 <  virtual void   setVel(double vel[3]);
131 <  
132 <  virtual void   getFrc(double frc[3]);
133 <  virtual void   addFrc(double frc[3]);
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 <  virtual void   getA(double A[3][3]);
140 <  virtual void   setA(double A[3][3]);
139 >    /**
140 >     * Sets the Snapshot Manager of this stuntDouble
141 >     */
142 >    void setSnapshotManager(SnapshotManager* sman) {
143 >      snapshotMan_ = sman;
144 >    }
145  
146 <  virtual void   getJ(double j[3]);
147 <  virtual void   setJ(double j[3]);
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 <  virtual void getQ( double q[4] ); // get the quanternions
155 <  virtual void setQ( double q[4] );
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 <  virtual void setType(char* type) = 0;
163 <  virtual char* getType() = 0;
164 <  
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 <  virtual void   getTrq(double trq[3]);
171 <  virtual void   addTrq(double trq[3]);
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 <  virtual void   getI(double I[3][3]);
179 <  virtual void   lab2Body(double vec[3]);
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 <  virtual void   getGrad(double grad[6]);
189 <  virtual void   setEuler(double phi, double theta, double psi);
190 <  virtual void   getEulerAngles(double eulers[3]);
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 <  virtual bool isLinear() {return false;}
202 <  virtual int linearAxis() {return -1;}
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 >     * 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 <  virtual double   getZangle();
218 <  virtual void   setZangle(double zAngle);
219 <  virtual void   addZangle(double zAngle);
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 <  virtual void accept(BaseVisitor* v) = 0;
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 >     * 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 <  void addProperty(GenericData* data);
246 <  void removeProperty(const string& propName);
247 <  GenericData* getProperty(const string& propName);
248 <  
249 < protected:
250 <  StuntDouble(){}
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 <  //prevent default copy constructor copy information from properties which will cause problem
87 <  StuntDouble(const StuntDouble& sd){
88 <    objType = sd.objType;
89 <  }
90 <  
91 <  int objType;
253 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_] = pos;
254  
255 <  map<string, GenericData*> properties;
256 < };
255 >    }
256 >      
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 < #endif
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }      
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
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 >    }
571 >      
572 >    /**
573 >     * Returns the previous unit vectors of this stuntDouble
574 >     * @return the unit vectors of this stuntDouble
575 >     */    
576 >    RotMat3x3d getPrevElectroFrame() {
577 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_];
578 >    }
579 >      
580 >    /**
581 >     * Returns the current unit vectors of this stuntDouble
582 >     * @return the unit vectors of this stuntDouble
583 >     */    
584 >    RotMat3x3d getElectroFrame() {
585 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_];
586 >    }
587 >
588 >    /**
589 >     * Returns the unit vectors of this stuntDouble in specified snapshot
590 >     *
591 >     * @return the unit vectors of this stuntDouble
592 >     * @param snapshotNo
593 >     */    
594 >    RotMat3x3d getElectroFrame(int snapshotNo) {
595 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electroFrame[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 >    }
605 >      
606 >    /**
607 >     * Returns the current force of this stuntDouble
608 >     * @return the force of this stuntDouble
609 >     */    
610 >    Vector3d getFrc() {
611 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_];
612 >    }
613 >
614 >    /**
615 >     * Returns the force of this stuntDouble in specified snapshot
616 >     *
617 >     * @return the force of this stuntDouble
618 >     * @param snapshotNo
619 >     */    
620 >    Vector3d getFrc(int snapshotNo) {
621 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_];
622 >    }
623 >
624 >    /**
625 >     * Sets  the previous force of this stuntDouble
626 >     *
627 >     * @param frc  new force
628 >     * @see #getFrc
629 >     */        
630 >    void setPrevFrc(const Vector3d& frc) {
631 >      ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] = frc;
632 >    }
633 >      
634 >    /**
635 >     * Sets  the current force of this stuntDouble
636 >     * @param frc  new force
637 >     */        
638 >    void setFrc(const Vector3d& frc) {
639 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] = frc;
640 >    }
641 >
642 >    /**
643 >     * Sets  the force of this stuntDouble in specified snapshot
644 >     *
645 >     * @param frc force to be set
646 >     * @param snapshotNo
647 >     * @see #getFrc
648 >     */        
649 >    void setFrc(const Vector3d& frc, int snapshotNo) {
650 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] = frc;
651 >    }
652 >
653 >    /**
654 >     * Adds force into the previous force of this stuntDouble
655 >     *
656 >     * @param frc  new force
657 >     * @see #getFrc
658 >     */        
659 >    void addPrevFrc(const Vector3d& frc) {
660 >      ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] += frc;
661 >    }
662 >      
663 >    /**
664 >     * Adds force into the current force of this stuntDouble
665 >     * @param frc  new force
666 >     */        
667 >    void addFrc(const Vector3d& frc) {
668 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] += frc;
669 >    }
670 >
671 >    /**
672 >     * Adds force into the force of this stuntDouble in specified snapshot
673 >     *
674 >     * @param frc force to be set
675 >     * @param snapshotNo
676 >     * @see #getFrc
677 >     */        
678 >    void addFrc(const Vector3d& frc, int snapshotNo) {
679 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] += frc;
680 >    }
681 >
682 >    /**
683 >     * Returns the previous torque of this stuntDouble
684 >     * @return the torque of this stuntDouble
685 >     */    
686 >    Vector3d getPrevTrq() {
687 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_];
688 >    }
689 >      
690 >    /**
691 >     * Returns the current torque of this stuntDouble
692 >     * @return the torque of this stuntDouble
693 >     */    
694 >    Vector3d getTrq() {
695 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_];
696 >    }
697 >
698 >    /**
699 >     * Returns the torque of this stuntDouble in specified snapshot
700 >     *
701 >     * @return the torque of this stuntDouble
702 >     * @param snapshotNo
703 >     */    
704 >    Vector3d getTrq(int snapshotNo) {
705 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_];
706 >    }
707 >
708 >    /**
709 >     * Sets  the previous torque of this stuntDouble
710 >     *
711 >     * @param trq  new torque
712 >     * @see #getTrq
713 >     */        
714 >    void setPrevTrq(const Vector3d& trq) {
715 >      ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] = trq;
716 >    }
717 >      
718 >    /**
719 >     * Sets  the current torque of this stuntDouble
720 >     * @param trq  new torque
721 >     */        
722 >    void setTrq(const Vector3d& trq) {
723 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] = trq;
724 >    }
725 >
726 >    /**
727 >     * Sets  the torque of this stuntDouble in specified snapshot
728 >     *
729 >     * @param trq torque to be set
730 >     * @param snapshotNo
731 >     * @see #getTrq
732 >     */        
733 >    void setTrq(const Vector3d& trq, int snapshotNo) {
734 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] = trq;
735 >    }
736 >
737 >    /**
738 >     * Adds torque into the previous torque of this stuntDouble
739 >     *
740 >     * @param trq  new torque
741 >     * @see #getTrq
742 >     */        
743 >    void addPrevTrq(const Vector3d& trq) {
744 >      ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] += trq;
745 >    }
746 >      
747 >    /**
748 >     * Adds torque into the current torque of this stuntDouble
749 >     * @param trq  new torque
750 >     */        
751 >    void addTrq(const Vector3d& trq) {
752 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] += trq;
753 >    }
754 >
755 >    /**
756 >     * Adds torque into the torque of this stuntDouble in specified snapshot
757 >     *
758 >     * @param trq torque to be add
759 >     * @param snapshotNo
760 >     * @see #getTrq
761 >     */        
762 >    void addTrq(const Vector3d& trq, int snapshotNo) {
763 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] += trq;
764 >    }      
765 >
766 >
767 >
768 >    /**
769 >     * Returns the previous particlePot of this stuntDouble
770 >     * @return the particlePot of this stuntDouble
771 >     */    
772 >    RealType getPrevParticlePot() {
773 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_];
774 >    }
775 >      
776 >    /**
777 >     * Returns the current particlePot of this stuntDouble
778 >     * @return the particlePot of this stuntDouble
779 >     */    
780 >    RealType getParticlePot() {
781 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_];
782 >    }
783 >
784 >    /**
785 >     * Returns the particlePot of this stuntDouble in specified snapshot
786 >     *
787 >     * @return the particlePot of this stuntDouble
788 >     * @param snapshotNo
789 >     */    
790 >    RealType getParticlePot(int snapshotNo) {
791 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_];
792 >    }
793 >
794 >    /**
795 >     * Sets  the previous particlePot of this stuntDouble
796 >     *
797 >     * @param particlePot  new particlePot
798 >     * @see #getParticlePot
799 >     */        
800 >    void setPrevParticlePot(const RealType& particlePot) {
801 >      ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] = particlePot;
802 >    }
803 >      
804 >    /**
805 >     * Sets  the current particlePot of this stuntDouble
806 >     * @param particlePot  new particlePot
807 >     */        
808 >    void setParticlePot(const RealType& particlePot) {
809 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] = particlePot;
810 >    }
811 >
812 >    /**
813 >     * Sets  the particlePot of this stuntDouble in specified snapshot
814 >     *
815 >     * @param particlePot particlePot to be set
816 >     * @param snapshotNo
817 >     * @see #getParticlePot
818 >     */        
819 >    void setParticlePot(const RealType& particlePot, int snapshotNo) {
820 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] = particlePot;
821 >    }
822 >
823 >    /**
824 >     * Adds particlePot into the previous particlePot of this stuntDouble
825 >     *
826 >     * @param particlePot  new particlePot
827 >     * @see #getParticlePot
828 >     */        
829 >    void addPrevParticlePot(const RealType& particlePot) {
830 >      ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] += particlePot;
831 >    }
832 >      
833 >    /**
834 >     * Adds particlePot into the current particlePot of this stuntDouble
835 >     * @param particlePot  new particlePot
836 >     */        
837 >    void addParticlePot(const RealType& particlePot) {
838 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] += particlePot;
839 >    }
840 >
841 >    /**
842 >     * Adds particlePot into the particlePot of this stuntDouble in specified snapshot
843 >     *
844 >     * @param particlePot particlePot to be add
845 >     * @param snapshotNo
846 >     * @see #getParticlePot
847 >     */        
848 >    void addParticlePot(const RealType& particlePot, int snapshotNo) {
849 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] += particlePot;
850 >    }      
851 >
852 >    /**
853 >     * Returns the previous fluctuating charge of this stuntDouble
854 >     * @return the fluctuating charge of this stuntDouble
855 >     */    
856 >    RealType getPrevFlucQPos() {
857 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_];
858 >    }
859 >      
860 >    /**
861 >     * Returns the current fluctuating charge of this stuntDouble
862 >     * @return the fluctuating charge of this stuntDouble
863 >     */    
864 >    RealType getFlucQPos() {
865 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_];
866 >    }
867 >
868 >    /**
869 >     * Returns the fluctuating charge of this stuntDouble in specified snapshot
870 >     * @return the fluctuating charge of this stuntDouble
871 >     * @param snapshotNo
872 >     */    
873 >    RealType getFlucQPos(int snapshotNo) {
874 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_];
875 >    }
876 >
877 >    /**
878 >     * Sets  the previous fluctuating charge of this stuntDouble
879 >     * @param charge  new fluctuating charge
880 >     * @see #getflucQPos
881 >     */        
882 >    void setPrevFlucQPos(RealType charge) {
883 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] = charge;
884 >    }
885 >      
886 >    /**
887 >     * Sets  the current fluctuating charge of this stuntDouble
888 >     * @param charge  new fluctuating charge
889 >     */        
890 >    void setFlucQPos(RealType charge) {
891 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] = charge;
892 >    }
893 >
894 >    /**
895 >     * Sets  the fluctuating charge of this stuntDouble in specified snapshot
896 >     * @param charge fluctuating charge to be set
897 >     * @param snapshotNo
898 >     * @see #getflucQPos
899 >     */        
900 >    void setFlucQPos(RealType charge, int snapshotNo) {
901 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] = charge;
902 >    }
903 >
904 >    /**
905 >     * Adds fluctuating charge into the previous fluctuating charge of this stuntDouble
906 >     * @param charge  new fluctuating charge
907 >     * @see #getflucQPos
908 >     */        
909 >    void addPrevFlucQPos(RealType charge) {
910 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] += charge;
911 >    }
912 >      
913 >    /**
914 >     * Adds fluctuating charge into the current fluctuating charge of this stuntDouble
915 >     * @param charge  new fluctuating charge
916 >     */        
917 >    void addFlucQPos(RealType charge) {
918 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] += charge;
919 >    }
920 >
921 >    /**
922 >     * Adds fluctuating charge into the fluctuating charge of this stuntDouble in specified snapshot
923 >     * @param value fluctuating charge to be add
924 >     * @param snapshotNo
925 >     * @see #getflucQPos
926 >     */        
927 >    void addflucQPos(RealType charge, int snapshotNo) {
928 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] += charge;
929 >    }      
930 >
931 >
932 >    /**
933 >     * Returns the previous charge velocity of this stuntDouble
934 >     * @return the charge velocity of this stuntDouble
935 >     */    
936 >    RealType getPrevFlucQVel() {
937 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_];
938 >    }
939 >      
940 >    /**
941 >     * Returns the current charge velocity of this stuntDouble
942 >     * @return the charge velocity of this stuntDouble
943 >     */    
944 >    RealType getFlucQVel() {
945 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_];
946 >    }
947 >
948 >    /**
949 >     * Returns the charge velocity of this stuntDouble in specified snapshot
950 >     * @return the charge velocity of this stuntDouble
951 >     * @param snapshotNo
952 >     */    
953 >    RealType getFlucQVel(int snapshotNo) {
954 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_];
955 >    }
956 >
957 >    /**
958 >     * Sets  the previous charge velocity of this stuntDouble
959 >     * @param cvel  new charge velocity
960 >     * @see #getflucQVel
961 >     */        
962 >    void setPrevFlucQVel(RealType cvel) {
963 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] = cvel;
964 >    }
965 >      
966 >    /**
967 >     * Sets  the current charge velocity of this stuntDouble
968 >     * @param cvel  new charge velocity
969 >     */        
970 >    void setFlucQVel(RealType cvel) {
971 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] = cvel;
972 >    }
973 >
974 >    /**
975 >     * Sets  the charge velocity of this stuntDouble in specified snapshot
976 >     * @param cvel charge velocity to be set
977 >     * @param snapshotNo
978 >     * @see #getflucQVel
979 >     */        
980 >    void setFlucQVel(RealType cvel, int snapshotNo) {
981 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] = cvel;
982 >    }
983 >
984 >    /**
985 >     * Adds charge velocity into the previous charge velocity of this stuntDouble
986 >     * @param cvel  new charge velocity
987 >     * @see #getflucQVel
988 >     */        
989 >    void addPrevFlucQVel(RealType cvel) {
990 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] += cvel;
991 >    }
992 >      
993 >    /**
994 >     * Adds charge velocity into the current charge velocity of this stuntDouble
995 >     * @param cvel  new charge velocity
996 >     */        
997 >    void addFlucQVel(RealType cvel) {
998 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] += cvel;
999 >    }
1000 >
1001 >    /**
1002 >     * Adds charge velocity into the charge velocity of this stuntDouble in specified snapshot
1003 >     * @param value charge velocity to be add
1004 >     * @param snapshotNo
1005 >     * @see #getflucQVel
1006 >     */        
1007 >    void addflucQVel(RealType cvel, int snapshotNo) {
1008 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] += cvel;
1009 >    }      
1010 >
1011 >
1012 >    /**
1013 >     * Returns the previous charge force of this stuntDouble
1014 >     * @return the charge force of this stuntDouble
1015 >     */    
1016 >    RealType getPrevFlucQFrc() {
1017 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_];
1018 >    }
1019 >      
1020 >    /**
1021 >     * Returns the current charge force of this stuntDouble
1022 >     * @return the charge force of this stuntDouble
1023 >     */    
1024 >    RealType getFlucQFrc() {
1025 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_];
1026 >    }
1027 >
1028 >    /**
1029 >     * Returns the charge force of this stuntDouble in specified snapshot
1030 >     * @return the charge force of this stuntDouble
1031 >     * @param snapshotNo
1032 >     */    
1033 >    RealType getFlucQFrc(int snapshotNo) {
1034 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_];
1035 >    }
1036 >
1037 >    /**
1038 >     * Sets  the previous charge force of this stuntDouble
1039 >     * @param cfrc  new charge force
1040 >     * @see #getflucQFrc
1041 >     */        
1042 >    void setPrevFlucQFrc(RealType cfrc) {
1043 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc;
1044 >    }
1045 >      
1046 >    /**
1047 >     * Sets  the current charge force of this stuntDouble
1048 >     * @param cfrc  new charge force
1049 >     */        
1050 >    void setFlucQFrc(RealType cfrc) {
1051 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc;
1052 >    }
1053 >
1054 >    /**
1055 >     * Sets  the charge force of this stuntDouble in specified snapshot
1056 >     * @param cfrc charge force to be set
1057 >     * @param snapshotNo
1058 >     * @see #getflucQFrc
1059 >     */        
1060 >    void setFlucQFrc(RealType cfrc, int snapshotNo) {
1061 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] = cfrc;
1062 >    }
1063 >
1064 >    /**
1065 >     * Adds charge force into the previous charge force of this stuntDouble
1066 >     * @param cfrc  new charge force
1067 >     * @see #getflucQFrc
1068 >     */        
1069 >    void addPrevFlucQFrc(RealType cfrc) {
1070 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc;
1071 >    }
1072 >      
1073 >    /**
1074 >     * Adds charge force into the current charge force of this stuntDouble
1075 >     * @param cfrc  new charge force
1076 >     */        
1077 >    void addFlucQFrc(RealType cfrc) {
1078 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc;
1079 >    }
1080 >
1081 >    /**
1082 >     * Adds charge force into the charge force of this stuntDouble in specified snapshot
1083 >     * @param value charge force to be add
1084 >     * @param snapshotNo
1085 >     * @see #getflucQFrc
1086 >     */        
1087 >    void addflucQFrc(RealType cfrc, int snapshotNo) {
1088 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] += cfrc;
1089 >    }      
1090 >
1091 >
1092 >    /**
1093 >     * Returns the previous electric field of this stuntDouble
1094 >     * @return the electric field of this stuntDouble
1095 >     */    
1096 >    Vector3d getPrevElectricField() {
1097 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_];
1098 >    }
1099 >      
1100 >    /**
1101 >     * Returns the current electric field of this stuntDouble
1102 >     * @return the electric field of this stuntDouble
1103 >     */    
1104 >    Vector3d getElectricField() {
1105 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_];
1106 >    }
1107 >
1108 >    /**
1109 >     * Returns the electric field of this stuntDouble in specified snapshot
1110 >     * @return the electric field of this stuntDouble
1111 >     * @param snapshotNo
1112 >     */    
1113 >    Vector3d getElectricField(int snapshotNo) {
1114 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_];
1115 >    }
1116 >
1117 >    /**
1118 >     * Sets  the previous electric field of this stuntDouble
1119 >     * @param pos  new electric field
1120 >     * @see #getElectricField
1121 >     */        
1122 >    void setPrevElectricField(const Vector3d& pos) {
1123 >      ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] = pos;
1124 >    }
1125 >      
1126 >    /**
1127 >     * Sets  the current electric field of this stuntDouble
1128 >     * @param pos  new electric field
1129 >     */        
1130 >    void setElectricField(const Vector3d& pos) {
1131 >      DataStorage&  data = snapshotMan_->getCurrentSnapshot()->*storage_;
1132 >      data.electricField[localIndex_] = pos;
1133 >      //((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] = pos;
1134 >    }
1135 >
1136 >    /**
1137 >     * Sets  the electric field of this stuntDouble in specified snapshot
1138 >     * @param pos electric field to be set
1139 >     * @param snapshotNo
1140 >     * @see #getElectricField
1141 >     */        
1142 >    void setElectricField(const Vector3d& pos, int snapshotNo) {
1143 >
1144 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] = pos;
1145 >
1146 >    }
1147 >
1148 >
1149 >    /** Set the force of this stuntDouble to zero */
1150 >    void zeroForcesAndTorques();
1151 >    /**
1152 >     * Returns the inertia tensor of this stuntDouble
1153 >     * @return the inertia tensor of this stuntDouble
1154 >     */
1155 >    virtual Mat3x3d getI() = 0;
1156 >
1157 >    /**
1158 >     * Returns the gradient of this stuntDouble
1159 >     * @return the gradient of this stuntDouble
1160 >     */
1161 >    virtual std::vector<RealType> getGrad() = 0;
1162 >
1163 >    /**
1164 >     * Tests the  if this stuntDouble is a  linear rigidbody
1165 >     *
1166 >     * @return true if this stuntDouble is a  linear rigidbody, otherwise return false
1167 >     * @note atom and directional atom will always return false
1168 >     *
1169 >     * @see #linearAxis
1170 >     */        
1171 >    bool isLinear() {
1172 >      return linear_;
1173 >    }
1174 >
1175 >    /**
1176 >     * Returns the linear axis of the rigidbody, atom and directional atom will always return -1
1177 >     *
1178 >     * @return the linear axis of the rigidbody
1179 >     *
1180 >     * @see #isLinear
1181 >     */
1182 >    int linearAxis() {
1183 >      return linearAxis_;
1184 >    }
1185 >
1186 >    /** Returns the mass of this stuntDouble */
1187 >    RealType getMass() {
1188 >      return mass_;
1189 >    }
1190 >
1191 >    /**
1192 >     * Sets the mass of this stuntdoulbe
1193 >     * @param mass the mass to be set
1194 >     */        
1195 >    void setMass(RealType mass) {
1196 >      mass_ = mass;
1197 >    }
1198 >
1199 >    /** Returns the name of this stuntDouble */
1200 >    virtual std::string getType() = 0;
1201 >        
1202 >    /** Sets the name of this stuntDouble*/
1203 >    virtual void setType(const std::string& name) {}
1204 >
1205 >    /**
1206 >     * Converts a lab fixed vector to a body fixed vector.
1207 >     * @return body fixed vector
1208 >     * @param v lab fixed vector
1209 >     */
1210 >    Vector3d lab2Body(const Vector3d& v) {
1211 >      return getA() * v;
1212 >    }
1213 >
1214 >    Vector3d lab2Body(const Vector3d& v, int frame) {
1215 >      return getA(frame) * v;
1216 >    }
1217 >
1218 >    /**
1219 >     * Converts a body fixed vector to a lab fixed vector.
1220 >     * @return corresponding lab fixed vector
1221 >     * @param v body fixed vector
1222 >     */
1223 >    Vector3d body2Lab(const Vector3d& v){
1224 >      return getA().transpose() * v;
1225 >    }
1226 >
1227 >    Vector3d body2Lab(const Vector3d& v, int frame){
1228 >      return getA(frame).transpose() * v;
1229 >    }
1230 >
1231 >    /**
1232 >     * <p>
1233 >     * The purpose of the Visitor Pattern is to encapsulate an
1234 >     * operation that you want to perform on the elements of a data
1235 >     * structure. In this way, you can change the operation being
1236 >     * performed on a structure without the need of changing the
1237 >     * classes of the elements that you are operating on. Using a
1238 >     * Visitor pattern allows you to decouple the classes for the data
1239 >     * structure and the algorithms used upon them
1240 >     * </p>
1241 >     * @param v visitor
1242 >     */      
1243 >    virtual void accept(BaseVisitor* v) = 0;
1244 >
1245 >    //below functions are just forward functions
1246 >    /**
1247 >     * Adds property into property map
1248 >     * @param genData GenericData to be added into PropertyMap
1249 >     */
1250 >    void addProperty(GenericData* genData);
1251 >
1252 >    /**
1253 >     * Removes property from PropertyMap by name
1254 >     * @param propName the name of property to be removed
1255 >     */
1256 >    void removeProperty(const std::string& propName);
1257 >
1258 >    /**
1259 >     * clear all of the properties
1260 >     */
1261 >    void clearProperties();
1262 >
1263 >    /**
1264 >     * Returns all names of properties
1265 >     * @return all names of properties
1266 >     */
1267 >    std::vector<std::string> getPropertyNames();
1268 >
1269 >    /**
1270 >     * Returns all of the properties in PropertyMap
1271 >     * @return all of the properties in PropertyMap
1272 >     */      
1273 >    std::vector<GenericData*> getProperties();
1274 >
1275 >    /**
1276 >     * Returns property
1277 >     * @param propName name of property
1278 >     * @return a pointer point to property with propName. If no property named propName
1279 >     * exists, return NULL
1280 >     */      
1281 >    GenericData* getPropertyByName(const std::string& propName);
1282 >
1283 >  protected:
1284 >        
1285 >    StuntDouble(ObjectType objType, DataStoragePointer storage);
1286 >        
1287 >    StuntDouble(const StuntDouble& sd);
1288 >    StuntDouble& operator=(const StuntDouble& sd);
1289 >
1290 >    ObjectType objType_;
1291 >    DataStoragePointer storage_;
1292 >    SnapshotManager* snapshotMan_;
1293 >        
1294 >    bool linear_;
1295 >    int linearAxis_;        
1296 >
1297 >        
1298 >    int globalIndex_;
1299 >    int globalIntegrableObjectIndex_;
1300 >    int localIndex_;
1301 >
1302 >
1303 >    RealType mass_;
1304 >        
1305 >  private:
1306 >        
1307 >    PropertyMap properties_;
1308 >  };
1309 >
1310 > }//end namespace OpenMD
1311 > #endif //PRIMITIVES_STUNTDOUBLE_HPP

Comparing:
trunk/src/primitives/StuntDouble.hpp (property svn:keywords), Revision 2 by gezelter, Fri Sep 24 04:16:43 2004 UTC vs.
branches/development/src/primitives/StuntDouble.hpp (property svn:keywords), Revision 1714 by gezelter, Sat May 19 18:12:46 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines