mbsimflexiblebody  3.0.0
flexible_body_2s_13.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  */
19 
20 #ifndef FLEXIBLEBODY2S13_H_
21 #define FLEXIBLEBODY2S13_H_
22 
23 #include "mbsimFlexibleBody/flexible_body.h"
24 
25 namespace MBSimFlexibleBody {
26 
27  class NurbsDisk2s;
28 
32  enum LockType { innerring,outerring };
33 
40  fmatvec::Mat condenseMatrixRows(fmatvec::Mat A, fmatvec::Index I);
41 
48  fmatvec::Mat condenseMatrixCols(fmatvec::Mat A, fmatvec::Index I);
49 
56  fmatvec::SymMat condenseMatrix(fmatvec::SymMat A,fmatvec::Index I);
57 
62  void MapleOutput(fmatvec::Mat A, std::string MatName, std::string file);
63 
68  void MapleOutput(fmatvec::SymMat C, std::string MatName, std::string file);
69 
80  class FlexibleBody2s13 : public FlexibleBodyContinuum<fmatvec::Vec> {
81  public:
86  FlexibleBody2s13(const std::string &name, const int & DEBUGLEVEL_=0);
87 
91  virtual ~FlexibleBody2s13() {}
92 
93  /* INHERITED INTERFACE OF OBJECTINTERFACE */
94  virtual void updateh(double t, int j=0);
95  virtual void updatedhdz(double t);
96  virtual void updateStateDependentVariables(double t);
97  /******************************************/
98 
99  /* INHERITED INTERFACE OF OBJECT */
100  virtual void facLLM() {};
101 
102  /* INHERITED INTERFACE OF ELEMENT */
103  virtual void plot(double t, double dt=1);
104  virtual std::string getType() const { return "FlexibleBody2s13"; }
105  /***************************************************/
106 
107  /* GETTER/SETTER */
108  void setRadius(double Ri_,double Ra_) { Ri = Ri_; Ra = Ra_; }
109  void setEModul(double E_) { E = E_; }
110  void setPoissonRatio(double nu_) { nu = nu_; }
111  void setThickness(const fmatvec::Vec &d_) { d = d_; }
112  fmatvec::Vec getThickness() const { return d; }
113  void setDensity(double rho_) { rho = rho_; }
114  int getReferenceDegreesOfFreedom() const { return RefDofs; }
115  int getRadialNumberOfElements() const { return nr; }
116  int getAzimuthalNumberOfElements() const { return nj; }
117  double getInnerRadius() const { return Ri; }
118  double getOuterRadius() const { return Ra; }
119  double getAzimuthalDegree() const { return degU; }
120  double getRadialDegree() const { return degV; }
121  fmatvec::SqrMat getA() const { return A; }
122  fmatvec::SqrMat getG() const { return G; }
123  void setReferenceInertia(double m0_, fmatvec::SymMat J0_) { m0 = m0_; J0 = J0_; }
124  void setLockType(LockType LT_) { LType = LT_; }
125  /***************************************************/
126 
132  void setNumberElements(int nr_,int nj_);
133 
137  double computePotentialEnergy() { return 0.5*q.T()*K*q; }
138 
144  virtual fmatvec::Vec transformCW(const fmatvec::Vec& WrPoint) = 0;
145 
146  protected:
150  int Elements;
151 
155  int NodeDofs;
156 
160  int RefDofs;
161 
165  double E;
166 
170  double nu;
171 
175  double rho;
176 
182  fmatvec::Vec d;
183 
187  double Ri, Ra;
188 
192  double dr, dj;
193 
197  double m0;
198 
202  fmatvec::SymMat J0;
203 
209  int degV, degU;
210 
215 
219  std::vector<fmatvec::Vec> ElementalNodes;
220 
225 
229  fmatvec::SymMat MConst;
230 
234  fmatvec::SymMat K;
235 
239  int nr, nj, Nodes;
240 
247  fmatvec::Mat NodeCoordinates;
248 
254  fmatvec::Matrix<fmatvec::General,int> ElementNodeList;
255 
259  int Dofs;
260 
266  LockType LType;
267 
271  fmatvec::Index ILocked;
272 
276  fmatvec::Vec qext, uext;
277 
281  fmatvec::SqrMat A;
282 
286  fmatvec::SqrMat G;
287 
288  /*
289  * \brief Jacobian for condensation with size Dofs x qSize
290  */
291  fmatvec::Mat Jext;
292 
297 
298  /*
299  * \brief Debug-Output-Level
300  *
301  * 0 = no Debug output
302  * 1 = console Debug Output
303  * 2 = File Debug Output
304  */
305  int DEBUGLEVEL;
306 
311  void BuildElement(const fmatvec::Vec &s);
312 
316  virtual void initMatrices() = 0;
317 
321  virtual void updateAG() = 0;
322 
327  double computeThickness(const double &r_);
328  };
329 
330 }
331 
332 #endif /* FLEXIBLEBODY2S13_H_ */
333