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 1710 by gezelter, Fri May 18 21:44:02 2012 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]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   /**
# Line 58 | Line 59
59   #include "utils/PropertyMap.hpp"
60   #include "brains/Snapshot.hpp"
61   #include "brains/SnapshotManager.hpp"
62 < namespace oopse{
62 > namespace OpenMD{
63  
64  
65    
# Line 83 | Line 84 | namespace oopse{
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
87 >   * @note the dynamic data of stuntDouble will be stored outside of the class
88     */
89    class StuntDouble{
90    public:    
# Line 97 | Line 98 | namespace oopse{
98      virtual ~StuntDouble();
99          
100      /**
101 <     * Returns the global index of this stuntRealType.
102 <     * @return  the global index of this stuntdouble
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 stuntRealType.
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 <        
115 >    
116      /**
117 <     * Returns the local index of this stuntdouble
118 <     * @return the local index of this stuntdouble
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
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
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
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
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
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
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();
# Line 191 | Line 199 | namespace oopse{
199      }
200  
201      /**
202 <     * Returns the previous position of this stuntdouble
203 <     * @return the position of this stuntdouble
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
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 <     * Returns the position of this stuntdouble in specified snapshot
219 <     * @return the position of this stuntdouble
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) {
# Line 216 | Line 224 | namespace oopse{
224      }
225  
226      /**
227 <     * Sets  the previous position of this stuntdouble
227 >     * Sets  the previous position of this stuntDouble
228       * @param pos  new position
229       * @see #getPos
230       */        
# Line 225 | Line 233 | namespace oopse{
233      }
234        
235      /**
236 <     * Sets  the current position of this stuntdouble
236 >     * Sets  the current position of this stuntDouble
237       * @param pos  new position
238       */        
239      void setPos(const Vector3d& pos) {
# Line 235 | Line 243 | namespace oopse{
243      }
244  
245      /**
246 <     * Sets  the position of this stuntdouble in specified snapshot
246 >     * Sets  the position of this stuntDouble in specified snapshot
247       * @param pos position to be set
248       * @param snapshotNo
249       * @see #getPos
# Line 247 | Line 255 | namespace oopse{
255      }
256        
257      /**
258 <     * Returns the previous velocity of this stuntdouble
259 <     * @return the velocity of this stuntdouble
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
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
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) {
# Line 272 | Line 280 | namespace oopse{
280      }
281  
282      /**
283 <     * Sets  the previous velocity of this stuntdouble
283 >     * Sets  the previous velocity of this stuntDouble
284       * @param vel  new velocity
285       * @see #getVel
286       */        
# Line 281 | Line 289 | namespace oopse{
289      }
290        
291      /**
292 <     * Sets  the current velocity of this stuntdouble
292 >     * Sets  the current velocity of this stuntDouble
293       * @param vel  new velocity
294       */        
295      void setVel(const Vector3d& vel) {
# Line 289 | Line 297 | namespace oopse{
297      }
298  
299      /**
300 <     * Sets  the velocity of this stuntdouble in specified snapshot
300 >     * Sets  the velocity of this stuntDouble in specified snapshot
301       * @param vel velocity to be set
302       * @param snapshotNo
303       * @see #getVel
# Line 299 | Line 307 | namespace oopse{
307      }
308  
309      /**
310 <     * Returns the previous rotation matrix of this stuntdouble
311 <     * @return the rotation matrix of this stuntdouble
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
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
326 >     * Returns the rotation matrix of this stuntDouble in specified snapshot
327       *
328 <     * @return the rotation matrix of this stuntdouble
328 >     * @return the rotation matrix of this stuntDouble
329       * @param snapshotNo
330       */    
331      RotMat3x3d getA(int snapshotNo) {
# Line 325 | Line 333 | namespace oopse{
333      }
334  
335      /**
336 <     * Sets  the previous rotation matrix of this stuntdouble
336 >     * Sets  the previous rotation matrix of this stuntDouble
337       * @param a  new rotation matrix
338       * @see #getA
339       */        
# Line 334 | Line 342 | namespace oopse{
342      }
343        
344      /**
345 <     * Sets  the current rotation matrix of this stuntdouble
345 >     * Sets  the current rotation matrix of this stuntDouble
346       * @param a  new rotation matrix
347       */        
348      virtual void setA(const RotMat3x3d& a) {
# Line 342 | Line 350 | namespace oopse{
350      }
351  
352      /**
353 <     * Sets  the rotation matrix of this stuntdouble in specified snapshot
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
# Line 352 | Line 360 | namespace oopse{
360      }      
361  
362      /**
363 <     * Returns the previous angular momentum of this stuntdouble (body-fixed).
364 <     * @return the angular momentum of this stuntdouble
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
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
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) {
# Line 377 | Line 385 | namespace oopse{
385      }
386  
387      /**
388 <     * Sets  the previous angular momentum of this stuntdouble (body-fixed).
388 >     * Sets  the previous angular momentum of this stuntDouble (body-fixed).
389       * @param angMom  new angular momentum
390       * @see #getJ
391       */        
# Line 386 | Line 394 | namespace oopse{
394      }
395        
396      /**
397 <     * Sets  the current angular momentum of this stuntdouble (body-fixed).
397 >     * Sets  the current angular momentum of this stuntDouble (body-fixed).
398       * @param angMom  new angular momentum
399       */        
400      void setJ(const Vector3d& angMom) {
# Line 394 | Line 402 | namespace oopse{
402      }
403  
404      /**
405 <     * Sets the angular momentum of this stuntdouble in specified snapshot(body-fixed).
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
# Line 402 | Line 410 | namespace oopse{
410      void setJ(const Vector3d& angMom, int snapshotNo) {
411        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom;
412      }
413 <        
413 >    
414      /**
415 <     * Returns the previous quaternion of this stuntdouble
416 <     * @return the quaternion of this stuntdouble
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
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
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) {
# Line 429 | Line 487 | namespace oopse{
487      }
488  
489      /**
490 <     * Sets  the previous quaternion of this stuntdouble
490 >     * Sets  the previous quaternion of this stuntDouble
491       * @param q  new quaternion
492       * @note actual storage data is rotation matrix
493       */        
# Line 438 | Line 496 | namespace oopse{
496      }
497        
498      /**
499 <     * Sets  the current quaternion of this stuntdouble
499 >     * Sets  the current quaternion of this stuntDouble
500       * @param q  new quaternion
501       * @note actual storage data is rotation matrix
502       */        
# Line 447 | Line 505 | namespace oopse{
505      }
506  
507      /**
508 <     * Sets  the quaternion of this stuntdouble in specified snapshot
508 >     * Sets  the quaternion of this stuntDouble in specified snapshot
509       *
510       * @param q quaternion to be set
511       * @param snapshotNo
# Line 458 | Line 516 | namespace oopse{
516      }
517  
518      /**
519 <     * Returns the previous euler angles of this stuntdouble
520 <     * @return the euler angles of this stuntdouble
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
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
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) {
# Line 483 | Line 541 | namespace oopse{
541      }
542  
543      /**
544 <     * Sets  the previous euler angles of this stuntRealType.
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        
# Line 493 | Line 551 | namespace oopse{
551      }
552        
553      /**
554 <     * Sets  the current euler angles of this stuntdouble
554 >     * Sets  the current euler angles of this stuntDouble
555       * @param euler  new euler angles
556       */        
557      void setEuler(const Vector3d& euler) {
# Line 501 | Line 559 | namespace oopse{
559      }
560  
561      /**
562 <     * Sets  the euler angles  of this stuntdouble in specified snapshot
562 >     * Sets  the euler angles  of this stuntDouble in specified snapshot
563       *
564       * @param euler euler angles to be set
565       * @param snapshotNo
# Line 512 | Line 570 | namespace oopse{
570      }
571        
572      /**
573 <     * Returns the previous unit vectors of this stuntdouble
574 <     * @return the unit vectors of this stuntdouble
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
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
589 >     * Returns the unit vectors of this stuntDouble in specified snapshot
590       *
591 <     * @return the unit vectors of this stuntdouble
591 >     * @return the unit vectors of this stuntDouble
592       * @param snapshotNo
593       */    
594      RotMat3x3d getElectroFrame(int snapshotNo) {
# Line 538 | Line 596 | namespace oopse{
596      }
597  
598      /**
599 <     * Returns the previous force of this stuntdouble
600 <     * @return the force of this stuntdouble
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
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
615 >     * Returns the force of this stuntDouble in specified snapshot
616       *
617 <     * @return the force of this stuntdouble
617 >     * @return the force of this stuntDouble
618       * @param snapshotNo
619       */    
620      Vector3d getFrc(int snapshotNo) {
# Line 564 | Line 622 | namespace oopse{
622      }
623  
624      /**
625 <     * Sets  the previous force of this stuntdouble
625 >     * Sets  the previous force of this stuntDouble
626       *
627       * @param frc  new force
628       * @see #getFrc
# Line 574 | Line 632 | namespace oopse{
632      }
633        
634      /**
635 <     * Sets  the current force of this stuntdouble
635 >     * Sets  the current force of this stuntDouble
636       * @param frc  new force
637       */        
638      void setFrc(const Vector3d& frc) {
# Line 582 | Line 640 | namespace oopse{
640      }
641  
642      /**
643 <     * Sets  the force of this stuntdouble in specified snapshot
643 >     * Sets  the force of this stuntDouble in specified snapshot
644       *
645       * @param frc force to be set
646       * @param snapshotNo
# Line 593 | Line 651 | namespace oopse{
651      }
652  
653      /**
654 <     * Adds force into the previous force of this stuntdouble
654 >     * Adds force into the previous force of this stuntDouble
655       *
656       * @param frc  new force
657       * @see #getFrc
# Line 603 | Line 661 | namespace oopse{
661      }
662        
663      /**
664 <     * Adds force into the current force of this stuntdouble
664 >     * Adds force into the current force of this stuntDouble
665       * @param frc  new force
666       */        
667      void addFrc(const Vector3d& frc) {
# Line 611 | Line 669 | namespace oopse{
669      }
670  
671      /**
672 <     * Adds force into the force of this stuntdouble in specified snapshot
672 >     * Adds force into the force of this stuntDouble in specified snapshot
673       *
674       * @param frc force to be set
675       * @param snapshotNo
# Line 622 | Line 680 | namespace oopse{
680      }
681  
682      /**
683 <     * Returns the previous torque of this stuntdouble
684 <     * @return the torque of this stuntdouble
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
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
699 >     * Returns the torque of this stuntDouble in specified snapshot
700       *
701 <     * @return the torque of this stuntdouble
701 >     * @return the torque of this stuntDouble
702       * @param snapshotNo
703       */    
704      Vector3d getTrq(int snapshotNo) {
# Line 648 | Line 706 | namespace oopse{
706      }
707  
708      /**
709 <     * Sets  the previous torque of this stuntdouble
709 >     * Sets  the previous torque of this stuntDouble
710       *
711       * @param trq  new torque
712       * @see #getTrq
# Line 658 | Line 716 | namespace oopse{
716      }
717        
718      /**
719 <     * Sets  the current torque of this stuntdouble
719 >     * Sets  the current torque of this stuntDouble
720       * @param trq  new torque
721       */        
722      void setTrq(const Vector3d& trq) {
# Line 666 | Line 724 | namespace oopse{
724      }
725  
726      /**
727 <     * Sets  the torque of this stuntdouble in specified snapshot
727 >     * Sets  the torque of this stuntDouble in specified snapshot
728       *
729       * @param trq torque to be set
730       * @param snapshotNo
# Line 677 | Line 735 | namespace oopse{
735      }
736  
737      /**
738 <     * Adds torque into the previous torque of this stuntdouble
738 >     * Adds torque into the previous torque of this stuntDouble
739       *
740       * @param trq  new torque
741       * @see #getTrq
# Line 687 | Line 745 | namespace oopse{
745      }
746        
747      /**
748 <     * Adds torque into the current torque of this stuntdouble
748 >     * Adds torque into the current torque of this stuntDouble
749       * @param trq  new torque
750       */        
751      void addTrq(const Vector3d& trq) {
# Line 695 | Line 753 | namespace oopse{
753      }
754  
755      /**
756 <     * Adds torque into the torque of this stuntdouble in specified snapshot
756 >     * Adds torque into the torque of this stuntDouble in specified snapshot
757       *
758       * @param trq torque to be add
759       * @param snapshotNo
# Line 706 | Line 764 | namespace oopse{
764      }      
765  
766  
767 +
768      /**
769 <     * Returns the previous z-angle of this stuntdouble
770 <     * @return the z-angle of this stuntdouble
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 +    /**
854 +     * Returns the previous z-angle of this stuntDouble
855 +     * @return the z-angle of this stuntDouble
856 +     */    
857      RealType getPrevZangle() {
858        return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_];
859      }
860        
861      /**
862 <     * Returns the current z-angle of this stuntdouble
863 <     * @return the z-angle of this stuntdouble
862 >     * Returns the current z-angle of this stuntDouble
863 >     * @return the z-angle of this stuntDouble
864       */    
865      RealType getZangle() {
866        return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_];
867      }
868  
869      /**
870 <     * Returns the z-angle of this stuntdouble in specified snapshot
871 <     * @return the z-angle of this stuntdouble
870 >     * Returns the z-angle of this stuntDouble in specified snapshot
871 >     * @return the z-angle of this stuntDouble
872       * @param snapshotNo
873       */    
874      RealType getZangle(int snapshotNo) {
# Line 732 | Line 876 | namespace oopse{
876      }
877  
878      /**
879 <     * Sets  the previous z-angle of this stuntdouble
879 >     * Sets  the previous z-angle of this stuntDouble
880       * @param angle  new z-angle
881       * @see #getZangle
882       */        
# Line 741 | Line 885 | namespace oopse{
885      }
886        
887      /**
888 <     * Sets  the current z-angle of this stuntdouble
888 >     * Sets  the current z-angle of this stuntDouble
889       * @param angle  new z-angle
890       */        
891      void setZangle(RealType angle) {
# Line 749 | Line 893 | namespace oopse{
893      }
894  
895      /**
896 <     * Sets  the z-angle of this stuntdouble in specified snapshot
896 >     * Sets  the z-angle of this stuntDouble in specified snapshot
897       * @param angle z-angle to be set
898       * @param snapshotNo
899       * @see #getZangle
# Line 759 | Line 903 | namespace oopse{
903      }
904  
905      /**
906 <     * Adds z-angle into the previous z-angle of this stuntdouble
906 >     * Adds z-angle into the previous z-angle of this stuntDouble
907       * @param angle  new z-angle
908       * @see #getZangle
909       */        
# Line 768 | Line 912 | namespace oopse{
912      }
913        
914      /**
915 <     * Adds z-angle into the current z-angle of this stuntdouble
915 >     * Adds z-angle into the current z-angle of this stuntDouble
916       * @param angle  new z-angle
917       */        
918      void addZangle(RealType angle) {
# Line 776 | Line 920 | namespace oopse{
920      }
921  
922      /**
923 <     * Adds z-angle into the z-angle of this stuntdouble in specified snapshot
923 >     * Adds z-angle into the z-angle of this stuntDouble in specified snapshot
924       * @param angle z-angle to be add
925       * @param snapshotNo
926       * @see #getZangle
# Line 785 | Line 929 | namespace oopse{
929        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle;
930      }      
931  
932 <    /** Set the force of this stuntdouble to zero */
932 >
933 >    /**
934 >     * Returns the previous fluctuating charge of this stuntDouble
935 >     * @return the fluctuating charge of this stuntDouble
936 >     */    
937 >    RealType getPrevFlucQPos() {
938 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_];
939 >    }
940 >      
941 >    /**
942 >     * Returns the current fluctuating charge of this stuntDouble
943 >     * @return the fluctuating charge of this stuntDouble
944 >     */    
945 >    RealType getFlucQPos() {
946 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_];
947 >    }
948 >
949 >    /**
950 >     * Returns the fluctuating charge of this stuntDouble in specified snapshot
951 >     * @return the fluctuating charge of this stuntDouble
952 >     * @param snapshotNo
953 >     */    
954 >    RealType getFlucQPos(int snapshotNo) {
955 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_];
956 >    }
957 >
958 >    /**
959 >     * Sets  the previous fluctuating charge of this stuntDouble
960 >     * @param charge  new fluctuating charge
961 >     * @see #getflucQPos
962 >     */        
963 >    void setPrevFlucQPos(RealType charge) {
964 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] = charge;
965 >    }
966 >      
967 >    /**
968 >     * Sets  the current fluctuating charge of this stuntDouble
969 >     * @param charge  new fluctuating charge
970 >     */        
971 >    void setFlucQPos(RealType charge) {
972 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] = charge;
973 >    }
974 >
975 >    /**
976 >     * Sets  the fluctuating charge of this stuntDouble in specified snapshot
977 >     * @param charge fluctuating charge to be set
978 >     * @param snapshotNo
979 >     * @see #getflucQPos
980 >     */        
981 >    void setFlucQPos(RealType charge, int snapshotNo) {
982 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] = charge;
983 >    }
984 >
985 >    /**
986 >     * Adds fluctuating charge into the previous fluctuating charge of this stuntDouble
987 >     * @param charge  new fluctuating charge
988 >     * @see #getflucQPos
989 >     */        
990 >    void addPrevFlucQPos(RealType charge) {
991 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] += charge;
992 >    }
993 >      
994 >    /**
995 >     * Adds fluctuating charge into the current fluctuating charge of this stuntDouble
996 >     * @param charge  new fluctuating charge
997 >     */        
998 >    void addFlucQPos(RealType charge) {
999 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] += charge;
1000 >    }
1001 >
1002 >    /**
1003 >     * Adds fluctuating charge into the fluctuating charge of this stuntDouble in specified snapshot
1004 >     * @param value fluctuating charge to be add
1005 >     * @param snapshotNo
1006 >     * @see #getflucQPos
1007 >     */        
1008 >    void addflucQPos(RealType charge, int snapshotNo) {
1009 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] += charge;
1010 >    }      
1011 >
1012 >
1013 >    /**
1014 >     * Returns the previous charge velocity of this stuntDouble
1015 >     * @return the charge velocity of this stuntDouble
1016 >     */    
1017 >    RealType getPrevFlucQVel() {
1018 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_];
1019 >    }
1020 >      
1021 >    /**
1022 >     * Returns the current charge velocity of this stuntDouble
1023 >     * @return the charge velocity of this stuntDouble
1024 >     */    
1025 >    RealType getFlucQVel() {
1026 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_];
1027 >    }
1028 >
1029 >    /**
1030 >     * Returns the charge velocity of this stuntDouble in specified snapshot
1031 >     * @return the charge velocity of this stuntDouble
1032 >     * @param snapshotNo
1033 >     */    
1034 >    RealType getFlucQVel(int snapshotNo) {
1035 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_];
1036 >    }
1037 >
1038 >    /**
1039 >     * Sets  the previous charge velocity of this stuntDouble
1040 >     * @param cvel  new charge velocity
1041 >     * @see #getflucQVel
1042 >     */        
1043 >    void setPrevFlucQVel(RealType cvel) {
1044 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] = cvel;
1045 >    }
1046 >      
1047 >    /**
1048 >     * Sets  the current charge velocity of this stuntDouble
1049 >     * @param cvel  new charge velocity
1050 >     */        
1051 >    void setFlucQVel(RealType cvel) {
1052 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] = cvel;
1053 >    }
1054 >
1055 >    /**
1056 >     * Sets  the charge velocity of this stuntDouble in specified snapshot
1057 >     * @param cvel charge velocity to be set
1058 >     * @param snapshotNo
1059 >     * @see #getflucQVel
1060 >     */        
1061 >    void setFlucQVel(RealType cvel, int snapshotNo) {
1062 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] = cvel;
1063 >    }
1064 >
1065 >    /**
1066 >     * Adds charge velocity into the previous charge velocity of this stuntDouble
1067 >     * @param cvel  new charge velocity
1068 >     * @see #getflucQVel
1069 >     */        
1070 >    void addPrevFlucQVel(RealType cvel) {
1071 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] += cvel;
1072 >    }
1073 >      
1074 >    /**
1075 >     * Adds charge velocity into the current charge velocity of this stuntDouble
1076 >     * @param cvel  new charge velocity
1077 >     */        
1078 >    void addFlucQVel(RealType cvel) {
1079 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] += cvel;
1080 >    }
1081 >
1082 >    /**
1083 >     * Adds charge velocity into the charge velocity of this stuntDouble in specified snapshot
1084 >     * @param value charge velocity to be add
1085 >     * @param snapshotNo
1086 >     * @see #getflucQVel
1087 >     */        
1088 >    void addflucQVel(RealType cvel, int snapshotNo) {
1089 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] += cvel;
1090 >    }      
1091 >
1092 >
1093 >    /**
1094 >     * Returns the previous charge force of this stuntDouble
1095 >     * @return the charge force of this stuntDouble
1096 >     */    
1097 >    RealType getPrevFlucQFrc() {
1098 >      return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_];
1099 >    }
1100 >      
1101 >    /**
1102 >     * Returns the current charge force of this stuntDouble
1103 >     * @return the charge force of this stuntDouble
1104 >     */    
1105 >    RealType getFlucQFrc() {
1106 >      return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_];
1107 >    }
1108 >
1109 >    /**
1110 >     * Returns the charge force of this stuntDouble in specified snapshot
1111 >     * @return the charge force of this stuntDouble
1112 >     * @param snapshotNo
1113 >     */    
1114 >    RealType getFlucQFrc(int snapshotNo) {
1115 >      return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_];
1116 >    }
1117 >
1118 >    /**
1119 >     * Sets  the previous charge force of this stuntDouble
1120 >     * @param cfrc  new charge force
1121 >     * @see #getflucQFrc
1122 >     */        
1123 >    void setPrevFlucQFrc(RealType cfrc) {
1124 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc;
1125 >    }
1126 >      
1127 >    /**
1128 >     * Sets  the current charge force of this stuntDouble
1129 >     * @param cfrc  new charge force
1130 >     */        
1131 >    void setFlucQFrc(RealType cfrc) {
1132 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc;
1133 >    }
1134 >
1135 >    /**
1136 >     * Sets  the charge force of this stuntDouble in specified snapshot
1137 >     * @param cfrc charge force to be set
1138 >     * @param snapshotNo
1139 >     * @see #getflucQFrc
1140 >     */        
1141 >    void setFlucQFrc(RealType cfrc, int snapshotNo) {
1142 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] = cfrc;
1143 >    }
1144 >
1145 >    /**
1146 >     * Adds charge force into the previous charge force of this stuntDouble
1147 >     * @param cfrc  new charge force
1148 >     * @see #getflucQFrc
1149 >     */        
1150 >    void addPrevFlucQFrc(RealType cfrc) {
1151 >      ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc;
1152 >    }
1153 >      
1154 >    /**
1155 >     * Adds charge force into the current charge force of this stuntDouble
1156 >     * @param cfrc  new charge force
1157 >     */        
1158 >    void addFlucQFrc(RealType cfrc) {
1159 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc;
1160 >    }
1161 >
1162 >    /**
1163 >     * Adds charge force into the charge force of this stuntDouble in specified snapshot
1164 >     * @param value charge force to be add
1165 >     * @param snapshotNo
1166 >     * @see #getflucQFrc
1167 >     */        
1168 >    void addflucQFrc(RealType cfrc, int snapshotNo) {
1169 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] += cfrc;
1170 >    }      
1171 >
1172 >
1173 >
1174 >
1175 >    /** Set the force of this stuntDouble to zero */
1176      void zeroForcesAndTorques();
1177      /**
1178 <     * Returns the inertia tensor of this stuntdouble
1179 <     * @return the inertia tensor of this stuntdouble
1178 >     * Returns the inertia tensor of this stuntDouble
1179 >     * @return the inertia tensor of this stuntDouble
1180       */
1181      virtual Mat3x3d getI() = 0;
1182  
1183      /**
1184 <     * Returns the gradient of this stuntdouble
1185 <     * @return the gradient of this stuntdouble
1184 >     * Returns the gradient of this stuntDouble
1185 >     * @return the gradient of this stuntDouble
1186       */
1187      virtual std::vector<RealType> getGrad() = 0;
1188  
1189      /**
1190 <     * Tests the  if this stuntdouble is a  linear rigidbody
1190 >     * Tests the  if this stuntDouble is a  linear rigidbody
1191       *
1192 <     * @return true if this stuntdouble is a  linear rigidbody, otherwise return false
1192 >     * @return true if this stuntDouble is a  linear rigidbody, otherwise return false
1193       * @note atom and directional atom will always return false
1194       *
1195       * @see #linearAxis
# Line 822 | Line 1209 | namespace oopse{
1209        return linearAxis_;
1210      }
1211  
1212 <    /** Returns the mass of this stuntdouble */
1212 >    /** Returns the mass of this stuntDouble */
1213      RealType getMass() {
1214        return mass_;
1215      }
# Line 835 | Line 1222 | namespace oopse{
1222        mass_ = mass;
1223      }
1224  
1225 <    /** Returns the name of this stuntdouble */
1225 >    /** Returns the name of this stuntDouble */
1226      virtual std::string getType() = 0;
1227          
1228 <    /** Sets the name of this stuntRealType*/
1228 >    /** Sets the name of this stuntDouble*/
1229      virtual void setType(const std::string& name) {}
1230  
1231      /**
# Line 866 | Line 1253 | namespace oopse{
1253      Vector3d body2Lab(const Vector3d& v, int frame){
1254        return getA(frame).transpose() * v;
1255      }
1256 +
1257      /**
1258       * <p>
1259 <     * The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on
1260 <     * the elements of a data structure. In this way, you can change the operation being performed
1261 <     * on a structure without the need of changing the classes of the elements that you are operating
1262 <     * on. Using a Visitor pattern allows you to decouple the classes for the data structure and the
1263 <     * algorithms used upon them
1259 >     * The purpose of the Visitor Pattern is to encapsulate an
1260 >     * operation that you want to perform on the elements of a data
1261 >     * structure. In this way, you can change the operation being
1262 >     * performed on a structure without the need of changing the
1263 >     * classes of the elements that you are operating on. Using a
1264 >     * Visitor pattern allows you to decouple the classes for the data
1265 >     * structure and the algorithms used upon them
1266       * </p>
1267       * @param v visitor
1268       */      
# Line 932 | Line 1322 | namespace oopse{
1322  
1323          
1324      int globalIndex_;
1325 +    int globalIntegrableObjectIndex_;
1326      int localIndex_;
1327  
1328  
# Line 942 | Line 1333 | namespace oopse{
1333      PropertyMap properties_;
1334    };
1335  
1336 < }//end namespace oopse
1336 > }//end namespace OpenMD
1337   #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 1710 by gezelter, Fri May 18 21:44:02 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines