|
mbsimflexiblebody
3.2.0
|
00001 /* Copyright (C) 2004-2011 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_33_RCM_H_ 00021 #define _FINITE_ELEMENT_1S_33_RCM_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 "mbsimFlexibleBody/flexible_body/finite_elements/finite_element_1s_33_rcm/weight33RCM.h" 00028 #include "fmatvec/fmatvec.h" 00029 00030 namespace MBSimFlexibleBody { 00031 00041 class FiniteElement1s33RCM : public MBSim::DiscretizationInterface { 00042 public: 00056 FiniteElement1s33RCM(double l0_,double rho_,double A_,double E_,double G_,double I1_,double I2_,double I0_,const fmatvec::Vec& g_,RevCardanPtr ag_); 00057 00061 virtual ~FiniteElement1s33RCM() {} 00062 00063 /* INHERITED INTERFACE OF DISCRETIZATIONINTERFACE */ 00064 virtual const fmatvec::SymMat& getM() const; 00065 virtual const fmatvec::Vec& geth() const; 00066 virtual const fmatvec::SqrMat& getdhdq() const; 00067 virtual const fmatvec::SqrMat& getdhdu() const; 00068 virtual int getqSize() const; 00069 virtual int getuSize() const; 00070 00071 virtual void computeM(const fmatvec::Vec& qG); 00072 virtual void computeh(const fmatvec::Vec& qG,const fmatvec::Vec& qGt); 00073 virtual void computedhdz(const fmatvec::Vec& qG, const fmatvec::Vec& qGt); 00074 virtual double computeKineticEnergy(const fmatvec::Vec& qG,const fmatvec::Vec& qGt); 00075 virtual double computeGravitationalEnergy(const fmatvec::Vec& qG); 00076 virtual double computeElasticEnergy(const fmatvec::Vec& qG); 00077 00078 virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data); 00079 virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data); 00080 virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data); 00081 virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data); 00082 virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data); 00083 /*****************************************************/ 00084 00085 /* GETTER / SETTER */ 00086 void setGauss(int nGauss); 00087 void setCurlRadius(double R1,double R2); 00088 void setMaterialDamping(double epstD_,double k0D_); 00089 void setLehrDamping(double epstL,double k0L); 00090 double getl0() const; 00091 /*****************************************************/ 00092 00099 const fmatvec::Vec& computeState(const fmatvec::Vec& qG,const fmatvec::Vec& qGt,double x); 00100 00106 fmatvec::Mat computeJXqG(const fmatvec::Vec& qG,double x); 00107 00113 fmatvec::Vec computeData(const fmatvec::Vec& qG,const fmatvec::Vec& qGt); 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, I2, I0; 00145 00149 fmatvec::Vec g; 00150 00154 double k10, k20; 00155 00159 double epstD, k0D; 00160 00164 fmatvec::SymMat M; 00165 fmatvec::Vec h; 00166 00170 fmatvec::SqrMat dhdq, dhdu; 00171 00175 fmatvec::SymMat MI; 00176 00180 fmatvec::SqrMat Damp; 00181 00185 double l0h2, l0h3; 00186 00190 double x_Old; 00191 00195 fmatvec::Vec X; 00196 00200 fmatvec::Vec qG_Old, qGt_Old; 00201 00205 double tol_comp; 00206 00210 fmatvec::Mat drS, drSH; 00211 fmatvec::RowVec depstil, dk0; 00212 00216 RevCardanPtr ag; 00217 00221 Trafo33RCMPtr tf; 00222 00226 Weight33RCMPtr wt; 00227 00231 void computedrS(); 00232 00236 void computedepstil(); 00237 00241 void computedk0(); 00242 }; 00243 00244 inline void FiniteElement1s33RCM::setGauss(int nGauss) { wt->setGauss(nGauss); } 00245 inline double FiniteElement1s33RCM::getl0() const { return l0; } 00246 inline const fmatvec::SymMat& FiniteElement1s33RCM::getM() const { return M; } 00247 inline const fmatvec::Vec& FiniteElement1s33RCM::geth() const { return h; } 00248 inline const fmatvec::SqrMat& FiniteElement1s33RCM::getdhdq() const { return dhdq; } 00249 inline const fmatvec::SqrMat& FiniteElement1s33RCM::getdhdu() const { return dhdu; } 00250 inline int FiniteElement1s33RCM::getqSize() const { return 16; } 00251 inline int FiniteElement1s33RCM::getuSize() const { return 16; } 00252 inline fmatvec::Vec FiniteElement1s33RCM::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33RCM::computePosition): Not implemented!"); } 00253 inline fmatvec::SqrMat FiniteElement1s33RCM::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33RCM::computeOrientation): Not implemented!"); } 00254 inline fmatvec::Vec FiniteElement1s33RCM::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33RCM::computeVelocity): Not implemented!"); } 00255 inline fmatvec::Vec FiniteElement1s33RCM::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR (FiniteElement1s33RCM::computeAngularVelocity): Not implemented!"); } 00256 inline fmatvec::Mat FiniteElement1s33RCM::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { return computeJXqG(qG,data.getLagrangeParameterPosition()(0)); } 00257 00258 } 00259 00260 #endif /* _FINITE_ELEMENT_1S_33_RCM_H_ */ 00261
1.8.0