All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
gearing.h
1 /* Copyright (C) 2004-2015 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@gmail.com
18  */
19 
20 #ifndef _GEARING_H_
21 #define _GEARING_H_
22 
23 #include "mbsim/mechanical_link.h"
24 #include "mbsim/rigid_body.h"
25 #include "mbsim/frames/frame.h"
26 
27 namespace MBSim {
28 
29  class Gearing : public MechanicalLink {
30  protected:
32  double r0, r1;
33  bool reverse;
34  Frame Z0, Z1;
35  Frame *P0, *P1;
36  fmatvec::Vec3 WrP0Z, WrP1Z;
37  fmatvec::Vec3 Wt;
38  public:
39  Gearing(const std::string &name);
40  void updateh(int i=0);
41  void updateW(int i=0);
42  void updateJacobians(int j=0);
43  void updateg();
44  void updategd();
45  void updatewb();
46  void updatehRef(const fmatvec::Vec &hParent, int j=0);
47  void updateWRef(const fmatvec::Mat &WParent, int j=0);
48  void connect(double r1, Frame* frame1_, double r2, Frame* frame2_);
49  virtual void updatexd();
50  virtual void updatedx();
51  virtual void calcxSize();
52 
53  bool isActive() const { return true; }
54  bool gActiveChanged() { return false; }
55  std::string getType() const { return "Gearing"; }
56  void init(InitStage stage);
57  bool isSetValued() const;
58  virtual void calclaSize(int j);
59  virtual void calcgSize(int j);
60  virtual void calcgdSize(int j);
61 
62  void setForceFunction(Function<double(double,double)> *func_) {
63  func=func_;
64  func->setParent(this);
65  func->setName("Force");
66  }
67  void setReverse(bool reverse_) { reverse = reverse_; }
68 
69  void plot();
70 
71  private:
72  };
73 
74 }
75 
76 #endif
Definition: gearing.h:29
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
void setName(const std::string &str)
Definition: element.h:163

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML