mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
1s_21_cosserat_translation.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 _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_H_
21 #define _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_H_
22 
23 #include "mbsimFlexibleBody/discretization_interface.h"
24 #include "mbsim/mbsim_event.h"
25 #include "mbsimFlexibleBody/pointer.h"
26 #include "fmatvec/fmatvec.h"
27 
28 namespace MBSimFlexibleBody {
29 
49  public:
50 
61  FiniteElement1s21CosseratTranslation(double l0_,double rho_,double A_,double E_,double G_,double I1_,const fmatvec::Vec& g_);
62 
67 
68  /* INHERITED INTERFACE OF DISCRETIZATIONINTERFACE */
69  const fmatvec::SymMat& getM() const override;
70  const fmatvec::Vec& geth() const override;
71  const fmatvec::SqrMat& getdhdq() const override;
72  const fmatvec::SqrMat& getdhdu() const override;
73  int getqSize() const override;
74  int getuSize() const override;
75 
76  void computeM(const fmatvec::Vec& qG) override;
77  void computeh(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) override;
78  void computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) override;
79  double computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) override;
80  double computeGravitationalEnergy(const fmatvec::Vec& qG) override;
81  double computeElasticEnergy(const fmatvec::Vec& qG) override;
82 
83  virtual fmatvec::Vec3 getPosition(const fmatvec::Vec& qElement, double s);
84  virtual fmatvec::SqrMat3 getOrientation(const fmatvec::Vec& qElement, double s);
85  virtual fmatvec::Vec3 getVelocity (const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s);
86  virtual fmatvec::Vec3 getAngularVelocity(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s);
87  virtual fmatvec::Mat getJacobianOfMotion(const fmatvec::Vec& qElement, double s) { return computeJXqG(qElement,s); }
88 
89  /* GETTER / SETTER */
90  void setMaterialDamping(double cEps0D_,double cEps1D_);
91  void setShearCorrectionFactors(double sigma1_);
92  double getl0() const;
93 
100  const fmatvec::Vec& computeStateTranslation(const fmatvec::Vec& qG, const fmatvec::Vec& qGt, double s);
101 
107  fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x);
108 
112  void initM();
113 
114  private:
118  double l0;
119 
123  double rho;
124 
128  double A;
129 
133  double E;
134 
138  double G;
139 
143  double I1;
144 
148  fmatvec::Vec g;
149 
153  double cEps0D, cEps1D;
154 
158  double sigma1;
159 
163  fmatvec::SymMat M;
164  fmatvec::Vec h;
165 
169  fmatvec::SqrMat dhdq, dhdu;
170 
174  fmatvec::Vec X;
175 
179  CardanPtr ag;
180 
181  FiniteElement1s21CosseratTranslation(); // standard constructor
183  FiniteElement1s21CosseratTranslation& operator=(const FiniteElement1s21CosseratTranslation&); // assignment operator
184  };
185 
186  inline const fmatvec::SymMat& FiniteElement1s21CosseratTranslation::getM() const { return M; }
187  inline const fmatvec::Vec& FiniteElement1s21CosseratTranslation::geth() const { return h; }
188  inline const fmatvec::SqrMat& FiniteElement1s21CosseratTranslation::getdhdq() const { return dhdq; }
189  inline const fmatvec::SqrMat& FiniteElement1s21CosseratTranslation::getdhdu() const { return dhdu; }
190  inline int FiniteElement1s21CosseratTranslation::getqSize() const { return 5; }
191  inline int FiniteElement1s21CosseratTranslation::getuSize() const { return 5; }
192  inline void FiniteElement1s21CosseratTranslation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw std::runtime_error("(FiniteElement1s21CosseratTranslation::computedhdz): Not implemented"); }
193  inline void FiniteElement1s21CosseratTranslation::setShearCorrectionFactors(double sigma1_) { sigma1 = sigma1_; }
194  inline double FiniteElement1s21CosseratTranslation::getl0() const { return l0; }
195 
196 }
197 
198 #endif /* _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_H_ */
CardanPtr ag
Cardan-object.
Definition: 1s_21_cosserat_translation.h:179
double computeElasticEnergy(const fmatvec::Vec &qG) override
compute elastic energy
Definition: 1s_21_cosserat_translation.cc:143
const fmatvec::SqrMat & getdhdu() const override
Definition: 1s_21_cosserat_translation.h:189
const fmatvec::SymMat & getM() const override
Definition: 1s_21_cosserat_translation.h:186
double rho
density
Definition: 1s_21_cosserat_translation.h:123
double cEps0D
strain damping
Definition: 1s_21_cosserat_translation.h:153
double A
cross sectional area
Definition: 1s_21_cosserat_translation.h:128
double l0
length of finite element
Definition: 1s_21_cosserat_translation.h:118
fmatvec::Mat computeJXqG(const fmatvec::Vec &qG, double x)
compute JACOBIAN of contact description in global coordinates
Definition: 1s_21_cosserat_translation.cc:180
fmatvec::Vec g
gravitation
Definition: 1s_21_cosserat_translation.h:148
finite translation element for planar beam using Cosserat model
Definition: 1s_21_cosserat_translation.h:48
double I1
geometrical moment of inertia
Definition: 1s_21_cosserat_translation.h:143
void computedhdz(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute Jacobian for implicit integration
Definition: 1s_21_cosserat_translation.h:192
double computeKineticEnergy(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute kinetic energy
Definition: 1s_21_cosserat_translation.cc:127
double sigma1
shear correction factors
Definition: 1s_21_cosserat_translation.h:158
void initM()
initialize translational part of mass matrix
Definition: 1s_21_cosserat_translation.cc:184
double G
shear modulus
Definition: 1s_21_cosserat_translation.h:138
fmatvec::Vec X
state at Lagrangian coordinate
Definition: 1s_21_cosserat_translation.h:174
const fmatvec::Vec & geth() const override
Definition: 1s_21_cosserat_translation.h:187
const fmatvec::SqrMat & getdhdq() const override
Definition: 1s_21_cosserat_translation.h:188
int getqSize() const override
Definition: 1s_21_cosserat_translation.h:190
discretization interface for flexible systems
Definition: discretization_interface.h:36
int getuSize() const override
Definition: 1s_21_cosserat_translation.h:191
double E
Young's modulus.
Definition: 1s_21_cosserat_translation.h:133
fmatvec::SqrMat dhdq
matrices for implicit integration
Definition: 1s_21_cosserat_translation.h:169
fmatvec::SymMat M
global system description
Definition: 1s_21_cosserat_translation.h:163
const fmatvec::Vec & computeStateTranslation(const fmatvec::Vec &qG, const fmatvec::Vec &qGt, double s)
compute state of finite element
Definition: 1s_21_cosserat_translation.cc:154
double computeGravitationalEnergy(const fmatvec::Vec &qG) override
compute gravitational energy
Definition: 1s_21_cosserat_translation.cc:139
void computeM(const fmatvec::Vec &qG) override
compute mass matrix
Definition: 1s_21_cosserat_translation.cc:40
void computeh(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute smooth right hand side
Definition: 1s_21_cosserat_translation.cc:43