mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
1s_cosserat.h
1 /* Copyright (C) 2004-2012 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_COSSERAT_H_
21 #define FLEXIBLE_BODY_1S_COSSERAT_H_
22 
23 #include "mbsimFlexibleBody/flexible_body/1s.h"
24 #include "mbsimFlexibleBody/pointer.h"
25 //#include <mbsimFlexibleBody/contours/nc/contour_1s_neutral_cosserat.h>
26 //#include "mbsimFlexibleBody/flexible_body/fe/1s_33_cosserat_translation.h"
27 //#include "mbsimFlexibleBody/flexible_body/fe/1s_33_cosserat_rotation.h"
28 //#include "mbsimFlexibleBody/flexible_body/fe/1s_21_cosserat_translation.h"
29 //#include "mbsimFlexibleBody/flexible_body/fe/1s_21_cosserat_rotation.h"
30 //#include <openmbvcppinterface/spineextrusion.h>
31 //
32 //#include "mbsimFlexibleBody/contours/nurbs_curve_1s.h"
33 
34 namespace MBSimFlexibleBody {
35 
50  class Contour1sNeutralCosserat;
51 
53  public:
54 
60  FlexibleBody1sCosserat(const std::string &name, bool openStructure);
61 
62  /* INHERITED INTERFACE OF FLEXIBLE BODY */
63  void BuildElements() override =0;
64  const fmatvec::Vec& evalqRotationElement(int i) { if(updEle) BuildElements(); return qRotationElement[i]; }
65  const fmatvec::Vec& evaluRotationElement(int i) { if(updEle) BuildElements(); return uRotationElement[i]; }
66  void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec) override =0;
67  void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat) override =0;
68  void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat) override =0;
69  void exportPositionVelocity(const std::string & filenamePos, const std::string & filenameVel = std::string(), const int & deg = 3, const bool & writePsFile = false) override =0;
70  void importPositionVelocity(const std::string & filenamePos, const std::string & filenameVel = std::string()) override =0;
71  /***************************************************/
72 
73  /* INHERITED INTERFACE OF OBJECTINTERFACE */
74  void updateh(int i = 0) override;
75 
76  /* INHERITED INTERFACE OF ELEMENT */
77  /***************************************************/
78 
79  /* GETTER / SETTER */
80  virtual void setNumberElements(int n)=0;
81  void setEGModuls(double E_, double G_) { E = E_; G = G_; }
82  void setDensity(double rho_) { rho = rho_; }
83  void setCrossSectionalArea(double A_) { A = A_; }
84 
85  virtual void setMomentsInertia(double I1_, double I2_, double I0_) { }
86  virtual void setMomentsInertia(double I1_) { }
87 
88  virtual void setCurlRadius(double R1_, double R2_) { }
89  virtual void setCurlRadius(double R1_) { }
90  virtual void setMaterialDamping(double cEps0D_, double cEps1D_, double cEps2D_) { }
91  virtual void setMaterialDamping(double cEps0D_, double cEps1D_) { }
92 
96  virtual Contour1sNeutralCosserat* createNeutralPhase(const std::string & contourName = "Neutral");
97 
105  virtual fmatvec::Mat3xV transformJacobian(fmatvec::Mat3xV J) { return J; }
106 
107  virtual int getNumberOfElementDOF() const { throwError("(FlexibleBody1sCosserat::getNumberOfElementDOF): Not implemented!"); }
108  virtual int getNumberElements() const { return Elements; }
109  virtual int getqSizeFull() const { return getqSize(); }
110 
111  /***************************************************/
112 
113 // /**
114 // * \brief compute state (positions, angles, velocities, differentiated angles) at Lagrangian coordinate in local FE coordinates
115 // * \param Lagrangian coordinate
116 // */
117 // virtual fmatvec::Vec computeState(double s)=0;
118 //
119 // /**
120 // * \brief compute angles at Lagrangian coordinate in local FE coordinates
121 // * \param Lagrangian coordinate
122 // */
123 // virtual fmatvec::Vec3 computeAngles(double sGlobal, const fmatvec::Vec & vec)=0;
124 
128  virtual void initInfo()=0;
129 
136  virtual void BuildElementTranslation(const double& sGlobal, double& sLocal, int& currentElementTranslation) = 0;
137 
138  protected:
139 
143  std::vector<DiscretizationInterface*> rotationDiscretization;
144 
148  std::vector<fmatvec::Vec> qRotationElement;
149 
153  std::vector<fmatvec::Vec> uRotationElement;
154 
158  CardanPtr angle;
159 
163  int Elements;
164 
169 
173  double l0;
174 
178  double E, G;
179 
183  double A;
184 
191  double I1;
192 
196  double rho;
197 
203  double R1;
204 
208  double cEps0D, cEps1D;
209 
214 
220  fmatvec::Vec bound_ang_start;
221  fmatvec::Vec bound_ang_end;
222  fmatvec::Vec bound_ang_vel_start;
223  fmatvec::Vec bound_ang_vel_end;
224 
229 
230  FlexibleBody1sCosserat(); // standard constructor
231  FlexibleBody1sCosserat(const FlexibleBody1sCosserat&); // copy constructor
232  FlexibleBody1sCosserat& operator=(const FlexibleBody1sCosserat&); // assignment operator
233 
237  virtual void initM()=0;
238 
244  virtual void computeBoundaryCondition()=0;
245 
252  virtual void GlobalVectorContributionRotation(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec)=0;
253  };
254 }
255 
256 #endif /* FLEXIBLE_BODY_1S_COSSERAT_H_ */
void GlobalVectorContribution(int n, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec) override=0
insert &#39;local&#39; information in global vectors
std::vector< fmatvec::Vec > qRotationElement
stl-vector of finite element positions for rotation grid
Definition: 1s_cosserat.h:148
void importPositionVelocity(const std::string &filenamePos, const std::string &filenameVel=std::string()) override=0
imports the interpolated position and optional the velocity files (created with exportPositionVelocit...
tbd
Definition: 1s.h:33
int Elements
number of translational elements
Definition: 1s_cosserat.h:163
fmatvec::Vec bound_ang_start
boundary conditions for rotation grid first and last finite difference rotation beam element refer to...
Definition: 1s_cosserat.h:220
double R1
radius of undeformed shape R1: in t-b-plane R2: in t-n-plane
Definition: 1s_cosserat.h:203
void exportPositionVelocity(const std::string &filenamePos, const std::string &filenameVel=std::string(), const int &deg=3, const bool &writePsFile=false) override=0
interpolates the position and optional the velocity coordinates of the flexible body with Nurbs-packa...
Definition: 1s_cosserat.h:52
std::vector< fmatvec::Vec > uRotationElement
stl-vector of finite element wise velocities for rotation grid
Definition: 1s_cosserat.h:153
bool openStructure
flag for open (cantilever beam) or closed (rings) structures
Definition: 1s.h:73
double E
elastic modules
Definition: 1s_cosserat.h:178
void BuildElements() override=0
references finite element coordinates to assembled coordinates
CardanPtr angle
angle parametrisation
Definition: 1s_cosserat.h:158
virtual fmatvec::Mat3xV transformJacobian(fmatvec::Mat3xV J)
interface function to transform the Jacobian if the generalized coordinates have been changed ...
Definition: 1s_cosserat.h:105
std::vector< DiscretizationInterface * > rotationDiscretization
stl-vector of finite elements for rotation grid
Definition: 1s_cosserat.h:143
bool updEle
vector of contour parameters each describing a frame
Definition: flexible_body.h:217
double cEps0D
strain damping
Definition: 1s_cosserat.h:208
double A
area of cross-section
Definition: 1s_cosserat.h:183
virtual Contour1sNeutralCosserat * createNeutralPhase(const std::string &contourName="Neutral")
automatically creates its neutral contour
Definition: 1s_cosserat.cc:35
virtual void GlobalVectorContributionRotation(int n, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec)=0
insert &#39;local&#39; information in global vectors for rotation grid
Definition: 1s_neutral_cosserat.h:21
Contour1sNeutralCosserat * ncc
contour for the spine extrusion
Definition: 1s_cosserat.h:228
double rho
density
Definition: 1s_cosserat.h:196
virtual void computeBoundaryCondition()=0
compute boundary conditions for rotation grid first and last finite difference rotation beam element ...
bool initialised
initialised FLAG
Definition: 1s_cosserat.h:213
double I1
area moments of inertia I0: around torsional axis I1: in t-b-plane I2: in t-n-plane ...
Definition: 1s_cosserat.h:191
virtual void initM()=0
initialize translational part of mass matrix and calculate Cholesky decomposition ...
virtual void initInfo()=0
compute state (positions, angles, velocities, differentiated angles) at Lagrangian coordinate in loca...
int rotationalElements
number of rotational elements =Elements (for a closed structure) or =Elements+1 (for an open structur...
Definition: 1s_cosserat.h:168
virtual void BuildElementTranslation(const double &sGlobal, double &sLocal, int &currentElementTranslation)=0
detect current finite element (translation)
double l0
length of entire beam and finite elements
Definition: 1s_cosserat.h:173
void GlobalMatrixContribution(int n, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat) override=0
insert &#39;local&#39; information in global matrices