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 573 by gezelter, Wed Aug 10 19:17:39 2005 UTC vs.
Revision 1024 by tim, Wed Aug 30 18:42:29 2006 UTC

# Line 97 | Line 97 | namespace oopse{
97      virtual ~StuntDouble();
98          
99      /**
100 <     * Returns the global index of this stuntdouble.
100 >     * Returns the global index of this stuntRealType.
101       * @return  the global index of this stuntdouble
102       */
103      int getGlobalIndex() {
# Line 105 | Line 105 | namespace oopse{
105      }
106  
107      /**
108 <     * Sets the global index of this stuntdouble.
108 >     * Sets the global index of this stuntRealType.
109       * @param new global index to be set
110       */
111      void setGlobalIndex(int index) {
# Line 128 | Line 128 | namespace oopse{
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
140       */
# Line 168 | Line 175 | namespace oopse{
175      }
176  
177      /**
178 +     * Freezes out all velocity, angular velocity, forces and torques
179 +     * on this StuntDouble.  Also computes the number of frozen degrees
180 +     * of freedom.
181 +     * @return the total number of frozen degrees of freedom
182 +     */  
183 +    int freeze() {
184 +      
185 +      int fdf = 3;
186 +
187 +      setVel(V3Zero);
188 +      setFrc(V3Zero);
189 +      if (isDirectional()){
190 +        setJ(V3Zero);
191 +        setTrq(V3Zero);
192 +        if (isLinear())
193 +          fdf +=2;
194 +        else
195 +          fdf +=3;        
196 +      }      
197 +      return fdf;
198 +    }
199 +
200 +    /**
201       * Returns the previous position of this stuntdouble
202       * @return the position of this stuntdouble
203       */    
# Line 460 | Line 490 | namespace oopse{
490      }
491  
492      /**
493 <     * Sets  the previous euler angles of this stuntdouble.
493 >     * Sets  the previous euler angles of this stuntRealType.
494       * @param euler  new euler angles
495       * @see #getEuler
496       * @note actual storage data is rotation matrix        
# Line 687 | Line 717 | namespace oopse{
717       * Returns the previous z-angle of this stuntdouble
718       * @return the z-angle of this stuntdouble
719       */    
720 <    double getPrevZangle() {
720 >    RealType getPrevZangle() {
721        return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_];
722      }
723        
# Line 695 | Line 725 | namespace oopse{
725       * Returns the current z-angle of this stuntdouble
726       * @return the z-angle of this stuntdouble
727       */    
728 <    double getZangle() {
728 >    RealType getZangle() {
729        return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_];
730      }
731  
# Line 704 | Line 734 | namespace oopse{
734       * @return the z-angle of this stuntdouble
735       * @param snapshotNo
736       */    
737 <    double getZangle(int snapshotNo) {
737 >    RealType getZangle(int snapshotNo) {
738        return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_];
739      }
740  
# Line 713 | Line 743 | namespace oopse{
743       * @param angle  new z-angle
744       * @see #getZangle
745       */        
746 <    void setPrevZangle(double angle) {
746 >    void setPrevZangle(RealType angle) {
747        ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle;
748      }
749        
# Line 721 | Line 751 | namespace oopse{
751       * Sets  the current z-angle of this stuntdouble
752       * @param angle  new z-angle
753       */        
754 <    void setZangle(double angle) {
754 >    void setZangle(RealType angle) {
755        ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle;
756      }
757  
# Line 731 | Line 761 | namespace oopse{
761       * @param snapshotNo
762       * @see #getZangle
763       */        
764 <    void setZangle(double angle, int snapshotNo) {
764 >    void setZangle(RealType angle, int snapshotNo) {
765        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle;
766      }
767  
# Line 740 | Line 770 | namespace oopse{
770       * @param angle  new z-angle
771       * @see #getZangle
772       */        
773 <    void addPrevZangle(double angle) {
773 >    void addPrevZangle(RealType angle) {
774        ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle;
775      }
776        
# Line 748 | Line 778 | namespace oopse{
778       * Adds z-angle into the current z-angle of this stuntdouble
779       * @param angle  new z-angle
780       */        
781 <    void addZangle(double angle) {
781 >    void addZangle(RealType angle) {
782        ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle;
783      }
784  
# Line 758 | Line 788 | namespace oopse{
788       * @param snapshotNo
789       * @see #getZangle
790       */        
791 <    void addZangle(double angle, int snapshotNo) {
791 >    void addZangle(RealType angle, int snapshotNo) {
792        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle;
793      }      
794  
# Line 774 | Line 804 | namespace oopse{
804       * Returns the gradient of this stuntdouble
805       * @return the gradient of this stuntdouble
806       */
807 <    virtual std::vector<double> getGrad() = 0;
807 >    virtual std::vector<RealType> getGrad() = 0;
808  
809      /**
810       * Tests the  if this stuntdouble is a  linear rigidbody
# Line 800 | Line 830 | namespace oopse{
830      }
831  
832      /** Returns the mass of this stuntdouble */
833 <    double getMass() {
833 >    RealType getMass() {
834        return mass_;
835      }
836  
# Line 808 | Line 838 | namespace oopse{
838       * Sets the mass of this stuntdoulbe
839       * @param mass the mass to be set
840       */        
841 <    void setMass(double mass) {
841 >    void setMass(RealType mass) {
842        mass_ = mass;
843      }
844  
845      /** Returns the name of this stuntdouble */
846      virtual std::string getType() = 0;
847          
848 <    /** Sets the name of this stuntdouble*/
848 >    /** Sets the name of this stuntRealType*/
849      virtual void setType(const std::string& name) {}
850  
851      /**
# Line 909 | Line 939 | namespace oopse{
939  
940          
941      int globalIndex_;
942 +    int globalIntegrableObjectIndex_;
943      int localIndex_;
944  
945  
946 <    double mass_;
946 >    RealType mass_;
947          
948    private:
949          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines