All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
elastic_joint.h
1 /* Copyright (C) 2004-2016 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 _ELASTIC_JOINT_H_
21 #define _ELASTIC_JOINT_H_
22 
23 #include "mbsim/links/floating_frame_link.h"
24 #include "mbsim/functions/function.h"
25 
26 namespace MBSim {
27 
33  public:
38  ElasticJoint(const std::string &name = "");
39 
43  virtual ~ElasticJoint();
44 
45  void updateGeneralizedForces();
46 
47  /* INHERITED INTERFACE OF EXTRADYNAMICINTERFACE */
48  virtual void updatexd();
49  virtual void updatedx();
50  virtual void calcxSize();
51  virtual void init(InitStage stage);
52  /***************************************************/
53 
54  /* INHERITED INTERFACE OF LINK */
55  virtual bool isSingleValued() const { return true; }
56  virtual bool isActive() const { return true; }
57  virtual bool gActiveChanged() { return false; }
58  /***************************************************/
59 
60  void setGeneralizedForceFunction(Function<fmatvec::VecV(fmatvec::VecV,fmatvec::VecV)> *func_) {
61  func=func_;
62  func->setParent(this);
63  func->setName("GeneralizedForce");
64  }
65 
69  void setForceDirection(const fmatvec::Mat3xV& fd);
70 
74  void setMomentDirection(const fmatvec::Mat3xV& md);
75 
76  virtual void initializeUsingXML(xercesc::DOMElement *element);
77 
78  virtual std::string getType() const { return "ElasticJoint"; }
79 
80  protected:
82 
86  fmatvec::Mat3xV JT;
87  };
88 
89 }
90 
91 #endif
virtual bool gActiveChanged()
Definition: elastic_joint.h:57
void setMomentDirection(const fmatvec::Mat3xV &md)
Definition: elastic_joint.cc:72
virtual bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: elastic_joint.h:55
class for elastic joints
Definition: elastic_joint.h:32
fmatvec::Mat3xV JT
translational JACOBIAN (not empty for e.g. prismatic joints)
Definition: elastic_joint.h:86
ElasticJoint(const std::string &name="")
constructor
Definition: elastic_joint.cc:34
virtual bool isActive() const
Definition: elastic_joint.h:56
virtual ~ElasticJoint()
destructor
Definition: elastic_joint.cc:37
InitStage
The stages of the initialization.
Definition: element.h:97
Definition: planar_contour.h:31
virtual void init(InitStage stage)
plots time series header
Definition: elastic_joint.cc:59
std::string name
name of element
Definition: element.h:298
void setName(const std::string &str)
Definition: element.h:163
virtual std::string getType() const
Definition: elastic_joint.h:78
void setForceDirection(const fmatvec::Mat3xV &fd)
Definition: elastic_joint.cc:64

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML