mbsimflexiblebody  3.2.0
flexible_body_2s_13.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  */
00019 
00020 #ifndef FLEXIBLEBODY2S13_H_
00021 #define FLEXIBLEBODY2S13_H_
00022 
00023 #include "mbsimFlexibleBody/flexible_body.h"
00024 
00025 namespace MBSimFlexibleBody {
00026 
00027   class NurbsDisk2s;
00028 
00032   enum LockType { innerring,outerring };
00033 
00040   fmatvec::Mat condenseMatrixRows(fmatvec::Mat A, fmatvec::Index I);
00041 
00048   fmatvec::Mat condenseMatrixCols(fmatvec::Mat A, fmatvec::Index I);
00049 
00056   fmatvec::SymMat condenseMatrix(fmatvec::SymMat A,fmatvec::Index I);
00057 
00062   void MapleOutput(fmatvec::Mat A, std::string MatName, std::string file);
00063 
00068   void MapleOutput(fmatvec::SymMat C, std::string MatName, std::string file);
00069 
00080   class FlexibleBody2s13 : public FlexibleBodyContinuum<fmatvec::Vec> {
00081     public:
00086       FlexibleBody2s13(const std::string &name, const int & DEBUGLEVEL_=0);
00087 
00091       virtual ~FlexibleBody2s13() {}
00092 
00093       /* INHERITED INTERFACE OF OBJECTINTERFACE */
00094       virtual void updateh(double t, int j=0);
00095       virtual void updatedhdz(double t);
00096       virtual void updateStateDependentVariables(double t);
00097       /******************************************/
00098 
00099       /* INHERITED INTERFACE OF OBJECT */
00100       virtual void facLLM() {};
00101 
00102       /* INHERITED INTERFACE OF ELEMENT */
00103       virtual void plot(double t, double dt=1);
00104       virtual std::string getType() const { return "FlexibleBody2s13"; }
00105       /***************************************************/
00106 
00107       /* GETTER/SETTER */
00108       void setRadius(double Ri_,double Ra_) { Ri = Ri_; Ra = Ra_; }
00109       void setEModul(double E_) { E = E_; }
00110       void setPoissonRatio(double nu_) { nu = nu_; }
00111       void setThickness(const fmatvec::Vec &d_) { d = d_; }
00112       fmatvec::Vec getThickness() const { return d; }
00113       void setDensity(double rho_) { rho = rho_; }
00114       int getReferenceDegreesOfFreedom() const { return RefDofs; }
00115       int getRadialNumberOfElements() const { return nr; }
00116       int getAzimuthalNumberOfElements() const { return nj; }
00117       double getInnerRadius() const { return Ri; }
00118       double getOuterRadius() const { return Ra; }
00119       double getAzimuthalDegree() const { return degU; }
00120       double getRadialDegree() const { return degV; }
00121       fmatvec::SqrMat getA() const { return A; }
00122       fmatvec::SqrMat getG() const { return G; }
00123       void setReferenceInertia(double m0_, fmatvec::SymMat J0_) { m0 = m0_; J0 = J0_; }
00124       void setLockType(LockType LT_) { LType = LT_; }
00125       /***************************************************/
00126 
00132       void setNumberElements(int nr_,int nj_);
00133 
00137       double computePotentialEnergy() { return 0.5*q.T()*K*q; }
00138 
00144       virtual fmatvec::Vec transformCW(const fmatvec::Vec& WrPoint) = 0;
00145 
00146     protected:
00150       int Elements;
00151 
00155       int NodeDofs;
00156 
00160       int RefDofs;
00161 
00165       double E;
00166 
00170       double nu;
00171 
00175       double rho;
00176 
00182       fmatvec::Vec d;
00183 
00187       double Ri, Ra;
00188 
00192       double dr, dj;
00193 
00197       double m0;
00198 
00202       fmatvec::SymMat J0;
00203 
00209       int degV, degU;
00210 
00214       int drawDegree;
00215 
00219       std::vector<fmatvec::Vec> ElementalNodes;
00220 
00224       int currentElement;
00225 
00229       fmatvec::SymMat MConst;
00230 
00234       fmatvec::SymMat K;
00235 
00239       int nr, nj, Nodes;
00240 
00247       fmatvec::Mat NodeCoordinates;
00248 
00254       fmatvec::Matrix<fmatvec::General,fmatvec::Ref,fmatvec::Ref,int> ElementNodeList;
00255 
00259       int Dofs;
00260 
00266       LockType LType;
00267 
00271       fmatvec::Index ILocked;
00272 
00276       fmatvec::Vec qext, uext;
00277 
00281       fmatvec::SqrMat A;
00282 
00286       fmatvec::SqrMat G;
00287 
00288       /*
00289        * \brief Jacobian for condensation with size Dofs x qSize
00290        */
00291       fmatvec::Mat Jext;
00292 
00296       NurbsDisk2s *contour;
00297 
00298       /*
00299        * \brief Debug-Output-Level
00300        *
00301        * 0 = no Debug output
00302        * 1 = console Debug Output
00303        * 2 = File Debug Output
00304        */
00305       int DEBUGLEVEL;
00306 
00311       void BuildElement(const fmatvec::Vec &s);
00312 
00316       virtual void initMatrices() = 0;
00317 
00321       virtual void updateAG() = 0;
00322 
00327       double computeThickness(const double &r_);
00328   };
00329 
00330 }
00331 
00332 #endif /* FLEXIBLEBODY2S13_H_ */
00333