All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
joint.h
1 /* Copyright (C) 2004-2014 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@googlemail.com
18  */
19 
20 #ifndef _JOINT_H_
21 #define _JOINT_H_
22 
23 #include "mbsim/links/floating_frame_link.h"
24 
25 namespace MBSim {
26 
27  class GeneralizedForceLaw;
28  class GeneralizedImpactLaw;
29  class FrictionForceLaw;
30  class FrictionImpactLaw;
31  class Body;
32 
42  class Joint : public FloatingFrameLink {
43  public:
48  Joint(const std::string &name = "");
49 
53  virtual ~Joint();
54 
55  /* INHERITED INTERFACE OF LINKINTERFACE */
56  void updatelaF() { (this->*updatelaF_)(); updlaF = false; }
57  void updatelaM() { (this->*updatelaM_)(); updlaM = false; }
58  void updatelaF0() { }
59  void updatelaFS();
60  void updatelaFM();
61  void updatelaM0() { }
62  void updatelaMS();
63  void updatelaMM();
64  void (Joint::*updatelaF_)();
65  void (Joint::*updatelaM_)();
66  void updateh(int i=0);
67  void updateW(int i=0);
68  void updatewb();
69  /***************************************************/
70 
71  /* INHERITED INTERFACE OF EXTRADYNAMICINTERFACE */
72  virtual void updatexd();
73  virtual void updatedx();
74  virtual void calcxSize();
75  virtual void init(InitStage stage);
76  /***************************************************/
77 
78  /* INHERITED INTERFACE OF LINK */
79  virtual bool isSetValued() const;
80  virtual bool isSingleValued() const;
81  virtual bool isActive() const { return true; }
82  virtual bool gActiveChanged() { return false; }
83  virtual void solveImpactsFixpointSingle();
84  virtual void solveConstraintsFixpointSingle();
85  virtual void solveImpactsGaussSeidel();
86  virtual void solveConstraintsGaussSeidel();
87  virtual void solveImpactsRootFinding();
88  virtual void solveConstraintsRootFinding();
89  virtual void jacobianConstraints();
90  virtual void jacobianImpacts();
91  virtual void updaterFactors();
92  virtual void checkImpactsForTermination();
93  virtual void checkConstraintsForTermination();
94  /***************************************************/
95 
96  /* GETTER / SETTER */
97  void setForceLaw(GeneralizedForceLaw * rc);
98  void setMomentLaw(GeneralizedForceLaw * rc);
99  /***************************************************/
100 
104  void setForceDirection(const fmatvec::Mat3xV& fd);
105 
109  void setMomentDirection(const fmatvec::Mat3xV& md);
110 
111  virtual void initializeUsingXML(xercesc::DOMElement *element);
112 
113  virtual std::string getType() const { return "Joint"; }
114 
115  protected:
119  fmatvec::Mat3xV JT;
120 
125 
130 
135 
140 
145  };
146 
147  class InverseKineticsJoint : public Joint {
148  public:
149  InverseKineticsJoint(const std::string &name);
150  virtual void updateb();
151  void calcbSize();
152  void setBody(Body* body_) {
153  body = body_;
154  }
155  virtual void init(InitStage stage);
156  virtual bool isSetValued() const { return true; }
157 
158  protected:
159  Body* body;
160  };
161 
162 }
163 
164 #endif
virtual void solveConstraintsFixpointSingle()
Definition: joint.cc:205
basic force law on acceleration level for constraint description
Definition: generalized_force_law.h:32
Joint(const std::string &name="")
constructor
Definition: joint.cc:38
virtual void updaterFactors()
update relaxation factors for contact equations
Definition: joint.cc:382
void setForceDirection(const fmatvec::Mat3xV &fd)
Definition: joint.cc:475
virtual ~Joint()
destructor
Definition: joint.cc:41
virtual void solveConstraintsGaussSeidel()
Definition: joint.cc:253
virtual void jacobianConstraints()
computes JACOBIAN and mass action matrix of nonlinear contact equations
Definition: joint.cc:325
virtual void init(InitStage stage)
plots time series header
Definition: joint.cc:109
fmatvec::Mat3xV JT
translational JACOBIAN (not empty for e.g. prismatic joints)
Definition: joint.h:119
void setMomentDirection(const fmatvec::Mat3xV &md)
Definition: joint.cc:483
virtual bool gActiveChanged()
Definition: joint.h:82
GeneralizedForceLaw * ffl
Definition: joint.h:124
virtual void init(InitStage stage)
plots time series header
Definition: joint.cc:517
virtual void solveImpactsGaussSeidel()
Definition: joint.cc:229
class for connections: constraints on frames
Definition: joint.h:42
GeneralizedForceLaw * fml
Definition: joint.h:129
virtual void checkImpactsForTermination()
verify underlying force laws on velocity level concerning given tolerances
Definition: joint.cc:405
virtual void jacobianImpacts()
computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level ...
Definition: joint.cc:354
InitStage
The stages of the initialization.
Definition: element.h:97
void calcbSize()
calculates size of rfactors
Definition: joint.cc:506
virtual bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: joint.h:156
virtual std::string getType() const
Definition: joint.h:113
GeneralizedImpactLaw * fiml
Definition: joint.h:139
virtual bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: joint.cc:159
basic force law on velocity level for constraint description
Definition: generalized_impact_law.h:32
GeneralizedImpactLaw * fifl
Definition: joint.h:134
std::string name
name of element
Definition: element.h:298
virtual void solveConstraintsRootFinding()
Definition: joint.cc:301
virtual void solveImpactsRootFinding()
Definition: joint.cc:277
virtual bool isActive() const
Definition: joint.h:81
virtual void solveImpactsFixpointSingle()
Definition: joint.cc:181
virtual bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: joint.cc:169
fmatvec::Vec gdn
relative velocity and acceleration after an impact for event driven scheme summarizing all possible c...
Definition: joint.h:144
virtual void checkConstraintsForTermination()
verify underlying force laws concerning given tolerances
Definition: joint.cc:435
base class for all mechanical bodies with mass and generalised coordinates
Definition: body.h:50
Definition: joint.h:147

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML