mbsimflexiblebody  3.0.0
flexible_body_1s_21_ancf.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 _BODY_FLEXIBLE_1S_21_ANCF_H_
22 #define _BODY_FLEXIBLE_1S_21_ANCF_H_
23 
24 #include "body_flexible.h"
25 
26 namespace MBSim {
27 
28  class FiniteElement1s21ANCF;
29  class Contour1sFlexible;
30 
35  class BodyFlexible1s21ANCF : public BodyFlexible1s {
36 
37  protected:
38  FiniteElement1s21ANCF *balken;
39  static const int NodeDOFs;
40  static const int ElementalDOFs;
41 
42  int Elements;
43  double L, E, A, I, rho;
44  bool openStructure;
45  bool implicit;
46 
47  Vec qElement,uElement;
48  int CurrentElement;
49  SqrMat Dhq, Dhqp;
50 
51  // KOS-Definition und Lage des ersten Knoten im Weltsystem
52  Vec WrON00,WrON0;
53 
54  void BuildElement(const int&);
55  double BuildElement(const double&);
56 
57  void updateStateDependentVariables(double t);
58  void updatePorts(double t);
59 
60  void updateh(double t);
61  void init(InitStage stage);
62  void initM();
63  bool initialized;
64  double alphaRelax0, alphaRelax;
65 
66  double sTangent;
67  Vec Wt, Wn, WrOC, WvC, Womega;
68 
70  Contour1sFlexible *contourR, *contourL;
71 
72  public:
73  BodyFlexible1s21ANCF(const string &name, bool openStructure);
74 
75  void setNumberElements(int n);
76  void setLength(double L_) {L = L_;}
77  void setEModul(double E_) {E = E_;}
78  void setCrossSectionalArea(double A_) {A = A_;}
79  void setMomentInertia(double I_) {I = I_;}
80  void setDensity(double rho_) {rho = rho_;}
81  /* void setCurleRadius(double r) {rc = r;if(initialized) balken->setCurleRadius(rc);} */
82  /* void setMaterialDamping(double d) {dm = d;if(initialized) balken->setMaterialDamping(dm);} */
83  /* void setLehrDamping(double d) {dl = d;if(initialized) balken->setLehrDamping(dl);} */
84 
89  void addPort(const string &name, const int &node);
90 
91  Mat computeJacobianMatrix(const ContourPointData &data);
92 
93  Mat computeWt (const ContourPointData &S_);
94  Vec computeWn (const ContourPointData &S_);
95  Vec computeWrOC(const ContourPointData &S_);
96  Vec computeWvC (const ContourPointData &S_);
97  Vec computeWomega(const ContourPointData &S_);
98 
99  bool hasConstMass() const {return true;}
100 
101  void setJT(const Mat &JT_) {assert(JT_.cols()==2); JT = JT_;};
102  void setJR(const Mat &JR_) {assert(JR_.cols()==1); JR = JR_;};
103 
104  void setWrON00(const Vec &WrON00_) {WrON00 = WrON00_;}
105  void initRelaxed(double alpha);
106  };
107 
108 }
109 
110 #endif