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 963 by tim, Wed May 17 21:51:42 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 168 | Line 168 | namespace oopse{
168      }
169  
170      /**
171 +     * Freezes out all velocity, angular velocity, forces and torques
172 +     * on this StuntDouble.  Also computes the number of frozen degrees
173 +     * of freedom.
174 +     * @return the total number of frozen degrees of freedom
175 +     */  
176 +    int freeze() {
177 +      
178 +      int fdf = 3;
179 +
180 +      setVel(V3Zero);
181 +      setFrc(V3Zero);
182 +      if (isDirectional()){
183 +        setJ(V3Zero);
184 +        setTrq(V3Zero);
185 +        if (isLinear())
186 +          fdf +=2;
187 +        else
188 +          fdf +=3;        
189 +      }      
190 +      return fdf;
191 +    }
192 +
193 +    /**
194       * Returns the previous position of this stuntdouble
195       * @return the position of this stuntdouble
196       */    
# Line 460 | Line 483 | namespace oopse{
483      }
484  
485      /**
486 <     * Sets  the previous euler angles of this stuntdouble.
486 >     * Sets  the previous euler angles of this stuntRealType.
487       * @param euler  new euler angles
488       * @see #getEuler
489       * @note actual storage data is rotation matrix        
# Line 687 | Line 710 | namespace oopse{
710       * Returns the previous z-angle of this stuntdouble
711       * @return the z-angle of this stuntdouble
712       */    
713 <    double getPrevZangle() {
713 >    RealType getPrevZangle() {
714        return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_];
715      }
716        
# Line 695 | Line 718 | namespace oopse{
718       * Returns the current z-angle of this stuntdouble
719       * @return the z-angle of this stuntdouble
720       */    
721 <    double getZangle() {
721 >    RealType getZangle() {
722        return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_];
723      }
724  
# Line 704 | Line 727 | namespace oopse{
727       * @return the z-angle of this stuntdouble
728       * @param snapshotNo
729       */    
730 <    double getZangle(int snapshotNo) {
730 >    RealType getZangle(int snapshotNo) {
731        return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_];
732      }
733  
# Line 713 | Line 736 | namespace oopse{
736       * @param angle  new z-angle
737       * @see #getZangle
738       */        
739 <    void setPrevZangle(double angle) {
739 >    void setPrevZangle(RealType angle) {
740        ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle;
741      }
742        
# Line 721 | Line 744 | namespace oopse{
744       * Sets  the current z-angle of this stuntdouble
745       * @param angle  new z-angle
746       */        
747 <    void setZangle(double angle) {
747 >    void setZangle(RealType angle) {
748        ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle;
749      }
750  
# Line 731 | Line 754 | namespace oopse{
754       * @param snapshotNo
755       * @see #getZangle
756       */        
757 <    void setZangle(double angle, int snapshotNo) {
757 >    void setZangle(RealType angle, int snapshotNo) {
758        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle;
759      }
760  
# Line 740 | Line 763 | namespace oopse{
763       * @param angle  new z-angle
764       * @see #getZangle
765       */        
766 <    void addPrevZangle(double angle) {
766 >    void addPrevZangle(RealType angle) {
767        ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle;
768      }
769        
# Line 748 | Line 771 | namespace oopse{
771       * Adds z-angle into the current z-angle of this stuntdouble
772       * @param angle  new z-angle
773       */        
774 <    void addZangle(double angle) {
774 >    void addZangle(RealType angle) {
775        ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle;
776      }
777  
# Line 758 | Line 781 | namespace oopse{
781       * @param snapshotNo
782       * @see #getZangle
783       */        
784 <    void addZangle(double angle, int snapshotNo) {
784 >    void addZangle(RealType angle, int snapshotNo) {
785        ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle;
786      }      
787  
# Line 774 | Line 797 | namespace oopse{
797       * Returns the gradient of this stuntdouble
798       * @return the gradient of this stuntdouble
799       */
800 <    virtual std::vector<double> getGrad() = 0;
800 >    virtual std::vector<RealType> getGrad() = 0;
801  
802      /**
803       * Tests the  if this stuntdouble is a  linear rigidbody
# Line 800 | Line 823 | namespace oopse{
823      }
824  
825      /** Returns the mass of this stuntdouble */
826 <    double getMass() {
826 >    RealType getMass() {
827        return mass_;
828      }
829  
# Line 808 | Line 831 | namespace oopse{
831       * Sets the mass of this stuntdoulbe
832       * @param mass the mass to be set
833       */        
834 <    void setMass(double mass) {
834 >    void setMass(RealType mass) {
835        mass_ = mass;
836      }
837  
838      /** Returns the name of this stuntdouble */
839      virtual std::string getType() = 0;
840          
841 <    /** Sets the name of this stuntdouble*/
841 >    /** Sets the name of this stuntRealType*/
842      virtual void setType(const std::string& name) {}
843  
844      /**
# Line 912 | Line 935 | namespace oopse{
935      int localIndex_;
936  
937  
938 <    double mass_;
938 >    RealType mass_;
939          
940    private:
941          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines