mbsimflexiblebody  4.0.0
finite_element_1s_21_cosserat_rotation.h
00001 /* Copyright (C) 2004-2012 MBSim Development Team
00002  *
00003  * This library is free software; you can redistribute it and/or 
00004  * modify it under the terms of the GNU Lesser General Public 
00005  * License as published by the Free Software Foundation; either 
00006  * version 2.1 of the License, or (at your option) any later version. 
00007  *  
00008  * This library is distributed in the hope that it will be useful, 
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011  * Lesser General Public License for more details. 
00012  *  
00013  * You should have received a copy of the GNU Lesser General Public 
00014  * License along with this library; if not, write to the Free Software 
00015  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
00016  *
00017  * Contact: thomas.cebulla@mytum.de
00018  */
00019 
00020 #ifndef _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_H_
00021 #define _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_H_
00022 
00023 #include "mbsim/discretization_interface.h"
00024 #include "mbsim/mbsim_event.h"
00025 #include "mbsim/contour_pdata.h"
00026 #include "mbsimFlexibleBody/pointer.h"
00027 #include "fmatvec/fmatvec.h"
00028 
00029 namespace MBSimFlexibleBody {
00030 
00049   class FiniteElement1s21CosseratRotation : public MBSim::DiscretizationInterface {
00050     public:
00051 
00062       FiniteElement1s21CosseratRotation(double l0_,double E_,double G_,double I1_);
00063 
00067       virtual ~FiniteElement1s21CosseratRotation();             
00068 
00069       /* INHERITED INTERFACE OF DISCRETIZATIONINTERFACE */ 
00070       virtual const fmatvec::SymMat& getM() const;              
00071       virtual const fmatvec::Vec& geth() const;
00072       virtual const fmatvec::SqrMat& getdhdq() const;
00073       virtual const fmatvec::SqrMat& getdhdu() const;
00074       virtual int getqSize() const;
00075       virtual int getuSize() const;
00076 
00077       virtual void computeM(const fmatvec::Vec& qG);
00078       virtual void computeh(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
00079       virtual void computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
00080       virtual double computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt);
00081       virtual double computeGravitationalEnergy(const fmatvec::Vec& qG);
00082       virtual double computeElasticEnergy(const fmatvec::Vec& qG);
00083 
00084       virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
00085       virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
00086       virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
00087       virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
00088       virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& qG, const MBSim::ContourPointData& data);
00089 
00090       /* GETTER / SETTER */
00091       void setCurlRadius(double R1);
00092       double getl0() const;
00093 
00099       fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x);
00100 
00101     private:
00105       double l0;
00106 
00110       double E;
00111 
00115       double G;
00116 
00120       double I1;
00121 
00127       double k10;
00128 
00132       fmatvec::Vec h;
00133 
00137       fmatvec::Vec X;
00138 
00142       fmatvec::SqrMat dhdq, dhdu;
00143 
00144 
00145       FiniteElement1s21CosseratRotation(); // standard constructor
00146       FiniteElement1s21CosseratRotation(const FiniteElement1s21CosseratRotation&); // copy constructor
00147       FiniteElement1s21CosseratRotation& operator=(const FiniteElement1s21CosseratRotation&); // assignment operator
00148   };
00149 
00150   inline const fmatvec::SymMat& FiniteElement1s21CosseratRotation::getM() const { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::getM): Not implemented");  }
00151   inline const fmatvec::Vec& FiniteElement1s21CosseratRotation::geth() const { return h; }
00152   inline const fmatvec::SqrMat& FiniteElement1s21CosseratRotation::getdhdq() const { return dhdq; }
00153   inline const fmatvec::SqrMat& FiniteElement1s21CosseratRotation::getdhdu() const { return dhdu; }
00154   inline int FiniteElement1s21CosseratRotation::getqSize() const { return 4; }
00155   inline int FiniteElement1s21CosseratRotation::getuSize() const { return 4; }
00156   inline void  FiniteElement1s21CosseratRotation::computeM(const fmatvec::Vec& qG) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeM): Not implemented"); }
00157   inline void  FiniteElement1s21CosseratRotation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computedhdz): Not implemented"); }
00158   inline double FiniteElement1s21CosseratRotation::computeKineticEnergy(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeKineticEnergy): Not implemented"); }
00159   inline double FiniteElement1s21CosseratRotation::computeGravitationalEnergy(const fmatvec::Vec& qG) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeGravitationalEnergy): Not implemented"); }
00160   inline fmatvec::Vec FiniteElement1s21CosseratRotation::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computePosition): Not implemented!"); }
00161   inline fmatvec::SqrMat FiniteElement1s21CosseratRotation::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeOrientation): Not implemented!"); }
00162   inline fmatvec::Vec FiniteElement1s21CosseratRotation::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeVelocity): Not implemented!"); }
00163   inline fmatvec::Vec FiniteElement1s21CosseratRotation::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeAngularVelocity): Not implemented!"); }
00164   inline fmatvec::Mat FiniteElement1s21CosseratRotation::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { return computeJXqG(qG,data.getLagrangeParameterPosition()(0)); }
00165   inline double FiniteElement1s21CosseratRotation::getl0() const { return l0; }
00166   inline fmatvec::Mat FiniteElement1s21CosseratRotation::computeJXqG(const fmatvec::Vec& qG,double x) { throw MBSim::MBSimError("(FiniteElement1s21CosseratRotation::computeJXqG): Not implemented!"); }
00167 
00168 }
00169 
00170 #endif /* _FINITE_ELEMENT_1S_21_COSSERAT_ROTATION_H_ */