mbsimflexiblebody  3.0.0
flexible_body_1s_23_bta.h
1 /* Copyright (C) 2004-2011 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: thorsten.schindler@mytum.de
18  * rzander@users.berlios.de
19  */
20 
21 #ifndef _FLEXIBLE_BODY_1S_23_BTA_H_
22 #define _FLEXIBLE_BODY_1S_23_BTA_H_
23 
24 #include "mbsimFlexibleBody/flexible_body.h"
25 #include "mbsimFlexibleBody/contours/cylinder_flexible.h"
26 #ifdef HAVE_OPENMBVCPPINTERFACE
27 #include <openmbvcppinterface/spineextrusion.h>
28 #endif
29 
30 namespace MBSimFlexibleBody {
31 
39  class FlexibleBody1s23BTA : public FlexibleBodyContinuum<double> {
40  public:
45  FlexibleBody1s23BTA(const std::string &name);
46 
50  virtual ~FlexibleBody1s23BTA() {}
51 
52  /* INHERITED INTERFACE OF FLEXIBLE BODY */
53  virtual void BuildElements();
54  virtual void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec);
55  virtual void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat);
56  virtual void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat);
57  virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::FrameFeature ff, MBSim::Frame *frame=0);
58  virtual void updateJacobiansForFrame(MBSim::ContourPointData &data, MBSim::Frame *frame=0);
59  /***************************************************/
60 
61  /* INHERITED INTERFACE OF OBJECT */
62  virtual void init(MBSim::InitStage stage);
63  /***************************************************/
64 
65  /* INHERITED INTERFACE OF ELEMENT */
66  virtual void plot(double t, double dt=1);
67  virtual std::string getType() const { return "FlexibleBody1s23BTA"; }
68  virtual void initializeUsingXML(TiXmlElement *element);
69  /***************************************************/
70 
71  /* GETTER / SETTER */
75  void setNumberElements(int n);
76  void setLength(double L_) { L = L_; }
77  void setElastModuls(double E_, double G_) { E = E_;G = G_; }
78  void setDensity(double rho_) { rho = rho_; }
79  void setCrossSectionalArea(double A_) { A = A_; }
80  void setMomentsInertia(double Iyy_,double Izz_,double It_) { Iyy = Iyy_; Izz = Izz_; It = It_; }
81  void setContourRadius(double r) { cylinderFlexible->setRadius(r); }
82  void setTorsionalDamping(double d) { dTorsional = d; }
83 #ifdef HAVE_OPENMBVCPPINTERFACE
84  void setOpenMBVSpineExtrusion(OpenMBV::SpineExtrusion* body) { openMBVBody=body; }
85 #endif
86  /***************************************************/
87 
88  protected:
95  void BuildElement(const double& sGlobal, double& sLocal, int& currentElement);
96 
100  int Elements;
101 
105  double L, l0;
106 
110  double E, G;
111 
115  double A;
116 
120  double Iyy, Izz, It;
121 
125  double rho;
126 
130  double rc;
131 
135  double dTorsional;
136 
141  };
142 
143 }
144 
145 #endif /* _FLEXIBLE_BODY_1S_23_BTA_H_ */
146