mbsimflexiblebody  4.0.0
flexible_body_1s_01_torsion.h
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  *          rzander@users.berlios.de
00019  */
00020 
00021 #ifndef BODY_FLEXIBLE_1S_01_TORSION_H_
00022 #define BODY_FLEXIBLE_1S_01_TORSION_H_
00023 
00024 #include "body_flexible.h"
00025 
00026 namespace MBSim {
00027 
00028 //  class Contour1sFlexible;
00029 
00035   class BodyFlexible1s01Torsion : public BodyFlexible1s {
00036     protected:
00037       int n;
00038       double E, rho, A, I , l;
00039       //    Vec JGeneralized(const double &s); // nur zur Kompatibilitaet
00040 
00041       Vec sTangent;
00042       Mat Wt;
00043       Vec Wn, CrOC, CvC;
00044 
00045       // KOS-Definition und Lage des ersten Knoten im Weltsystem
00046       //    Mat Jges;
00047       Vec Axis; /* Enspricht der neutralen Faser */
00048       Vec WrON00,WrON0;
00049 
00050       void init(InitStage stage);
00051       void initMatrizes();
00052 
00053       void updateStateDependentVariables(double t);
00054       void updatePorts(double t);
00055       //void sumUpForceElements(double t);
00056       //void updateW(double t);
00057 
00058       void updateh(double t);
00059 
00060 
00061     public:
00062 
00063       BodyFlexible1s01Torsion(const string &name);
00066       void setNumberShapeFunctions(int n_); 
00069       void setCrossSectionalArea(double A_){A     = A_;}
00072       void setMomentInertia(double I_){I     = I_;}
00075       void setEModul(double E_){E     = E_;}
00078       void setDensity(double rho_){rho   = rho_;}
00081       void setLength(double l_){l   = l_;}
00084       void setInitialRotationVelocity(double omega0)  {u0(1) = omega0;}
00087       void setInitialRotation(double omega0)  {setInitialRotationVelocity(omega0);}
00088 
00089       /*     void addPort(const string &name, const double &S); */
00090       /*     using BodyFlexible1s::addPort; */
00091 
00092       Mat computeJacobianMatrix(const ContourPointData &S_); // virtual of body_flexible
00093 
00094       Mat computeWt  (const ContourPointData &S_){return Axis; }
00095       Vec computeWn  (const ContourPointData &S_){return Vec(3); }
00096       Vec computeWrOC(const ContourPointData &S_){return WrON00 + S_.alpha(0) * Axis;}
00097       Vec computeWvC (const ContourPointData &S_){return Vec(3); }
00098 
00099 
00102       bool hasConstMass() const {return true;}
00103 
00105       void facLLM() {}
00106 
00107       /* Jacobi Matrix der Rotation */
00108       void setJR(const Vec &JR_) {assert(JR_.cols()==1); JR = JR_; Axis = JR_;};
00109 
00110       // Lage des Ursprungs des Wellensystems im WKOS 
00111       // Per Default liegt es im Ursprung des WKOS
00112       void setWrON00(const Vec &WrON00_) {WrON00 = WrON00_;}
00113 
00115       SymMat K;
00116 
00117   };
00118 
00119 }
00120 
00121 #endif