mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

1s_21_cosserat_rotation.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: thomas.cebulla@mytum.de
18 */
19
20 #ifndef _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_H_
21 #define _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_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
48 class FiniteElement1s21CosseratRotation : public DiscretizationInterface {
49 public:
50
61 FiniteElement1s21CosseratRotation(double l0_,double E_,double G_,double I1_);
62
66 ~FiniteElement1s21CosseratRotation() override;
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 setCurlRadius(double R1);
91 double getl0() const;
92
98 fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x);
99
100 private:
104 double l0;
105
109 double E;
110
114 double G;
115
119 double I1;
120
126 double k10;
127
131 fmatvec::Vec h;
132
136 fmatvec::Vec X;
137
141 fmatvec::SqrMat dhdq, dhdu;
142
143
144 FiniteElement1s21CosseratRotation(); // standard constructor
145 FiniteElement1s21CosseratRotation(const FiniteElement1s21CosseratRotation&); // copy constructor
146 FiniteElement1s21CosseratRotation& operator=(const FiniteElement1s21CosseratRotation&); // assignment operator
147 };
148
149 inline const fmatvec::SymMat& FiniteElement1s21CosseratRotation::getM() const { throw std::runtime_error("(FiniteElement1s21CosseratRotation::getM): Not implemented"); }
150 inline const fmatvec::Vec& FiniteElement1s21CosseratRotation::geth() const { return h; }
151 inline const fmatvec::SqrMat& FiniteElement1s21CosseratRotation::getdhdq() const { return dhdq; }
152 inline const fmatvec::SqrMat& FiniteElement1s21CosseratRotation::getdhdu() const { return dhdu; }
153 inline int FiniteElement1s21CosseratRotation::getqSize() const { return 4; }
154 inline int FiniteElement1s21CosseratRotation::getuSize() const { return 4; }
155 inline void FiniteElement1s21CosseratRotation::computeM(const fmatvec::Vec& qG) { throw std::runtime_error("(FiniteElement1s21CosseratRotation::computeM): Not implemented"); }
156 inline void FiniteElement1s21CosseratRotation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw std::runtime_error("(FiniteElement1s21CosseratRotation::computedhdz): Not implemented"); }
157 inline double FiniteElement1s21CosseratRotation::computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw std::runtime_error("(FiniteElement1s21CosseratRotation::computeKineticEnergy): Not implemented"); }
158 inline double FiniteElement1s21CosseratRotation::computeGravitationalEnergy(const fmatvec::Vec& qG) { throw std::runtime_error("(FiniteElement1s21CosseratRotation::computeGravitationalEnergy): Not implemented"); }
159 inline double FiniteElement1s21CosseratRotation::getl0() const { return l0; }
160
161 }
162
163 #endif /* _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_H_ */
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeGravitationalEnergy
double computeGravitationalEnergy(const fmatvec::Vec &qG) override
compute gravitational energy
Definition: 1s_21_cosserat_rotation.h:158
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::getdhdu
const fmatvec::SqrMat & getdhdu() const override
Definition: 1s_21_cosserat_rotation.h:152
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeh
void computeh(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute smooth right hand side
Definition: 1s_21_cosserat_rotation.cc:39
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::getuSize
int getuSize() const override
Definition: 1s_21_cosserat_rotation.h:154
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeKineticEnergy
double computeKineticEnergy(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute kinetic energy
Definition: 1s_21_cosserat_rotation.h:157
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::h
fmatvec::Vec h
global system description
Definition: 1s_21_cosserat_rotation.h:131
MBSimFlexibleBody::FiniteElement1s21CosseratRotation
finite element for planar beam using Cosserat model : rotation element for bending and torsion
Definition: 1s_21_cosserat_rotation.h:48
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::getqSize
int getqSize() const override
Definition: 1s_21_cosserat_rotation.h:153
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeJXqG
fmatvec::Mat computeJXqG(const fmatvec::Vec &qG, double x)
compute JACOBIAN of contact description in global coordinates
Definition: 1s_21_cosserat_rotation.cc:68
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::l0
double l0
length of finite element
Definition: 1s_21_cosserat_rotation.h:104
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::~FiniteElement1s21CosseratRotation
~FiniteElement1s21CosseratRotation() override
destructor
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeM
void computeM(const fmatvec::Vec &qG) override
compute mass matrix
Definition: 1s_21_cosserat_rotation.h:155
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::getdhdq
const fmatvec::SqrMat & getdhdq() const override
Definition: 1s_21_cosserat_rotation.h:151
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::geth
const fmatvec::Vec & geth() const override
Definition: 1s_21_cosserat_rotation.h:150
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::dhdq
fmatvec::SqrMat dhdq
matrices for implicit integration
Definition: 1s_21_cosserat_rotation.h:141
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computeElasticEnergy
double computeElasticEnergy(const fmatvec::Vec &qG) override
compute elastic energy
Definition: 1s_21_cosserat_rotation.cc:47
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::X
fmatvec::Vec X
state at Lagrangian coordinate
Definition: 1s_21_cosserat_rotation.h:136
MBSimFlexibleBody::DiscretizationInterface
discretization interface for flexible systems
Definition: discretization_interface.h:36
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::I1
double I1
geometrical moment of inertia
Definition: 1s_21_cosserat_rotation.h:119
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::G
double G
shear modulus
Definition: 1s_21_cosserat_rotation.h:114
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::k10
double k10
predefined bending k10: precurvature in t-b-plane k20: precurvature in t-n-plane
Definition: 1s_21_cosserat_rotation.h:126
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::computedhdz
void computedhdz(const fmatvec::Vec &qG, const fmatvec::Vec &qGt) override
compute Jacobian for implicit integration
Definition: 1s_21_cosserat_rotation.h:156
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::getM
const fmatvec::SymMat & getM() const override
Definition: 1s_21_cosserat_rotation.h:149
MBSimFlexibleBody::FiniteElement1s21CosseratRotation::E
double E
Young's modulus.
Definition: 1s_21_cosserat_rotation.h:109