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 963 by tim, Wed May 17 21:51:42 2006 UTC vs.
branches/development/src/primitives/StuntDouble.hpp (file contents), Revision 1627 by gezelter, Tue Sep 13 22:05:04 2011 UTC

# Line 6 | Line 6
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.
# Line 37 | Line 28
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]  Vardeman & Gezelter, in progress (2009).                        
40   */
41  
42   /**
# Line 58 | Line 58
58   #include "utils/PropertyMap.hpp"
59   #include "brains/Snapshot.hpp"
60   #include "brains/SnapshotManager.hpp"
61 < namespace oopse{
61 > namespace OpenMD{
62  
63  
64    
# Line 83 | Line 83 | namespace oopse{
83     * doesn't try to do something stupid like torque an Atom (The
84     * quotes above are from Spaceballs...)
85     *
86 <   * @note the dynamic data of stuntdouble will be stored outside of the class
86 >   * @note the dynamic data of stuntDouble will be stored outside of the class
87     */
88    class StuntDouble{
89    public:    
# Line 97 | Line 97 | namespace oopse{
97      virtual ~StuntDouble();
98          
99      /**
100 <     * Returns the global index of this stuntRealType.
101 <     * @return  the global index of this stuntdouble
100 >     * Returns the global index of this stuntDouble.
101 >     * @return  the global index of this stuntDouble
102       */
103      int getGlobalIndex() {
104        return globalIndex_;
105      }
106  
107      /**
108 <     * Sets the global index of this stuntRealType.
108 >     * Sets the global index of this stuntDouble.
109       * @param new global index to be set
110       */
111      void setGlobalIndex(int index) {
112        globalIndex_ = index;
113      }
114 <        
114 >    
115      /**
116 <     * Returns the local index of this stuntdouble
117 <     * @return the local index of this stuntdouble
116 >     * Returns the local index of this stuntDouble
117 >     * @return the local index of this stuntDouble
118       */
119      int getLocalIndex() {
120        return localIndex_;
121      }
122  
123      /**
124 <     * Sets the local index of this stuntdouble
124 >     * Sets the local index of this stuntDouble
125       * @param index new index to be set
126       */        
127      void setLocalIndex(int index) {
128        localIndex_ = index;
129      }
130 +    
131 +    int getGlobalIntegrableObjectIndex(){
132 +      return globalIntegrableObjectIndex_;
133 +    }
134 +    void setGlobalIntegrableObjectIndex(int index) {
135 +      globalIntegrableObjectIndex_ = index;
136 +    }
137  
138      /**
139 <     * Sets the Snapshot Manager of this stuntdouble
139 >     * Sets the Snapshot Manager of this stuntDouble
140       */
141      void setSnapshotManager(SnapshotManager* sman) {
142        snapshotMan_ = sman;
143      }
144  
145      /**
146 <     * Tests if this stuntdouble is an atom
147 <     * @return true is this stuntdouble is an atom(or a directional atom), return false otherwise
146 >     * Tests if this stuntDouble is an atom
147 >     * @return true is this stuntDouble is an atom(or a directional atom), return false otherwise
148       */
149      bool isAtom(){
150        return objType_ == otAtom || objType_ == otDAtom;
151      }
152  
153      /**
154 <     * Tests if this stuntdouble is an directional atom
155 <     * @return true if this stuntdouble is an directional atom, return false otherwise
154 >     * Tests if this stuntDouble is an directional atom
155 >     * @return true if this stuntDouble is an directional atom, return false otherwise
156       */
157      bool isDirectionalAtom(){
158        return objType_ == otDAtom;
159      }
160  
161      /**
162 <     * Tests if this stuntdouble is a rigid body.
163 <     * @return true if this stuntdouble is a rigid body, otherwise return false
162 >     * Tests if this stuntDouble is a rigid body.
163 >     * @return true if this stuntDouble is a rigid body, otherwise return false
164       */
165      bool isRigidBody(){
166        return objType_ == otRigidBody;
167      }
168  
169      /**
170 <     * Tests if this stuntdouble is a directional one.
171 <     * @return true is this stuntdouble is a directional atom or a rigid body, return false otherwise
170 >     * Tests if this stuntDouble is a directional one.
171 >     * @return true is this stuntDouble is a directional atom or a rigid body, return false otherwise
172       */
173      bool isDirectional(){
174        return isDirectionalAtom() || isRigidBody();
# Line 191 | Line 198 | namespace oopse{
198      }
199  
200      /**
201 <     * Returns the previous position of this stuntdouble
202 <     * @return the position of this stuntdouble
201 >     * Returns the previous position of this stuntDouble
202 >     * @return the position of this stuntDouble
203       */    
204      Vector3d getPrevPos() {
205        return ((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_];
206      }
207        
208      /**
209 <     * Returns the current position of this stuntdouble
210 <     * @return the position of this stuntdouble
209 >     * Returns the current position of this stuntDouble
210 >     * @return the position of this stuntDouble
211       */    
212      Vector3d getPos() {
213        return ((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_];
214      }
215  
216      /**
217 <     * Returns the position of this stuntdouble in specified snapshot
218 <     * @return the position of this stuntdouble
217 >     * Returns the position of this stuntDouble in specified snapshot
218 >     * @return the position of this stuntDouble
219       * @param snapshotNo
220       */    
221      Vector3d getPos(int snapshotNo) {
# Line 216 | Line 223 | namespace oopse{
223      }
224  
225      /**
226 <     * Sets  the previous position of this stuntdouble
226 >     * Sets  the previous position of this stuntDouble
227       * @param pos  new position
228       * @see #getPos
229       */        
# Line 225 | Line 232 | namespace oopse{
232      }
233        
234      /**
235 <     * Sets  the current position of this stuntdouble
235 >     * Sets  the current position of this stuntDouble
236       * @param pos  new position
237       */        
238      void setPos(const Vector3d& pos) {
# Line 235 | Line 242 | namespace oopse{
242      }
243  
244      /**
245 <     * Sets  the position of this stuntdouble in specified snapshot
245 >     * Sets  the position of this stuntDouble in specified snapshot
246       * @param pos position to be set
247       * @param snapshotNo
248       * @see #getPos
# Line 247 | Line 254 | namespace oopse{
254      }
255        
256      /**
257 <     * Returns the previous velocity of this stuntdouble
258 <     * @return the velocity of this stuntdouble
257 >     * Returns the previous velocity of this stuntDouble
258 >     * @return the velocity of this stuntDouble
259       */    
260      Vector3d getPrevVel() {
261        return ((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_];
262      }
263        
264      /**
265 <     * Returns the current velocity of this stuntdouble
266 <     * @return the velocity of this stuntdouble
265 >     * Returns the current velocity of this stuntDouble
266 >     * @return the velocity of this stuntDouble
267       */    
268      Vector3d getVel() {
269        return ((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_];
270      }
271  
272      /**
273 <     * Returns the velocity of this stuntdouble in specified snapshot
274 <     * @return the velocity of this stuntdouble
273 >     * Returns the velocity of this stuntDouble in specified snapshot
274 >     * @return the velocity of this stuntDouble
275       * @param snapshotNo
276       */    
277      Vector3d getVel(int snapshotNo) {
# Line 272 | Line 279 | namespace oopse{
279      }
280  
281      /**
282 <     * Sets  the previous velocity of this stuntdouble
282 >     * Sets  the previous velocity of this stuntDouble
283       * @param vel  new velocity
284       * @see #getVel
285       */        
# Line 281 | Line 288 | namespace oopse{
288      }
289        
290      /**
291 <     * Sets  the current velocity of this stuntdouble
291 >     * Sets  the current velocity of this stuntDouble
292       * @param vel  new velocity
293       */        
294      void setVel(const Vector3d& vel) {
# Line 289 | Line 296 | namespace oopse{
296      }
297  
298      /**
299 <     * Sets  the velocity of this stuntdouble in specified snapshot
299 >     * Sets  the velocity of this stuntDouble in specified snapshot
300       * @param vel velocity to be set
301       * @param snapshotNo
302       * @see #getVel
# Line 299 | Line 306 | namespace oopse{
306      }
307  
308      /**
309 <     * Returns the previous rotation matrix of this stuntdouble
310 <     * @return the rotation matrix of this stuntdouble
309 >     * Returns the previous rotation matrix of this stuntDouble
310 >     * @return the rotation matrix of this stuntDouble
311       */    
312      RotMat3x3d getPrevA() {
313        return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_];
314      }
315        
316      /**
317 <     * Returns the current rotation matrix of this stuntdouble
318 <     * @return the rotation matrix of this stuntdouble
317 >     * Returns the current rotation matrix of this stuntDouble
318 >     * @return the rotation matrix of this stuntDouble
319       */    
320      RotMat3x3d getA() {
321        return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_];
322      }
323  
324      /**
325 <     * Returns the rotation matrix of this stuntdouble in specified snapshot
325 >     * Returns the rotation matrix of this stuntDouble in specified snapshot
326       *
327 <     * @return the rotation matrix of this stuntdouble
327 >     * @return the rotation matrix of this stuntDouble
328       * @param snapshotNo
329       */    
330      RotMat3x3d getA(int snapshotNo) {
# Line 325 | Line 332 | namespace oopse{
332      }
333  
334      /**
335 <     * Sets  the previous rotation matrix of this stuntdouble
335 >     * Sets  the previous rotation matrix of this stuntDouble
336       * @param a  new rotation matrix
337       * @see #getA
338       */        
# Line 334 | Line 341 | namespace oopse{
341      }
342        
343      /**
344 <     * Sets  the current rotation matrix of this stuntdouble
344 >     * Sets  the current rotation matrix of this stuntDouble
345       * @param a  new rotation matrix
346       */        
347      virtual void setA(const RotMat3x3d& a) {
# Line 342 | Line 349 | namespace oopse{
349      }
350  
351      /**
352 <     * Sets  the rotation matrix of this stuntdouble in specified snapshot
352 >     * Sets  the rotation matrix of this stuntDouble in specified snapshot
353       * @param a rotation matrix to be set
354       * @param snapshotNo
355       * @see #getA
# Line 352 | Line 359 | namespace oopse{
359      }      
360  
361      /**
362 <     * Returns the previous angular momentum of this stuntdouble (body-fixed).
363 <     * @return the angular momentum of this stuntdouble
362 >     * Returns the previous angular momentum of this stuntDouble (body-fixed).
363 >     * @return the angular momentum of this stuntDouble
364       */    
365      Vector3d getPrevJ() {
366        return ((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_];
367      }
368        
369      /**
370 <     * Returns the current angular momentum of this stuntdouble (body -fixed).
371 <     * @return the angular momentum of this stuntdouble
370 >     * Returns the current angular momentum of this stuntDouble (body -fixed).
371 >     * @return the angular momentum of this stuntDouble
372       */    
373      Vector3d getJ() {
374        return ((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_];
375      }
376  
377      /**
378 <     * Returns the angular momentum of this stuntdouble in specified snapshot (body-fixed).
379 <     * @return the angular momentum of this stuntdouble
378 >     * Returns the angular momentum of this stuntDouble in specified snapshot (body-fixed).
379 >     * @return the angular momentum of this stuntDouble
380       * @param snapshotNo
381       */    
382      Vector3d getJ(int snapshotNo) {
# Line 377 | Line 384 | namespace oopse{
384      }
385  
386      /**
387 <     * Sets  the previous angular momentum of this stuntdouble (body-fixed).
387 >     * Sets  the previous angular momentum of this stuntDouble (body-fixed).
388       * @param angMom  new angular momentum
389       * @see #getJ
390       */        
# Line 386 | Line 393 | namespace oopse{
393      }
394        
395      /**
396 <     * Sets  the current angular momentum of this stuntdouble (body-fixed).
396 >     * Sets  the current angular momentum of this stuntDouble (body-fixed).
397       * @param angMom  new angular momentum
398       */        
399      void setJ(const Vector3d& angMom) {
# Line 394 | Line 401 | namespace oopse{
401      }
402  
403      /**
404 <     * Sets the angular momentum of this stuntdouble in specified snapshot(body-fixed).
404 >     * Sets the angular momentum of this stuntDouble in specified snapshot(body-fixed).
405       * @param angMom angular momentum to be set
406       * @param snapshotNo
407       * @see #getJ
# Line 402 | Line 409 | namespace oopse{
409      void setJ(const Vector3d& angMom, int snapshotNo) {
410        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom;
411      }
412 <        
412 >    
413      /**
414 <     * Returns the previous quaternion of this stuntdouble
415 <     * @return the quaternion of this stuntdouble
414 >     * Returns system Center of Mass for stuntDouble frame from snapshot
415 >     *
416 >     */
417 >    Vector3d getCOM(){
418 >      return (snapshotMan_->getCurrentSnapshot())->getCOM();
419 >    }
420 >    
421 >    /**
422 >      * Returns system Center of Mass velocity for stuntDouble frame from snapshot
423 >     *
424 >     */
425 >    
426 >    Vector3d getCOMvel(){
427 >      return (snapshotMan_->getCurrentSnapshot())->getCOMvel();
428 >    }
429 >    
430 >    /**
431 >      * Returns system Center of Mass angular momentum for stuntDouble frame from snapshot
432 >     *
433 >     */
434 >    Vector3d getCOMw(){
435 >      return (snapshotMan_->getCurrentSnapshot())->getCOMw();
436 >    }
437 >    
438 > /**
439 >     * Returns system Center of Mass for stuntDouble frame from snapshot
440 >     *
441 >     */
442 >    Vector3d getCOM(int snapshotNo){
443 >      return (snapshotMan_->getSnapshot(snapshotNo))->getCOM();
444 >    }
445 >    
446 >    /**
447 >      * Returns system Center of Mass velocity for stuntDouble frame from snapshot
448 >     *
449 >     */
450 >    
451 >    Vector3d getCOMvel(int snapshotNo){
452 >      return (snapshotMan_->getSnapshot(snapshotNo))->getCOMvel();
453 >    }
454 >    
455 >    /**
456 >      * Returns system Center of Mass angular momentum for stuntDouble frame from snapshot
457 >     *
458 >     */
459 >    Vector3d getCOMw(int snapshotNo){
460 >      return (snapshotMan_->getSnapshot(snapshotNo))->getCOMw();
461 >    }
462 >
463 >    /**
464 >     * Returns the previous quaternion of this stuntDouble
465 >     * @return the quaternion of this stuntDouble
466       */    
467      Quat4d getPrevQ() {
468        return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toQuaternion();
469      }
470        
471      /**
472 <     * Returns the current quaternion of this stuntdouble
473 <     * @return the quaternion of this stuntdouble
472 >     * Returns the current quaternion of this stuntDouble
473 >     * @return the quaternion of this stuntDouble
474       */    
475      Quat4d getQ() {
476        return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toQuaternion();
477      }
478  
479      /**
480 <     * Returns the quaternion of this stuntdouble in specified snapshot
481 <     * @return the quaternion of this stuntdouble
480 >     * Returns the quaternion of this stuntDouble in specified snapshot
481 >     * @return the quaternion of this stuntDouble
482       * @param snapshotNo
483       */    
484      Quat4d getQ(int snapshotNo) {
# Line 429 | Line 486 | namespace oopse{
486      }
487  
488      /**
489 <     * Sets  the previous quaternion of this stuntdouble
489 >     * Sets  the previous quaternion of this stuntDouble
490       * @param q  new quaternion
491       * @note actual storage data is rotation matrix
492       */        
# Line 438 | Line 495 | namespace oopse{
495      }
496        
497      /**
498 <     * Sets  the current quaternion of this stuntdouble
498 >     * Sets  the current quaternion of this stuntDouble
499       * @param q  new quaternion
500       * @note actual storage data is rotation matrix
501       */        
# Line 447 | Line 504 | namespace oopse{
504      }
505  
506      /**
507 <     * Sets  the quaternion of this stuntdouble in specified snapshot
507 >     * Sets  the quaternion of this stuntDouble in specified snapshot
508       *
509       * @param q quaternion to be set
510       * @param snapshotNo
# Line 458 | Line 515 | namespace oopse{
515      }
516  
517      /**
518 <     * Returns the previous euler angles of this stuntdouble
519 <     * @return the euler angles of this stuntdouble
518 >     * Returns the previous euler angles of this stuntDouble
519 >     * @return the euler angles of this stuntDouble
520       */    
521      Vector3d getPrevEuler() {
522        return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toEulerAngles();
523      }
524        
525      /**
526 <     * Returns the current euler angles of this stuntdouble
527 <     * @return the euler angles of this stuntdouble
526 >     * Returns the current euler angles of this stuntDouble
527 >     * @return the euler angles of this stuntDouble
528       */    
529      Vector3d getEuler() {
530        return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toEulerAngles();
531      }
532  
533      /**
534 <     * Returns the euler angles of this stuntdouble in specified snapshot.
535 <     * @return the euler angles of this stuntdouble
534 >     * Returns the euler angles of this stuntDouble in specified snapshot.
535 >     * @return the euler angles of this stuntDouble
536       * @param snapshotNo
537       */    
538      Vector3d getEuler(int snapshotNo) {
# Line 483 | Line 540 | namespace oopse{
540      }
541  
542      /**
543 <     * Sets  the previous euler angles of this stuntRealType.
543 >     * Sets  the previous euler angles of this stuntDouble.
544       * @param euler  new euler angles
545       * @see #getEuler
546       * @note actual storage data is rotation matrix        
# Line 493 | Line 550 | namespace oopse{
550      }
551        
552      /**
553 <     * Sets  the current euler angles of this stuntdouble
553 >     * Sets  the current euler angles of this stuntDouble
554       * @param euler  new euler angles
555       */        
556      void setEuler(const Vector3d& euler) {
# Line 501 | Line 558 | namespace oopse{
558      }
559  
560      /**
561 <     * Sets  the euler angles  of this stuntdouble in specified snapshot
561 >     * Sets  the euler angles  of this stuntDouble in specified snapshot
562       *
563       * @param euler euler angles to be set
564       * @param snapshotNo
# Line 512 | Line 569 | namespace oopse{
569      }
570        
571      /**
572 <     * Returns the previous unit vectors of this stuntdouble
573 <     * @return the unit vectors of this stuntdouble
572 >     * Returns the previous unit vectors of this stuntDouble
573 >     * @return the unit vectors of this stuntDouble
574       */    
575      RotMat3x3d getPrevElectroFrame() {
576        return ((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_];
577      }
578        
579      /**
580 <     * Returns the current unit vectors of this stuntdouble
581 <     * @return the unit vectors of this stuntdouble
580 >     * Returns the current unit vectors of this stuntDouble
581 >     * @return the unit vectors of this stuntDouble
582       */    
583      RotMat3x3d getElectroFrame() {
584        return ((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_];
585      }
586  
587      /**
588 <     * Returns the unit vectors of this stuntdouble in specified snapshot
588 >     * Returns the unit vectors of this stuntDouble in specified snapshot
589       *
590 <     * @return the unit vectors of this stuntdouble
590 >     * @return the unit vectors of this stuntDouble
591       * @param snapshotNo
592       */    
593      RotMat3x3d getElectroFrame(int snapshotNo) {
# Line 538 | Line 595 | namespace oopse{
595      }
596  
597      /**
598 <     * Returns the previous force of this stuntdouble
599 <     * @return the force of this stuntdouble
598 >     * Returns the previous force of this stuntDouble
599 >     * @return the force of this stuntDouble
600       */    
601      Vector3d getPrevFrc() {
602        return ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_];
603      }
604        
605      /**
606 <     * Returns the current force of this stuntdouble
607 <     * @return the force of this stuntdouble
606 >     * Returns the current force of this stuntDouble
607 >     * @return the force of this stuntDouble
608       */    
609      Vector3d getFrc() {
610        return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_];
611      }
612  
613      /**
614 <     * Returns the force of this stuntdouble in specified snapshot
614 >     * Returns the force of this stuntDouble in specified snapshot
615       *
616 <     * @return the force of this stuntdouble
616 >     * @return the force of this stuntDouble
617       * @param snapshotNo
618       */    
619      Vector3d getFrc(int snapshotNo) {
# Line 564 | Line 621 | namespace oopse{
621      }
622  
623      /**
624 <     * Sets  the previous force of this stuntdouble
624 >     * Sets  the previous force of this stuntDouble
625       *
626       * @param frc  new force
627       * @see #getFrc
# Line 574 | Line 631 | namespace oopse{
631      }
632        
633      /**
634 <     * Sets  the current force of this stuntdouble
634 >     * Sets  the current force of this stuntDouble
635       * @param frc  new force
636       */        
637      void setFrc(const Vector3d& frc) {
# Line 582 | Line 639 | namespace oopse{
639      }
640  
641      /**
642 <     * Sets  the force of this stuntdouble in specified snapshot
642 >     * Sets  the force of this stuntDouble in specified snapshot
643       *
644       * @param frc force to be set
645       * @param snapshotNo
# Line 593 | Line 650 | namespace oopse{
650      }
651  
652      /**
653 <     * Adds force into the previous force of this stuntdouble
653 >     * Adds force into the previous force of this stuntDouble
654       *
655       * @param frc  new force
656       * @see #getFrc
# Line 603 | Line 660 | namespace oopse{
660      }
661        
662      /**
663 <     * Adds force into the current force of this stuntdouble
663 >     * Adds force into the current force of this stuntDouble
664       * @param frc  new force
665       */        
666      void addFrc(const Vector3d& frc) {
# Line 611 | Line 668 | namespace oopse{
668      }
669  
670      /**
671 <     * Adds force into the force of this stuntdouble in specified snapshot
671 >     * Adds force into the force of this stuntDouble in specified snapshot
672       *
673       * @param frc force to be set
674       * @param snapshotNo
# Line 622 | Line 679 | namespace oopse{
679      }
680  
681      /**
682 <     * Returns the previous torque of this stuntdouble
683 <     * @return the torque of this stuntdouble
682 >     * Returns the previous torque of this stuntDouble
683 >     * @return the torque of this stuntDouble
684       */    
685      Vector3d getPrevTrq() {
686        return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_];
687      }
688        
689      /**
690 <     * Returns the current torque of this stuntdouble
691 <     * @return the torque of this stuntdouble
690 >     * Returns the current torque of this stuntDouble
691 >     * @return the torque of this stuntDouble
692       */    
693      Vector3d getTrq() {
694        return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_];
695      }
696  
697      /**
698 <     * Returns the torque of this stuntdouble in specified snapshot
698 >     * Returns the torque of this stuntDouble in specified snapshot
699       *
700 <     * @return the torque of this stuntdouble
700 >     * @return the torque of this stuntDouble
701       * @param snapshotNo
702       */    
703      Vector3d getTrq(int snapshotNo) {
# Line 648 | Line 705 | namespace oopse{
705      }
706  
707      /**
708 <     * Sets  the previous torque of this stuntdouble
708 >     * Sets  the previous torque of this stuntDouble
709       *
710       * @param trq  new torque
711       * @see #getTrq
# Line 658 | Line 715 | namespace oopse{
715      }
716        
717      /**
718 <     * Sets  the current torque of this stuntdouble
718 >     * Sets  the current torque of this stuntDouble
719       * @param trq  new torque
720       */        
721      void setTrq(const Vector3d& trq) {
# Line 666 | Line 723 | namespace oopse{
723      }
724  
725      /**
726 <     * Sets  the torque of this stuntdouble in specified snapshot
726 >     * Sets  the torque of this stuntDouble in specified snapshot
727       *
728       * @param trq torque to be set
729       * @param snapshotNo
# Line 677 | Line 734 | namespace oopse{
734      }
735  
736      /**
737 <     * Adds torque into the previous torque of this stuntdouble
737 >     * Adds torque into the previous torque of this stuntDouble
738       *
739       * @param trq  new torque
740       * @see #getTrq
# Line 687 | Line 744 | namespace oopse{
744      }
745        
746      /**
747 <     * Adds torque into the current torque of this stuntdouble
747 >     * Adds torque into the current torque of this stuntDouble
748       * @param trq  new torque
749       */        
750      void addTrq(const Vector3d& trq) {
# Line 695 | Line 752 | namespace oopse{
752      }
753  
754      /**
755 <     * Adds torque into the torque of this stuntdouble in specified snapshot
755 >     * Adds torque into the torque of this stuntDouble in specified snapshot
756       *
757       * @param trq torque to be add
758       * @param snapshotNo
# Line 706 | Line 763 | namespace oopse{
763      }      
764  
765  
766 +
767      /**
768 <     * Returns the previous z-angle of this stuntdouble
769 <     * @return the z-angle of this stuntdouble
768 >     * Returns the previous particlePot of this stuntDouble
769 >     * @return the particlePot of this stuntDouble
770       */    
771 +    RealType getPrevParticlePot() {
772 +      return ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_];
773 +    }
774 +      
775 +    /**
776 +     * Returns the current particlePot of this stuntDouble
777 +     * @return the particlePot of this stuntDouble
778 +     */    
779 +    RealType getParticlePot() {
780 +      return ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_];
781 +    }
782 +
783 +    /**
784 +     * Returns the particlePot of this stuntDouble in specified snapshot
785 +     *
786 +     * @return the particlePot of this stuntDouble
787 +     * @param snapshotNo
788 +     */    
789 +    RealType getParticlePot(int snapshotNo) {
790 +      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_];
791 +    }
792 +
793 +    /**
794 +     * Sets  the previous particlePot of this stuntDouble
795 +     *
796 +     * @param particlePot  new particlePot
797 +     * @see #getParticlePot
798 +     */        
799 +    void setPrevParticlePot(const RealType& particlePot) {
800 +      ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] = particlePot;
801 +    }
802 +      
803 +    /**
804 +     * Sets  the current particlePot of this stuntDouble
805 +     * @param particlePot  new particlePot
806 +     */        
807 +    void setParticlePot(const RealType& particlePot) {
808 +      ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] = particlePot;
809 +    }
810 +
811 +    /**
812 +     * Sets  the particlePot of this stuntDouble in specified snapshot
813 +     *
814 +     * @param particlePot particlePot to be set
815 +     * @param snapshotNo
816 +     * @see #getParticlePot
817 +     */        
818 +    void setParticlePot(const RealType& particlePot, int snapshotNo) {
819 +      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] = particlePot;
820 +    }
821 +
822 +    /**
823 +     * Adds particlePot into the previous particlePot of this stuntDouble
824 +     *
825 +     * @param particlePot  new particlePot
826 +     * @see #getParticlePot
827 +     */        
828 +    void addPrevParticlePot(const RealType& particlePot) {
829 +      ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] += particlePot;
830 +    }
831 +      
832 +    /**
833 +     * Adds particlePot into the current particlePot of this stuntDouble
834 +     * @param particlePot  new particlePot
835 +     */        
836 +    void addParticlePot(const RealType& particlePot) {
837 +      ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] += particlePot;
838 +    }
839 +
840 +    /**
841 +     * Adds particlePot into the particlePot of this stuntDouble in specified snapshot
842 +     *
843 +     * @param particlePot particlePot to be add
844 +     * @param snapshotNo
845 +     * @see #getParticlePot
846 +     */        
847 +    void addParticlePot(const RealType& particlePot, int snapshotNo) {
848 +      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] += particlePot;
849 +    }      
850 +
851 +
852 +    /**
853 +     * Returns the previous z-angle of this stuntDouble
854 +     * @return the z-angle of this stuntDouble
855 +     */    
856      RealType getPrevZangle() {
857        return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_];
858      }
859        
860      /**
861 <     * Returns the current z-angle of this stuntdouble
862 <     * @return the z-angle of this stuntdouble
861 >     * Returns the current z-angle of this stuntDouble
862 >     * @return the z-angle of this stuntDouble
863       */    
864      RealType getZangle() {
865        return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_];
866      }
867  
868      /**
869 <     * Returns the z-angle of this stuntdouble in specified snapshot
870 <     * @return the z-angle of this stuntdouble
869 >     * Returns the z-angle of this stuntDouble in specified snapshot
870 >     * @return the z-angle of this stuntDouble
871       * @param snapshotNo
872       */    
873      RealType getZangle(int snapshotNo) {
# Line 732 | Line 875 | namespace oopse{
875      }
876  
877      /**
878 <     * Sets  the previous z-angle of this stuntdouble
878 >     * Sets  the previous z-angle of this stuntDouble
879       * @param angle  new z-angle
880       * @see #getZangle
881       */        
# Line 741 | Line 884 | namespace oopse{
884      }
885        
886      /**
887 <     * Sets  the current z-angle of this stuntdouble
887 >     * Sets  the current z-angle of this stuntDouble
888       * @param angle  new z-angle
889       */        
890      void setZangle(RealType angle) {
# Line 749 | Line 892 | namespace oopse{
892      }
893  
894      /**
895 <     * Sets  the z-angle of this stuntdouble in specified snapshot
895 >     * Sets  the z-angle of this stuntDouble in specified snapshot
896       * @param angle z-angle to be set
897       * @param snapshotNo
898       * @see #getZangle
# Line 759 | Line 902 | namespace oopse{
902      }
903  
904      /**
905 <     * Adds z-angle into the previous z-angle of this stuntdouble
905 >     * Adds z-angle into the previous z-angle of this stuntDouble
906       * @param angle  new z-angle
907       * @see #getZangle
908       */        
# Line 768 | Line 911 | namespace oopse{
911      }
912        
913      /**
914 <     * Adds z-angle into the current z-angle of this stuntdouble
914 >     * Adds z-angle into the current z-angle of this stuntDouble
915       * @param angle  new z-angle
916       */        
917      void addZangle(RealType angle) {
# Line 776 | Line 919 | namespace oopse{
919      }
920  
921      /**
922 <     * Adds z-angle into the z-angle of this stuntdouble in specified snapshot
922 >     * Adds z-angle into the z-angle of this stuntDouble in specified snapshot
923       * @param angle z-angle to be add
924       * @param snapshotNo
925       * @see #getZangle
# Line 785 | Line 928 | namespace oopse{
928        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle;
929      }      
930  
931 <    /** Set the force of this stuntdouble to zero */
931 >    /** Set the force of this stuntDouble to zero */
932      void zeroForcesAndTorques();
933      /**
934 <     * Returns the inertia tensor of this stuntdouble
935 <     * @return the inertia tensor of this stuntdouble
934 >     * Returns the inertia tensor of this stuntDouble
935 >     * @return the inertia tensor of this stuntDouble
936       */
937      virtual Mat3x3d getI() = 0;
938  
939      /**
940 <     * Returns the gradient of this stuntdouble
941 <     * @return the gradient of this stuntdouble
940 >     * Returns the gradient of this stuntDouble
941 >     * @return the gradient of this stuntDouble
942       */
943      virtual std::vector<RealType> getGrad() = 0;
944  
945      /**
946 <     * Tests the  if this stuntdouble is a  linear rigidbody
946 >     * Tests the  if this stuntDouble is a  linear rigidbody
947       *
948 <     * @return true if this stuntdouble is a  linear rigidbody, otherwise return false
948 >     * @return true if this stuntDouble is a  linear rigidbody, otherwise return false
949       * @note atom and directional atom will always return false
950       *
951       * @see #linearAxis
# Line 822 | Line 965 | namespace oopse{
965        return linearAxis_;
966      }
967  
968 <    /** Returns the mass of this stuntdouble */
968 >    /** Returns the mass of this stuntDouble */
969      RealType getMass() {
970        return mass_;
971      }
# Line 835 | Line 978 | namespace oopse{
978        mass_ = mass;
979      }
980  
981 <    /** Returns the name of this stuntdouble */
981 >    /** Returns the name of this stuntDouble */
982      virtual std::string getType() = 0;
983          
984 <    /** Sets the name of this stuntRealType*/
984 >    /** Sets the name of this stuntDouble*/
985      virtual void setType(const std::string& name) {}
986  
987      /**
# Line 866 | Line 1009 | namespace oopse{
1009      Vector3d body2Lab(const Vector3d& v, int frame){
1010        return getA(frame).transpose() * v;
1011      }
1012 +
1013      /**
1014       * <p>
1015 <     * The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on
1016 <     * the elements of a data structure. In this way, you can change the operation being performed
1017 <     * on a structure without the need of changing the classes of the elements that you are operating
1018 <     * on. Using a Visitor pattern allows you to decouple the classes for the data structure and the
1019 <     * algorithms used upon them
1015 >     * The purpose of the Visitor Pattern is to encapsulate an
1016 >     * operation that you want to perform on the elements of a data
1017 >     * structure. In this way, you can change the operation being
1018 >     * performed on a structure without the need of changing the
1019 >     * classes of the elements that you are operating on. Using a
1020 >     * Visitor pattern allows you to decouple the classes for the data
1021 >     * structure and the algorithms used upon them
1022       * </p>
1023       * @param v visitor
1024       */      
# Line 932 | Line 1078 | namespace oopse{
1078  
1079          
1080      int globalIndex_;
1081 +    int globalIntegrableObjectIndex_;
1082      int localIndex_;
1083  
1084  
# Line 942 | Line 1089 | namespace oopse{
1089      PropertyMap properties_;
1090    };
1091  
1092 < }//end namespace oopse
1092 > }//end namespace OpenMD
1093   #endif //PRIMITIVES_STUNTDOUBLE_HPP

Comparing:
trunk/src/primitives/StuntDouble.hpp (property svn:keywords), Revision 963 by tim, Wed May 17 21:51:42 2006 UTC vs.
branches/development/src/primitives/StuntDouble.hpp (property svn:keywords), Revision 1627 by gezelter, Tue Sep 13 22:05:04 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines