All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
flexible_body_linear_external_ffr.h
1 /* Copyright (C) 2004-2015 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 _FLEXIBLE_BODY_LINEAR_EXTERNAL_FFR_H_
21 #define _FLEXIBLE_BODY_LINEAR_EXTERNAL_FFR_H_
22 
23 #include <iostream>
24 #include <fstream>
25 #include <sstream>
26 #include <string>
27 #include <stdlib.h>
28 
29 #include "mbsim/frames/frame.h"
30 
31 #include "mbsimFlexibleBody/flexible_body.h"
32 #include "mbsimFlexibleBody/flexible_body/finite_elements/finite_element_linear_external_lumped_node.h"
33 
34 #include "mbsimFlexibleBody/frames/node_frame.h"
35 
36 //namespace unitTest{
37 // class linearExternalFFRTest;
38 //}
39 
40 namespace MBSimFlexibleBody {
41 
48  class FlexibleBodyLinearExternalFFR : public FlexibleBodyContinuum<fmatvec::Vec> /*, public FlexibleContourBody */{
49  public:
54  FlexibleBodyLinearExternalFFR(const std::string &name, const bool &DEBUG_);
55 
60 
61  /* INHERITED INTERFACE OF FLEIBLE BODY CONTOUR */
62  virtual int getNumberElements() const { return nNodes; }
63  virtual double getLength() const;
64  virtual bool isOpenStructure() const { return openStructure; }
65  /***************************************************/
66 
67  /* INHERITED INTERFACE OF FLEXIBLE BODY CONTINUUM */
69  /***************************************************/
70 
71  /* INHERITED INTERFACE OF OBJECTINTERFACE */
72  virtual void updateM();
73  /***************************************************/
74 
75  /* INHERITED INTERFACE OF FLEXIBLE BODY */
76  virtual void BuildElements();
77  virtual void GlobalVectorContribution(int CurrentElement, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec);
78  virtual void GlobalMatrixContribution(int CurrentElement, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat);
79  virtual void GlobalMatrixContribution(int CurrentElement, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat);
80  virtual void updateh(int k = 0);
81  /***************************************************/
82 
83  /* INHERITED INTERFACE OF OBJECT */
84  virtual void init(InitStage stage);
85  virtual void calcqSize();
86  virtual void calcuSize(int j);
87  /***************************************************/
88 
89  /* INHERITED INTERFACE OF ELEMENT */
90  virtual std::string getType() const {
91  return "FlexibleBodyLinearExternalFFR";
92  }
93  /***************************************************/
94 
95  /* GETTER AND SETTER */
96  void setNumberOfModes(int nf_) {
97  nf = nf_;
98  }
99 
100  int getNumberModes() const {
101  return nf;
102  }
103 
104  MBSim::Frame * getFloatingFrameOfReference() {
105  return FFR;
106  }
107 
108  const fmatvec::Vec3 getModeShapeVector(int node, int column) const;
109 
113  void readFEMData(std::string inFilePath, const bool millimeterUnits, bool output = false);
114 
115  void enableFramePlot(double size = 1e-3, fmatvec::VecInt numbers = fmatvec::VecInt(0));
116 
117  void resetUpToDate();
118  const fmatvec::SqrMat3& evalA() { if(updAG) updateAGbarGbardot(); return A; }
119  const fmatvec::SqrMat3& evalG_bar() { if(updAG) updateAGbarGbardot(); return G_bar; }
120  const fmatvec::SqrMat3& evalG_bar_Dot() { if(updAG) updateAGbarGbardot(); return G_bar_Dot; }
121  const fmatvec::Vec& evalQv() { if(updQv) updateQv(); return Qv; }
122 
123  void updatePositions(MBSim::Frame *frame);
124  void updateVelocities(MBSim::Frame *frame);
125  void updateAccelerations(MBSim::Frame *frame);
126  void updateJacobians(MBSim::Frame *frame, int j=0);
127  void updateGyroscopicAccelerations(MBSim::Frame *frame);
128 
129  void updatePositions(NodeFrame *frame);
130  void updateVelocities(NodeFrame *frame);
131  void updateAccelerations(NodeFrame *frame);
132  void updateJacobians(NodeFrame *frame, int j=0);
133  void updateGyroscopicAccelerations(NodeFrame *frame);
134 
135  fmatvec::Vec3 evalLocalPosition(int i);
136 
137  protected:
141  void initM();
142 
146  void initQv();
147 
151  void updateQv();
152 
156  void computeShapeIntegrals();
157 
161  void updateAGbarGbardot();
162 
166  int nNodes;
167 
172 
176  fmatvec::Vec3 I_1;
177 
181  fmatvec::SymMat3 I_kl;
182 
187 
192 
197 
201  fmatvec::SymMat3 I_ThetaTheta_bar;
202 
207 
212 
217 
221  fmatvec::SqrMat3 G_bar;
222 
226  fmatvec::SqrMat3 G_bar_Dot;
227 
231  fmatvec::SqrMat3 A;
232 
237 
242 
247 
252 
257 
261  std::vector<fmatvec::Vec3> u0;
262 
266  int nf;
267 
272 
276  bool DEBUG;
277 
278  bool updAG, updQv;
279  };
280 
281 }
282 
283 #endif /* _FLEXIBLE_BODY_LINEAR_EXTERNAL_FFR_H_ */
void readFEMData(std::string inFilePath, const bool millimeterUnits, bool output=false)
read u0, mij, mode shape matrix and stiffness matrix form the input file
Definition: flexible_body_linear_external_ffr.cc:118
fmatvec::SymMat KFull
full stiffness matrix
Definition: flexible_body_linear_external_ffr.h:216
flexible body model based on floating frame reference using the system information external linear FE...
Definition: flexible_body_linear_external_ffr.h:48
fmatvec::Vec3 I_1
matrix for the computation of the mass-matrix (assembled part of the element matrix) ...
Definition: flexible_body_linear_external_ffr.h:176
void updateQv()
update the quadratic velocity vector
Definition: flexible_body_linear_external_ffr.cc:388
fmatvec::Vec mij
lumped mass for each node
Definition: flexible_body_linear_external_ffr.h:246
virtual void GlobalMatrixContribution(int CurrentElement, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat)
insert &#39;local&#39; information in global matrices
Definition: flexible_body_linear_external_ffr.cc:690
virtual void BuildElements()
references finite element coordinates to assembled coordinates
Definition: flexible_body_linear_external_ffr.cc:682
fmatvec::SqrMat3 A
transformation matrix of coordinates of the moving frame of reference into the reference frame ...
Definition: flexible_body_linear_external_ffr.h:231
fmatvec::Mat phi
matrix of modes used
Definition: flexible_body_linear_external_ffr.h:256
fmatvec::SqrMat3 G_bar_Dot
transformation matrix of the time derivates of the angles into tho angular velocity in reference coor...
Definition: flexible_body_linear_external_ffr.h:226
bool DEBUG
debug flag
Definition: flexible_body_linear_external_ffr.h:276
fmatvec::Mat I_ThetaF_bar
I_ThetaF 3*nf.
Definition: flexible_body_linear_external_ffr.h:206
virtual ~FlexibleBodyLinearExternalFFR()
destructor
Definition: flexible_body_linear_external_ffr.cc:49
fmatvec::SymMat M_FF
matrix for the computation of the mass-matrix (assembled part of the element matrix) ...
Definition: flexible_body_linear_external_ffr.h:236
flexible body entirely described within MBSim holding all informations about continuum approximations...
Definition: flexible_body.h:240
fmatvec::RowVec I_kl_bar[3][3]
matrix for the computation of the mass-matrix (assembled part of the element matrix) ...
Definition: flexible_body_linear_external_ffr.h:196
virtual void GlobalVectorContribution(int CurrentElement, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec)
insert &#39;local&#39; information in global vectors
Definition: flexible_body_linear_external_ffr.cc:686
fmatvec::SqrMat3 G_bar
transformation matrix of the time derivates of the angles into tho angular velocity in reference coor...
Definition: flexible_body_linear_external_ffr.h:221
fmatvec::SymMat3 I_kl
matrix
Definition: flexible_body_linear_external_ffr.h:181
FlexibleBodyLinearExternalFFR(const std::string &name, const bool &DEBUG_)
constructor
Definition: flexible_body_linear_external_ffr.cc:39
int nNodes
total number of nodes
Definition: flexible_body_linear_external_ffr.h:166
void computeShapeIntegrals()
compute the constant shape integrals of the whole body
Definition: flexible_body_linear_external_ffr.cc:433
bool openStructure
open or closed beam structure
Definition: flexible_body_linear_external_ffr.h:271
std::vector< Frame * > frame
fmatvec::SymMat3 I_ThetaTheta_bar
inertia tensor
Definition: flexible_body_linear_external_ffr.h:201
void initM()
initialize the mass matrix
Definition: flexible_body_linear_external_ffr.cc:276
MBSim::Frame * FFR
Floating Frame of Reference.
Definition: flexible_body_linear_external_ffr.h:171
fmatvec::Mat phiFull
matrix of all modes
Definition: flexible_body_linear_external_ffr.h:251
std::vector< fmatvec::Vec3 > u0
initial position of each node
Definition: flexible_body_linear_external_ffr.h:261
void initQv()
initialize the quadratic velocity vector
Definition: flexible_body_linear_external_ffr.cc:382
fmatvec::Mat S_bar
matrix for the computation of the mass-matrix (assembled part of the element matrix) ...
Definition: flexible_body_linear_external_ffr.h:186
fmatvec::Vec Qv
quadratic velocity vector
Definition: flexible_body_linear_external_ffr.h:241
fmatvec::SqrMat S_kl_bar[3][3]
matrix for the computation of the mass-matrix (assembled part of the element matrix) ...
Definition: flexible_body_linear_external_ffr.h:191
int nf
number of mode shapes used to describe the deformation
Definition: flexible_body_linear_external_ffr.h:266
void updateAGbarGbardot()
update A, G_bar, and G_bar_Dot
Definition: flexible_body_linear_external_ffr.cc:497
fmatvec::SymMat K
stiffness matrix
Definition: flexible_body_linear_external_ffr.h:211
cartesian frame on nodes of flexible bodies
Definition: node_frame.h:31

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML