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 calcxSize();
51 
52  bool isActive() const { return true; }
53  bool gActiveChanged() { return false; }
54  void init(InitStage stage, const InitConfigSet &config);
55  bool isSetValued() const;
56  virtual void calclaSize(int j);
57  virtual void calcgSize(int j);
58  virtual void calcgdSize(int j);
59 
60  void setForceFunction(Function<double(double,double)> *func_) {
61  func=func_;
62  func->setParent(this);
63  func->setName("Force");
64  }
65  void setReverse(bool reverse_) { reverse = reverse_; }
66  };
67 
68 }
69 
70 #endif
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: gearing.cc:216
virtual void calcgSize(int j)
calculates size of relative distances
Definition: gearing.cc:48
bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: gearing.cc:133
void updatehRef(const fmatvec::Vec &hParent, int j=0)
references to complete and link smooth force vector of dynamic system parent
Definition: gearing.cc:92
bool isActive() const
Definition: gearing.h:52
bool gActiveChanged()
Definition: gearing.h:53
void updateWRef(const fmatvec::Mat &WParent, int j=0)
references to contact force direction matrix of dynamic system parent
Definition: gearing.cc:81
Definition: gearing.h:29
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:235
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
void setName(const std::string &str)
Definition: element.h:115
virtual void calcgdSize(int j)
calculates size of gap velocities
Definition: gearing.cc:51
virtual void calclaSize(int j)
calculates size of contact force parameters
Definition: gearing.cc:45

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Home