mbsimflexiblebody  3.0.0
finite_element_1s_33_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_33_COSSERAT_TRANSLATION_H_
21 #define _FINITE_ELEMENT_1S_33_COSSERAT_TRANSLATION_H_
22 
23 #include "mbsim/discretization_interface.h"
24 #include "mbsim/mbsim_event.h"
25 #include "mbsim/contour_pdata.h"
26 #include "mbsimFlexibleBody/pointer.h"
27 #include "fmatvec.h"
28 
29 namespace MBSimFlexibleBody {
30 
54  class FiniteElement1s33CosseratTranslation : public MBSim::DiscretizationInterface {
55  public:
56 
70  FiniteElement1s33CosseratTranslation(double l0_,double rho_,double A_,double E_,double G_,double I1_,double I2_,double I0_,const fmatvec::Vec& g_,CardanPtr ag_);
71 
76 
77  /* INHERITED INTERFACE OF DISCRETIZATIONINTERFACE */
78  virtual const fmatvec::SymMat& getM() const;
79  virtual const fmatvec::Vec& geth() const;
80  virtual const fmatvec::SqrMat& getdhdq() const;
81  virtual const fmatvec::SqrMat& getdhdu() const;
82  virtual int getqSize() const;
83  virtual int getuSize() const;
84 
85  virtual void computeM(const fmatvec::Vec& qG);
86  virtual void computeh(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
87  virtual void computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
88  virtual double computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
89  virtual double computeGravitationalEnergy(const fmatvec::Vec& qG);
90  virtual double computeElasticEnergy(const fmatvec::Vec& qG);
91 
92  virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
93  virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
94  virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
95  virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
96  virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& qG, const MBSim::ContourPointData& data);
97 
98  /* GETTER / SETTER */
99  void setMaterialDamping(double cEps0D_,double cEps1D_,double cEps2D_);
100  void setShearCorrectionFactors(double sigma1_, double sigma2_);
101  double getl0() const;
102 
109  const fmatvec::Vec& computeStateTranslation(const fmatvec::Vec& qG, const fmatvec::Vec& qGt, double s);
110 
116  fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x);
117 
121  void initM();
122 
123  private:
127  double l0;
128 
132  double rho;
133 
137  double A;
138 
142  double E;
143 
147  double G;
148 
152  double I1, I2, I0;
153 
157  fmatvec::Vec g;
158 
162  double cEps0D, cEps1D, cEps2D;
163 
167  double sigma1, sigma2;
168 
172  fmatvec::SymMat M;
173  fmatvec::Vec h;
174 
178  fmatvec::SqrMat dhdq, dhdu;
179 
183  fmatvec::Vec X;
184 
188  CardanPtr ag;
189 
190  FiniteElement1s33CosseratTranslation(); // standard constructor
192  FiniteElement1s33CosseratTranslation& operator=(const FiniteElement1s33CosseratTranslation&); // assignment operator
193  };
194 
195  inline const fmatvec::SymMat& FiniteElement1s33CosseratTranslation::getM() const { return M; }
196  inline const fmatvec::Vec& FiniteElement1s33CosseratTranslation::geth() const { return h; }
197  inline const fmatvec::SqrMat& FiniteElement1s33CosseratTranslation::getdhdq() const { return dhdq; }
198  inline const fmatvec::SqrMat& FiniteElement1s33CosseratTranslation::getdhdu() const { return dhdu; }
199  inline int FiniteElement1s33CosseratTranslation::getqSize() const { return 9; }
200  inline int FiniteElement1s33CosseratTranslation::getuSize() const { return 9; }
201  inline void FiniteElement1s33CosseratTranslation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratTranslation::computedhdz): Not implemented"); }
202  inline fmatvec::Vec FiniteElement1s33CosseratTranslation::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratTranslation::computePosition): Not implemented!"); }
203  inline fmatvec::SqrMat FiniteElement1s33CosseratTranslation::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratTranslation::computeOrientation): Not implemented!"); }
204  inline fmatvec::Vec FiniteElement1s33CosseratTranslation::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratTranslation::computeVelocity): Not implemented!"); }
205  inline fmatvec::Vec FiniteElement1s33CosseratTranslation::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratTranslation::computeAngularVelocity): Not implemented!"); }
206  inline fmatvec::Mat FiniteElement1s33CosseratTranslation::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { return computeJXqG(qG,data.getLagrangeParameterPosition()(0)); }
207  inline void FiniteElement1s33CosseratTranslation::setShearCorrectionFactors(double sigma1_, double sigma2_) { sigma1 = sigma1_; sigma2 = sigma2_; }
208  inline double FiniteElement1s33CosseratTranslation::getl0() const { return l0; }
209  inline fmatvec::Mat FiniteElement1s33CosseratTranslation::computeJXqG(const fmatvec::Vec& qG,double x) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratTranslation::computeJXqG): Not implemented!"); }
210 
211 }
212 
213 #endif /* _FINITE_ELEMENT_1S_33_COSSERAT_TRANSLATION_H_ */