All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
link_mechanics.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 _LINK_MECHANICS_H_
21 #define _LINK_MECHANICS_H_
22 
23 #include "link.h"
24 
25 #ifdef HAVE_OPENMBVCPPINTERFACE
26 namespace OpenMBV {
27  class Group;
28  class Arrow;
29 }
30 #endif
31 
32 namespace H5 {
33  class Group;
34 }
35 
36 namespace MBSim {
37  class Contour;
38 
48  class LinkMechanics : public Link {
49  public:
54  LinkMechanics(const std::string &name);
55 
59  virtual ~LinkMechanics();
60 
61  /* INHERITED INTERFACE OF LINKINTERFACE */
62  virtual void updatedhdz(double t);
63  /***************************************************/
64 
65  /* INHERITED INTERFACE OF EXTRADYNAMICINTERFACE */
66  virtual void init(InitStage stage);
67  /***************************************************/
68 
69  /* INHERITED INTERFACE OF ELEMENT */
70  std::string getType() const { return "Link"; }
71  virtual void plot(double t, double dt = 1);
72  virtual void closePlot();
73  /***************************************************/
74 
75  /* INHERITED INTERFACE OF LINK */
76  virtual void updateWRef(const fmatvec::Mat& ref, int i=0);
77  virtual void updateVRef(const fmatvec::Mat& ref, int i=0);
78  virtual void updatehRef(const fmatvec::Vec &hRef, int i=0);
79  virtual void updatedhdqRef(const fmatvec::Mat& ref, int i=0);
80  virtual void updatedhduRef(const fmatvec::SqrMat& ref, int i=0);
81  virtual void updatedhdtRef(const fmatvec::Vec& ref, int i=0);
82  virtual void updaterRef(const fmatvec::Vec &ref, int i=0);
83  /***************************************************/
84 
85  /*GETTER / SETTER*/
86  const std::vector<Contour*> & getContour() const { return contour; }
87  /*****************/
88 
89  /* INTERFACE TO BE DEFINED IN DERIVED CLASS */
93  virtual void connect(Frame *frame_);
94 
98  virtual void connect(Contour *contour_);
99 
100  const std::vector<Frame*>& getFrame() const {
101  return frame;
102  }
103 
104  protected:
105 #ifdef HAVE_OPENMBVCPPINTERFACE
106  void setOpenMBVForceArrow(const boost::shared_ptr<OpenMBV::Arrow> &arrow, const std::vector<bool>& which);
107  void setOpenMBVMomentArrow(const boost::shared_ptr<OpenMBV::Arrow> &arrow, const std::vector<bool>& which);
108 #endif
109 
113  std::vector<fmatvec::Vec3> WF, WM;
114 
118  std::vector<fmatvec::Mat3xV> fF, fM;
119 
123  std::vector<Frame*> frame;
124 
128  std::vector<Contour*> contour;
129 
130 #ifdef HAVE_OPENMBVCPPINTERFACE
131  boost::shared_ptr<OpenMBV::Group> openMBVForceGrp;
132  std::vector<boost::shared_ptr<OpenMBV::Arrow> > openMBVArrowF;
133  std::vector<boost::shared_ptr<OpenMBV::Arrow> > openMBVArrowM;
134 #endif
135  };
136 }
137 
138 #endif /* _LINK_MECHANICS_H_ */
139 
virtual void connect(Frame *frame_)
Definition: link_mechanics.cc:226
virtual void updatehRef(const fmatvec::Vec &hRef, int i=0)
references to complete and link smooth force vector of dynamic system parent
Definition: link_mechanics.cc:116
std::vector< fmatvec::Mat3xV > fF
cartesian force and moment direction matrix for nonsmooth right hand side
Definition: link_mechanics.h:118
virtual ~LinkMechanics()
destructor
Definition: link_mechanics.cc:40
virtual void closePlot()
closes plot file
Definition: link_mechanics.cc:84
virtual void updateWRef(const fmatvec::Mat &ref, int i=0)
references to contact force direction matrix of dynamic system parent
Definition: link_mechanics.cc:90
std::vector< Frame * > frame
array in which all frames are listed, connecting bodies via a link
Definition: link_mechanics.h:123
virtual void init(InitStage stage)
plots time series header
Definition: link_mechanics.cc:159
virtual void updateVRef(const fmatvec::Mat &ref, int i=0)
references to condensed contact force direction matrix of dynamic system parent
Definition: link_mechanics.cc:103
virtual void updaterRef(const fmatvec::Vec &ref, int i=0)
references to nonsmooth force vector of dynamic system parent
Definition: link_mechanics.cc:146
std::string getType() const
Definition: link_mechanics.h:70
InitStage
The stages of the initialization.
Definition: element.h:97
LinkMechanics(const std::string &name)
constructor
Definition: link_mechanics.cc:37
std::string name
name of element
Definition: element.h:290
general link to one or more objects
Definition: link_mechanics.h:48
std::vector< Contour * > contour
array in which all contours are listed, connecting bodies via link
Definition: link_mechanics.h:128
virtual void plot(double t, double dt=1)
plots time dependent data
Definition: link_mechanics.cc:46
std::vector< fmatvec::Vec3 > WF
force and moment direction for smooth right hand side
Definition: link_mechanics.h:113

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML