mbsimflexiblebody  3.0.0
finite_element_1s_33_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: thorsten.schindler@mytum.de
18  */
19 
20 #ifndef _FINITE_ELEMENT_1S_33_COSSERAT_ROTATION_H_
21 #define _FINITE_ELEMENT_1S_33_COSSERAT_ROTATION_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 
48  class FiniteElement1s33CosseratRotation : public MBSim::DiscretizationInterface {
49  public:
50 
61  FiniteElement1s33CosseratRotation(double l0_,double E_,double G_,double I1_,double I2_,double I0_,CardanPtr ag_);
62 
67 
68  /* INHERITED INTERFACE OF DISCRETIZATIONINTERFACE */
69  virtual const fmatvec::SymMat& getM() const;
70  virtual const fmatvec::Vec& geth() const;
71  virtual const fmatvec::SqrMat& getdhdq() const;
72  virtual const fmatvec::SqrMat& getdhdu() const;
73  virtual int getqSize() const;
74  virtual int getuSize() const;
75 
76  virtual void computeM(const fmatvec::Vec& qG);
77  virtual void computeh(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
78  virtual void computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
79  virtual double computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
80  virtual double computeGravitationalEnergy(const fmatvec::Vec& qG);
81  virtual double computeElasticEnergy(const fmatvec::Vec& qG);
82 
83  virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
84  virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
85  virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
86  virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
87  virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& qG, const MBSim::ContourPointData& data);
88 
89  /* GETTER / SETTER */
90  void setCurlRadius(double R1,double R2);
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, I2, I0;
120 
124  double k10, k20;
125 
129  fmatvec::Vec h;
130 
134  fmatvec::Vec X;
135 
139  fmatvec::SqrMat dhdq, dhdu;
140 
144  CardanPtr ag;
145 
146  FiniteElement1s33CosseratRotation(); // standard constructor
148  FiniteElement1s33CosseratRotation& operator=(const FiniteElement1s33CosseratRotation&); // assignment operator
149  };
150 
151  inline const fmatvec::SymMat& FiniteElement1s33CosseratRotation::getM() const { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratRotation::getM): Not implemented"); }
152  inline const fmatvec::Vec& FiniteElement1s33CosseratRotation::geth() const { return h; }
153  inline const fmatvec::SqrMat& FiniteElement1s33CosseratRotation::getdhdq() const { return dhdq; }
154  inline const fmatvec::SqrMat& FiniteElement1s33CosseratRotation::getdhdu() const { return dhdu; }
155  inline int FiniteElement1s33CosseratRotation::getqSize() const { return 9; }
156  inline int FiniteElement1s33CosseratRotation::getuSize() const { return 9; }
157  inline void FiniteElement1s33CosseratRotation::computeM(const fmatvec::Vec& qG) { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratRotation::computeM): Not implemented"); }
158  inline void FiniteElement1s33CosseratRotation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratRotation::computedhdz): Not implemented"); }
159  inline double FiniteElement1s33CosseratRotation::computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratRotation::computeKineticEnergy): Not implemented"); }
160  inline double FiniteElement1s33CosseratRotation::computeGravitationalEnergy(const fmatvec::Vec& qG) { throw MBSim::MBSimError("Error(FiniteElement1s33CosseratRotation::computeGravitationalEnergy): Not implemented"); }
161  inline fmatvec::Vec FiniteElement1s33CosseratRotation::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratRotation::computePosition): Not implemented!"); }
162  inline fmatvec::SqrMat FiniteElement1s33CosseratRotation::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratRotation::computeOrientation): Not implemented!"); }
163  inline fmatvec::Vec FiniteElement1s33CosseratRotation::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratRotation::computeVelocity): Not implemented!"); }
164  inline fmatvec::Vec FiniteElement1s33CosseratRotation::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratRotation::computeAngularVelocity): Not implemented!"); }
165  inline fmatvec::Mat FiniteElement1s33CosseratRotation::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { return computeJXqG(qG,data.getLagrangeParameterPosition()(0)); }
166  inline double FiniteElement1s33CosseratRotation::getl0() const { return l0; }
167  inline fmatvec::Mat FiniteElement1s33CosseratRotation::computeJXqG(const fmatvec::Vec& qG,double x) { throw MBSim::MBSimError("ERROR (FiniteElement1s33CosseratRotation::computeJXqG): Not implemented!"); }
168 
169 }
170 
171 #endif /* _FINITE_ELEMENT_1S_33_COSSERAT_ROTATION_H_ */