All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
mechanical_link.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 _MECHANICAL_LINK_H_
21 #define _MECHANICAL_LINK_H_
22 
23 #include "mbsim/links/link.h"
24 
25 namespace MBSim {
26 
31  class MechanicalLink : public Link {
32  public:
37  MechanicalLink(const std::string &name);
38 
39  void resetUpToDate() override;
40 
41  virtual void updatePositions() { }
42  virtual void updateVelocities() { }
43  void updateGeneralizedForces() override;
44  virtual void updateForce() { }
45  virtual void updateMoment() { }
46  virtual void updateForceDirections() { }
47  virtual void updatelaF() { }
48  virtual void updatelaM() { }
49  virtual void updateR() { }
50  const fmatvec::Vec3& evalForce(int i=1) { if(updF) updateForce(); return F[i]; }
51  const fmatvec::Vec3& evalMoment(int i=1) { if(updM) updateMoment(); return M[i]; }
52  const fmatvec::Mat3xV& evalRF(int i=1) { if(updRMV) updateR(); return RF[i]; }
53  const fmatvec::Mat3xV& evalRM(int i=1) { if(updRMV) updateR(); return RM[i]; }
54  const fmatvec::VecV& evallaF() { if(updlaF) updatelaF(); return lambdaF; }
55  const fmatvec::VecV& evallaM() { if(updlaM) updatelaM(); return lambdaM; }
56 
57  Frame* getPointOfApplication(int i) { return P[i]; }
58 
59  int getNumberOfLinks() { return F.size(); }
60 
61  protected:
62  std::vector<Frame*> P;
63 
64  std::vector<fmatvec::Mat3xV> RF, RM;
65 
66  fmatvec::VecV lambdaF, lambdaM;
67 
68  std::vector<fmatvec::Vec3> F, M;
69 
73  fmatvec::RangeV iF, iM;
74 
75  bool updF, updM, updRMV, updlaF, updlaM;
76  };
77 }
78 
79 #endif
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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Home