|
mbsimflexiblebody
4.0.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 _FLEXIBLE_BODY_1S_33_RCM_H_ 00021 #define _FLEXIBLE_BODY_1S_33_RCM_H_ 00022 00023 #include "mbsimFlexibleBody/flexible_body.h" 00024 #include "mbsimFlexibleBody/pointer.h" 00025 #include "mbsimFlexibleBody/contours/flexible_band.h" 00026 #include "mbsimFlexibleBody/contours/cylinder_flexible.h" 00027 #include "mbsimFlexibleBody/flexible_body/finite_elements/finite_element_1s_33_rcm.h" 00028 #ifdef HAVE_OPENMBVCPPINTERFACE 00029 #include <openmbvcppinterface/spineextrusion.h> 00030 #endif 00031 00032 00033 namespace MBSimFlexibleBody { 00034 00047 class FlexibleBody1s33RCM : public FlexibleBodyContinuum<double> { 00048 public: 00054 FlexibleBody1s33RCM(const std::string &name="",bool openStructure=false); 00055 00059 virtual ~FlexibleBody1s33RCM() {} 00060 00061 /* INHERITED INTERFACE OF FLEXIBLE BODY */ 00062 virtual void BuildElements(); 00063 virtual void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec); 00064 virtual void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat); 00065 virtual void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat); 00066 virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::Frame::Frame::Feature ff, MBSim::Frame *frame=0); 00067 virtual void updateJacobiansForFrame(MBSim::ContourPointData &data, MBSim::Frame *frame=0); 00068 virtual void exportPositionVelocity(const std::string & filenamePos, const std::string & filenameVel = std::string( ), const int & deg = 3, const bool & writePsFile = false); 00069 virtual void importPositionVelocity(const std::string & filenamePos, const std::string & filenameVel = std::string( )); 00070 /***************************************************/ 00071 00072 /* INHERITED INTERFACE OF OBJECT */ 00073 virtual void init(InitStage stage); 00074 /***************************************************/ 00075 00076 /* INHERITED INTERFACE OF ELEMENT */ 00077 virtual void plot(double t, double dt=1); 00078 virtual std::string getType() const { return "FlexibleBody1s33RCM"; } 00079 void initializeUsingXML(xercesc::DOMElement * element); 00080 /***************************************************/ 00081 00082 /* GETTER / SETTER */ 00083 void setNumberElements(int n); 00084 int getNumberElements(){return Elements;} 00085 void setLength(double L_); 00086 double getLength(){return L;} 00087 void setEGModuls(double E_,double G_); 00088 void setDensity(double rho_); 00089 void setCrossSectionalArea(double A_); 00090 void setMomentsInertia(double I1_,double I2_,double I0_); 00091 void setCylinder(double cylinderRadius_); 00092 void setMaterialDamping(double epstD_,double k0D_); 00093 00094 void setGauss(int nGauss); 00095 void setCuboid(double cuboidBreadth_,double cuboidHeight_); 00096 void setCurlRadius(double R1_,double R2_); 00097 void setLehrDamping(double epstL_,double k0L_); 00098 #ifdef HAVE_OPENMBVCPPINTERFACE 00099 void setOpenMBVSpineExtrusion(OpenMBV::SpineExtrusion* body) { openMBVBody=body; } 00100 #endif 00101 /***************************************************/ 00102 00107 fmatvec::Vec computeState(double x); 00108 00112 void initInfo(); 00113 00114 private: 00118 CylinderFlexible *cylinder; 00119 FlexibleBand *top, *bottom, *left, *right; 00120 Contour1sFlexible *neutralFibre; 00121 00125 RevCardanPtr angle; 00126 00130 int Elements; 00131 00135 double L, l0; 00136 00140 double E, G; 00141 00145 double A; 00146 00150 double I1, I2, I0; 00151 00155 double rho; 00156 00160 double R1, R2; 00161 00165 double epstD, k0D, epstL, k0L; 00166 00170 bool openStructure; 00171 00175 bool initialised; 00176 00180 int nGauss; 00181 00185 double cylinderRadius, cuboidBreadth, cuboidHeight; 00186 00193 void BuildElement(const double& sGlobal, double& sLocal, int& currentElement); 00194 }; 00195 00196 inline void FlexibleBody1s33RCM::setGauss(int nGauss_) { nGauss = nGauss_; } 00197 inline void FlexibleBody1s33RCM::setCylinder(double cylinderRadius_) { cylinderRadius = cylinderRadius_; } 00198 inline void FlexibleBody1s33RCM::setCuboid(double cuboidBreadth_,double cuboidHeight_) { cuboidBreadth = cuboidBreadth_; cuboidHeight = cuboidHeight_; } 00199 inline void FlexibleBody1s33RCM::setLength(double L_) { L = L_; } 00200 inline void FlexibleBody1s33RCM::setEGModuls(double E_,double G_) { E = E_; G = G_; } 00201 inline void FlexibleBody1s33RCM::setCrossSectionalArea(double A_) { A = A_; } 00202 inline void FlexibleBody1s33RCM::setMomentsInertia(double I1_,double I2_,double I0_) { I1 = I1_; I2 = I2_; I0 = I0_; } 00203 inline void FlexibleBody1s33RCM::setDensity(double rho_) { rho = rho_;} 00204 inline void FlexibleBody1s33RCM::setCurlRadius(double R1_,double R2_) { R1 = R1_; R2 = R2_; if(initialised) for(int i=0;i<Elements;i++) static_cast<FiniteElement1s33RCM*>(discretization[i])->setCurlRadius(R1,R2); } 00205 inline void FlexibleBody1s33RCM::setMaterialDamping(double epstD_,double k0D_) {epstD = epstD_; k0D = k0D_; if(initialised) for(int i=0;i<Elements;i++) static_cast<FiniteElement1s33RCM*>(discretization[i])->setMaterialDamping(Elements*epstD,Elements*k0D); } 00206 inline void FlexibleBody1s33RCM::setLehrDamping(double epstL_,double k0L_) { epstL = epstL_; k0L = k0L_; if(initialised) for(int i=0;i<Elements;i++) static_cast<FiniteElement1s33RCM*>(discretization[i])->setLehrDamping(Elements*epstL,Elements*k0L); } 00207 00208 } 00209 00210 #endif /* _FLEXIBLE_BODY_1S_33_RCM_H_ */ 00211
1.8.0