00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _ISOTROPICROTATIONALSPRINGDAMPER_H_
00020 #define _ISOTROPICROTATIONALSPRINGDAMPER_H_
00021
00022 #include "mbsim/link_mechanics.h"
00023 #include "mbsim/frame.h"
00024
00025 namespace MBSim {
00026
00037 class IsotropicRotationalSpringDamper : public LinkMechanics {
00038 public:
00043 IsotropicRotationalSpringDamper(const std::string &name);
00044
00048 virtual ~IsotropicRotationalSpringDamper();
00049
00050
00051 virtual void updateh(double t, int i = 0);
00052 virtual void updateg(double t);
00053 virtual void updategd(double t);
00054
00055
00056
00057 virtual void init(InitStage stage);
00058
00059
00060
00061 virtual bool isActive() const {
00062 return true;
00063 }
00064 virtual bool gActiveChanged() {
00065 return false;
00066 }
00067 virtual bool isSingleValued() const {
00068 return true;
00069 }
00070
00071
00072 void connect(Frame *frame1, Frame* frame2);
00073
00074
00075 void setParameters(double c_, double d_, double alpha0_) {
00076 c = c_;
00077 d = d_;
00078 alpha0 = alpha0_;
00079 }
00080 void setMomentDirection(const fmatvec::Mat& md);
00081
00082 private:
00086 double c, d, alpha0;
00087
00091 fmatvec::Mat momentDir;
00092 fmatvec::Index IR;
00093
00097 fmatvec::Mat Wm;
00098
00099 };
00100
00101 }
00102
00103 #endif
00104