mbsimflexiblebody  3.2.0
finite_element_1s_21_cosserat_translation.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: thorsten.schindler@mytum.de
00018  */
00019 
00020 #ifndef _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_H_
00021 #define _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_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 FiniteElement1s21CosseratTranslation : public MBSim::DiscretizationInterface {
00050     public:
00051 
00062       FiniteElement1s21CosseratTranslation(double l0_,double rho_,double A_,double E_,double G_,double I1_,const fmatvec::Vec& g_);
00063 
00067       virtual ~FiniteElement1s21CosseratTranslation();          
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 setMaterialDamping(double cEps0D_,double cEps1D_);
00092       void setShearCorrectionFactors(double sigma1_);
00093       double getl0() const;
00094 
00101       const fmatvec::Vec& computeStateTranslation(const fmatvec::Vec& qG, const fmatvec::Vec& qGt, double s);
00102 
00108       fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x);
00109 
00113       void initM();
00114 
00115     private:
00119       double l0;
00120 
00124       double rho;
00125 
00129       double A;
00130 
00134       double E;
00135 
00139       double G;
00140 
00144       double I1;
00145 
00149       fmatvec::Vec g;
00150 
00154       double cEps0D, cEps1D;
00155 
00159       double sigma1;
00160 
00164       fmatvec::SymMat M;
00165       fmatvec::Vec h;
00166 
00170       fmatvec::SqrMat dhdq, dhdu;
00171 
00175       fmatvec::Vec X;
00176 
00180       CardanPtr ag;
00181 
00182       FiniteElement1s21CosseratTranslation(); // standard constructor
00183       FiniteElement1s21CosseratTranslation(const FiniteElement1s21CosseratTranslation&); // copy constructor
00184       FiniteElement1s21CosseratTranslation& operator=(const FiniteElement1s21CosseratTranslation&); // assignment operator
00185   };
00186 
00187   inline const fmatvec::SymMat& FiniteElement1s21CosseratTranslation::getM() const { return M; }
00188   inline const fmatvec::Vec& FiniteElement1s21CosseratTranslation::geth() const { return h; }
00189   inline const fmatvec::SqrMat& FiniteElement1s21CosseratTranslation::getdhdq() const { return dhdq; }
00190   inline const fmatvec::SqrMat& FiniteElement1s21CosseratTranslation::getdhdu() const { return dhdu; }
00191   inline int FiniteElement1s21CosseratTranslation::getqSize() const { return 5; }
00192   inline int FiniteElement1s21CosseratTranslation::getuSize() const { return 5; }
00193   inline void  FiniteElement1s21CosseratTranslation::computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt) { throw MBSim::MBSimError("Error(FiniteElement1s21CosseratTranslation::computedhdz): Not implemented"); }
00194   inline fmatvec::Vec FiniteElement1s21CosseratTranslation::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s21CosseratTranslation::computePosition): Not implemented!"); }
00195   inline fmatvec::SqrMat FiniteElement1s21CosseratTranslation::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s21CosseratTranslation::computeOrientation): Not implemented!"); }
00196   inline fmatvec::Vec FiniteElement1s21CosseratTranslation::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s21CosseratTranslation::computeVelocity): Not implemented!"); }
00197   inline fmatvec::Vec FiniteElement1s21CosseratTranslation::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s21CosseratTranslation::computeAngularVelocity): Not implemented!"); }
00198   inline fmatvec::Mat FiniteElement1s21CosseratTranslation::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { return computeJXqG(qG,data.getLagrangeParameterPosition()(0)); }
00199   inline void FiniteElement1s21CosseratTranslation::setShearCorrectionFactors(double sigma1_) { sigma1 = sigma1_; }
00200   inline double FiniteElement1s21CosseratTranslation::getl0() const { return l0; }
00201   inline fmatvec::Mat FiniteElement1s21CosseratTranslation::computeJXqG(const fmatvec::Vec& qG,double x) { throw MBSim::MBSimError("ERROR (FiniteElement1s21CosseratTranslation::computeJXqG): Not implemented!"); }
00202 
00203 }
00204 
00205 #endif /* _FINITE_ELEMENT_1S_21_COSSERAT_TRANSLATION_H_ */