mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

1s_21_rcm.h
1 /* Copyright (C) 2004-2014 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_RCM_H_
21 #define _FINITE_ELEMENT_1S_21_RCM_H_
22
23 #include "mbsimFlexibleBody/discretization_interface.h"
24 #include "fmatvec/fmatvec.h"
25
26 namespace MBSimFlexibleBody {
27
43 class FiniteElement1s21RCM : public DiscretizationInterface {
44 public:
53 FiniteElement1s21RCM(double l0_, double Arho_, double EA_, double EI_, const fmatvec::Vec &g_);
54
58 ~FiniteElement1s21RCM() override = default;
59
60 /* INHERITED INTERFACE */
61 const fmatvec::SymMat& getM() const override { return M; }
62 const fmatvec::Vec& geth() const override { return h; }
63 const fmatvec::SqrMat& getdhdq() const override { return Dhq; }
64 const fmatvec::SqrMat& getdhdu() const override { return Dhqp; }
65 int getqSize() const override { return 8; }
66 int getuSize() const override { return 8; }
67 void computeM(const fmatvec::Vec& qElement) override;
68 void computeh(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement) override;
69 void computedhdz(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement) override;
70 double computeKineticEnergy(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement) override;
71 double computeGravitationalEnergy(const fmatvec::Vec& qElement) override;
72 virtual double computePhysicalStrain(const fmatvec::Vec& qElement);
73 double computeElasticEnergy(const fmatvec::Vec& qElement) override;
74 virtual fmatvec::Vec3 getPosition(const fmatvec::Vec& qElement, double s);
75 virtual fmatvec::SqrMat3 getOrientation(const fmatvec::Vec& qElement, double s);
76 virtual fmatvec::Vec3 getVelocity (const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s);
77 virtual fmatvec::Vec3 getAngularVelocity(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s);
78 virtual fmatvec::Mat getJacobianOfMotion(const fmatvec::Vec& qElement, double s) { return JGeneralized(qElement,s); }
79 /***************************************************/
83 fmatvec::Vec computeAdditionalElementData(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement);
84
85 /* GETTER / SETTER */
86 void setCurlRadius(double R);
87 void setMaterialDamping(double depsilons);
88 void setLehrDamping(double D);
89 /***************************************************/
90
91 fmatvec::Vec3 getPositions(const fmatvec::Vec& qElement, double s);
92
93 fmatvec::Vec3 getVelocities(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s);
94
101 fmatvec::Mat JGeneralizedInternal(const fmatvec::Vec& qElement, double s);
102
109 fmatvec::Mat JGeneralized (const fmatvec::Vec& qElement, double s);
110
119 fmatvec::Mat JpGeneralized(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, double s, double sp);
120
127 fmatvec::Vec ElementData(fmatvec::Vec qElement, fmatvec::Vec qpElement);
128
129 protected:
133 double l0, Arho, EA, EI;
134
138 double wss0;
139
143 double depsilon;
144
148 fmatvec::Vec g;
149
153 fmatvec::SymMat M;
154
158 fmatvec::Vec h;
159
163 fmatvec::SqrMat Dhq, Dhqp;
164
168 fmatvec::SqrMat Damp;
169
173 fmatvec::Vec qLocal, qpLocal, hIntermediate;
174
178 fmatvec::SymMat MLocal;
179
183 fmatvec::SqrMat Jeg, Jegp;
184
188 fmatvec::Vec qElement_Old, qpElement_Old;
189
193 double tol_comp;
194
195 private:
201 void BuildqLocal(const fmatvec::Vec& qGlobal, fmatvec::Vec& qLocal);
202
208 void BuildJacobi(const fmatvec::Vec& qLocal, fmatvec::SqrMat& Jeg);
209
217 void BuildJacobi(const fmatvec::Vec& qLocal, const fmatvec::Vec& qpIntern, fmatvec::SqrMat& Jeg, fmatvec::SqrMat& Jegp);
218
225 fmatvec::Vec3 evalLocalPositions(const fmatvec::Vec& qLocal, double s);
226
234 fmatvec::Vec3 evalLocalVelocities(const fmatvec::Vec& qLocal, const fmatvec::Vec& qpLocal, double s);
235
248 fmatvec::Mat hFullJacobi(const fmatvec::Vec& qElement, const fmatvec::Vec& qpElement, const fmatvec::Vec& qLocal, const fmatvec::Vec& qpLocal, const fmatvec::SqrMat& Jeg, const fmatvec::SqrMat& Jegp, const fmatvec::SymMat& MLocal, const fmatvec::Vec& hIntermediate);
249
253 double l0h2, l0h3, l0h4, l0h5, l0h7, l0h8;
254
258 FiniteElement1s21RCM() = default;
259 };
260
261 inline double Sec(double alpha) { return 1.0/cos(alpha); }
262 inline double Power(double base, int exponent) { return pow(base,exponent); }
263 }
264
265 #endif /* _FINITE_ELEMENT_1S_21_RCM_H_ */
266
MBSimFlexibleBody::FiniteElement1s21RCM::MLocal
fmatvec::SymMat MLocal
local mass matrix
Definition: 1s_21_rcm.h:178
MBSimFlexibleBody::FiniteElement1s21RCM::JpGeneralized
fmatvec::Mat JpGeneralized(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement, double s, double sp)
return the derivative of the JACOBIAN of translation and rotation with respect to generalised global ...
Definition: 1s_21_rcm.cc:362
MBSimFlexibleBody::FiniteElement1s21RCM::Damp
fmatvec::SqrMat Damp
damping matrix
Definition: 1s_21_rcm.h:168
MBSimFlexibleBody::FiniteElement1s21RCM::hFullJacobi
fmatvec::Mat hFullJacobi(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement, const fmatvec::Vec &qLocal, const fmatvec::Vec &qpLocal, const fmatvec::SqrMat &Jeg, const fmatvec::SqrMat &Jegp, const fmatvec::SymMat &MLocal, const fmatvec::Vec &hIntermediate)
calculates JACOBIAN of implicit integration
Definition: 1s_21_rcm.cc:688
MBSimFlexibleBody::FiniteElement1s21RCM
finite element for planar beam using Redundant Coordinate Method (RCM)
Definition: 1s_21_rcm.h:43
MBSimFlexibleBody::FiniteElement1s21RCM::Dhq
fmatvec::SqrMat Dhq
derivative of right hand side with respect to positions and velocities
Definition: 1s_21_rcm.h:163
MBSimFlexibleBody::FiniteElement1s21RCM::evalLocalVelocities
fmatvec::Vec3 evalLocalVelocities(const fmatvec::Vec &qLocal, const fmatvec::Vec &qpLocal, double s)
calculates Cartesian velocity
Definition: 1s_21_rcm.cc:663
MBSimFlexibleBody::FiniteElement1s21RCM::g
fmatvec::Vec g
gravitation
Definition: 1s_21_rcm.h:148
MBSimFlexibleBody::FiniteElement1s21RCM::qLocal
fmatvec::Vec qLocal
internal position and velocities as well as smooth right hand side
Definition: 1s_21_rcm.h:173
MBSimFlexibleBody::FiniteElement1s21RCM::h
fmatvec::Vec h
right hand side
Definition: 1s_21_rcm.h:158
MBSimFlexibleBody::FiniteElement1s21RCM::JGeneralizedInternal
fmatvec::Mat JGeneralizedInternal(const fmatvec::Vec &qElement, double s)
return the JACOBIAN of translation and rotation with respect to generalised internal coordinates
Definition: 1s_21_rcm.cc:284
MBSimFlexibleBody::FiniteElement1s21RCM::JGeneralized
fmatvec::Mat JGeneralized(const fmatvec::Vec &qElement, double s)
return the JACOBIAN of translation and rotation with respect to generalised global coordinates
Definition: 1s_21_rcm.cc:356
MBSimFlexibleBody::FiniteElement1s21RCM::M
fmatvec::SymMat M
mass matrix
Definition: 1s_21_rcm.h:153
MBSimFlexibleBody::FiniteElement1s21RCM::FiniteElement1s21RCM
FiniteElement1s21RCM()=default
constructor is declared private
MBSimFlexibleBody::FiniteElement1s21RCM::evalLocalPositions
fmatvec::Vec3 evalLocalPositions(const fmatvec::Vec &qLocal, double s)
calculates Cartesian position
Definition: 1s_21_rcm.cc:642
MBSimFlexibleBody::FiniteElement1s21RCM::qElement_Old
fmatvec::Vec qElement_Old
global and local state of the last time step
Definition: 1s_21_rcm.h:188
MBSimFlexibleBody::FiniteElement1s21RCM::computeAdditionalElementData
fmatvec::Vec computeAdditionalElementData(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement)
Definition: 1s_21_rcm.cc:443
MBSimFlexibleBody::FiniteElement1s21RCM::getM
const fmatvec::SymMat & getM() const override
Definition: 1s_21_rcm.h:61
MBSimFlexibleBody::FiniteElement1s21RCM::computeM
void computeM(const fmatvec::Vec &qElement) override
compute mass matrix
Definition: 1s_21_rcm.cc:40
MBSimFlexibleBody::FiniteElement1s21RCM::l0h2
double l0h2
powers of the beam length
Definition: 1s_21_rcm.h:253
MBSimFlexibleBody::FiniteElement1s21RCM::getdhdu
const fmatvec::SqrMat & getdhdu() const override
Definition: 1s_21_rcm.h:64
MBSimFlexibleBody::FiniteElement1s21RCM::getqSize
int getqSize() const override
Definition: 1s_21_rcm.h:65
MBSimFlexibleBody::FiniteElement1s21RCM::geth
const fmatvec::Vec & geth() const override
Definition: 1s_21_rcm.h:62
MBSimFlexibleBody::FiniteElement1s21RCM::computeh
void computeh(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement) override
compute smooth right hand side
Definition: 1s_21_rcm.cc:90
MBSimFlexibleBody::FiniteElement1s21RCM::getdhdq
const fmatvec::SqrMat & getdhdq() const override
Definition: 1s_21_rcm.h:63
MBSimFlexibleBody::FiniteElement1s21RCM::computeKineticEnergy
double computeKineticEnergy(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement) override
compute kinetic energy
Definition: 1s_21_rcm.cc:179
MBSimFlexibleBody::DiscretizationInterface
discretization interface for flexible systems
Definition: discretization_interface.h:36
MBSimFlexibleBody::FiniteElement1s21RCM::computeGravitationalEnergy
double computeGravitationalEnergy(const fmatvec::Vec &qElement) override
compute gravitational energy
Definition: 1s_21_rcm.cc:204
MBSimFlexibleBody::FiniteElement1s21RCM::wss0
double wss0
predefined bending curvature
Definition: 1s_21_rcm.h:138
MBSimFlexibleBody::FiniteElement1s21RCM::~FiniteElement1s21RCM
~FiniteElement1s21RCM() override=default
MBSimFlexibleBody::FiniteElement1s21RCM::computeElasticEnergy
double computeElasticEnergy(const fmatvec::Vec &qElement) override
compute elastic energy
Definition: 1s_21_rcm.cc:221
MBSimFlexibleBody::FiniteElement1s21RCM::BuildJacobi
void BuildJacobi(const fmatvec::Vec &qLocal, fmatvec::SqrMat &Jeg)
calculates the JACOBIAN of transformation
MBSimFlexibleBody::FiniteElement1s21RCM::computedhdz
void computedhdz(const fmatvec::Vec &qElement, const fmatvec::Vec &qpElement) override
compute Jacobian for implicit integration
Definition: 1s_21_rcm.cc:171
MBSimFlexibleBody::FiniteElement1s21RCM::depsilon
double depsilon
longitudinal damping
Definition: 1s_21_rcm.h:143
MBSimFlexibleBody::FiniteElement1s21RCM::tol_comp
double tol_comp
tolerance for comparison of state with old state
Definition: 1s_21_rcm.h:193
MBSimFlexibleBody::FiniteElement1s21RCM::Jeg
fmatvec::SqrMat Jeg
transformation global -> internal coordinates coordinates and its derivative
Definition: 1s_21_rcm.h:183
MBSimFlexibleBody::FiniteElement1s21RCM::BuildqLocal
void BuildqLocal(const fmatvec::Vec &qGlobal, fmatvec::Vec &qLocal)
calculates the local beam coordinates
Definition: 1s_21_rcm.cc:475
MBSimFlexibleBody::FiniteElement1s21RCM::getuSize
int getuSize() const override
Definition: 1s_21_rcm.h:66
MBSimFlexibleBody::FiniteElement1s21RCM::ElementData
fmatvec::Vec ElementData(fmatvec::Vec qElement, fmatvec::Vec qpElement)
return some additional element data
MBSimFlexibleBody::FiniteElement1s21RCM::l0
double l0
length, line-density, longitudinal and bending stiffness
Definition: 1s_21_rcm.h:133