mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
1s_21_rcm.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_1S_21_RCM_H_
21 #define _FLEXIBLE_BODY_1S_21_RCM_H_
22 
23 #include "mbsimFlexibleBody/flexible_body/1s.h"
24 
25 namespace MBSimFlexibleBody {
26 
27  class Frame1s;
28  class NodeFrame;
29 
51  public:
57  FlexibleBody1s21RCM(const std::string &name, bool openStructure);
58 
59  /* INHERITED INTERFACE OF FLEXIBLE BODY */
60  void BuildElements() override;
61 
62  void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec) override;
63  void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat) override;
64  void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat) override;
65 
66  void exportPositionVelocity(const std::string& filenamePos, const std::string& filenameVel = std::string( ), const int & deg = 3, const bool &writePsFile = false) override;
67  void importPositionVelocity(const std::string& filenamePos, const std::string& filenameVel = std::string( )) override;
68 
69  void updatePositions(Frame1s* frame) override;
70  void updateVelocities(Frame1s* frame) override;
71  void updateAccelerations(Frame1s* frame) override;
72  void updateJacobians(Frame1s* frame, int j=0) override;
73  void updateGyroscopicAccelerations(Frame1s* frame) override;
74 
75  virtual void updatePositions(NodeFrame* frame);
76  virtual void updateVelocities(NodeFrame* frame);
77  virtual void updateAccelerations(NodeFrame* frame);
78  virtual void updateJacobians(NodeFrame* frame, int j=0);
79  virtual void updateGyroscopicAccelerations(NodeFrame* frame);
80  /****************************************/
81 
82  /* INHERITED INTERFACE OF OBJECT */
83  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
84  /***************************************************/
85 
86  /* INHERITED INTERFACE OF ELEMENT */
87  void plot() override;
88  /***************************************************/
89 
90  /* GETTER / SETTER */
94  void setNumberElements(int n);
95  int getNumberElements(){return Elements;}
96  double getLength(){return L;}
97  void setEModul(double E_) { E = E_; }
98  void setCrossSectionalArea(double A_) { A = A_; }
99  void setMomentInertia(double I_) { I = I_; }
100  void setDensity(double rho_) { rho = rho_; }
101  void setCurlRadius(double r);
102  void setMaterialDamping(double d);
103  void setLehrDamping(double d);
104  void setElementPlotList(const fmatvec::VecInt& plotElements_) {plotElements <<= plotElements_;}
105  /***************************************************/
106 
111  fmatvec::Vec3 getPositions(double x);
112 
117  fmatvec::Vec3 getVelocities(double x);
118 
122  double computePhysicalStrain(double sGlobal);
123 
128  void initRelaxed(double alpha);
129 
133  void initInfo();
134 
135  protected:
142  void BuildElement(const double& sGlobal, double& sLocal, int& currentElement);
143 
147  int Elements;
148 
152  double l0;
153 
157  double E;
158 
162  double A;
163 
167  double I;
168 
172  double rho;
173 
177  double rc;
178 
182  double dm;
183 
187  double dl;
188 
192  fmatvec::VecInt plotElements;
193 
198  };
199 
200 }
201 
202 #endif /* _FLEXIBLE_BODY_1S_21_RCM_H_ */
fmatvec::VecInt plotElements
variables to plot in addition to state
Definition: 1s_21_rcm.h:192
bool initialized
flag for testing if beam is initialised
Definition: 1s_21_rcm.h:197
double rho
material density
Definition: 1s_21_rcm.h:172
tbd
Definition: 1s.h:33
Definition: frame_1s.h:27
void BuildElement(const double &sGlobal, double &sLocal, int &currentElement)
detect current finite element
Definition: 1s_21_rcm.cc:497
double rc
curl radius
Definition: 1s_21_rcm.h:177
void GlobalVectorContribution(int n, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec) override
insert 'local' information in global vectors
Definition: 1s_21_rcm.cc:69
int Elements
number of finite elements used for discretisation
Definition: 1s_21_rcm.h:147
model for planar beams with large deflection using Redundant Coordinate Method (RCM)
Definition: 1s_21_rcm.h:50
FlexibleBody1s21RCM(const std::string &name, bool openStructure)
constructor:
Definition: 1s_21_rcm.cc:44
bool openStructure
flag for open (cantilever beam) or closed (rings) structures
Definition: 1s.h:73
void GlobalMatrixContribution(int n, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat) override
insert 'local' information in global matrices
Definition: 1s_21_rcm.cc:81
double l0
length of one finite element
Definition: 1s_21_rcm.h:152
double I
moment of inertia of cross-section
Definition: 1s_21_rcm.h:167
std::string name
std::vector< Frame * > frame
double computePhysicalStrain(double sGlobal)
computes the phyiscal strain (compare Zander p.71) of the element, defined by the global position
Definition: 1s_21_rcm.cc:305
void BuildElements() override
references finite element coordinates to assembled coordinates
Definition: 1s_21_rcm.cc:47
void initInfo()
initialise beam only for giving information with respect to state, number elements,...
Definition: 1s_21_rcm.cc:345
double E
modulus of linear elasticity
Definition: 1s_21_rcm.h:157
double A
cross-section area
Definition: 1s_21_rcm.h:162
void initRelaxed(double alpha)
initialise beam state concerning a straight cantilever setting or a circle shaped ring
Definition: 1s_21_rcm.cc:312
fmatvec::Vec3 getVelocities(double x)
compute velocities and differentiated angles at Lagrangian coordinate in local FE coordinates
Definition: 1s_21_rcm.cc:298
double dm
coefficient of material damping
Definition: 1s_21_rcm.h:182
fmatvec::Vec3 getPositions(double x)
compute positions and angle at Lagrangian coordinate in local FE coordinates
Definition: 1s_21_rcm.cc:291
void setNumberElements(int n)
sets size of positions and velocities
Definition: 1s_21_rcm.cc:258
cartesian frame on nodes of flexible bodies
Definition: node_frame.h:31
void importPositionVelocity(const std::string &filenamePos, const std::string &filenameVel=std::string()) override
imports the interpolated position and optional the velocity files (created with exportPositionVelocit...
Definition: 1s_21_rcm.cc:420
double L
length of beam
Definition: 1s.h:68
void exportPositionVelocity(const std::string &filenamePos, const std::string &filenameVel=std::string(), const int &deg=3, const bool &writePsFile=false) override
interpolates the position and optional the velocity coordinates of the flexible body with Nurbs-packa...
Definition: 1s_21_rcm.cc:356
double dl
coefficient of Lehr-damping
Definition: 1s_21_rcm.h:187