mbsimflexiblebody  3.0.0
finite_element_2s_13_disk.h
1 /* Copyright (C) 2004-2011 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: thorsten.schindler@mytum.de
18  */
19 
20 #ifndef _FINITE_ELEMENT_2S_13_DISK_H_
21 #define _FINITE_ELEMENT_2S_13_DISK_H_
22 
23 #include<cmath>
24 #include "mbsim/discretization_interface.h"
25 #include "mbsim/mbsim_event.h"
26 
27 namespace MBSimFlexibleBody {
28 
39  class FiniteElement2s13Disk : public MBSim::DiscretizationInterface {
40  public:
47  FiniteElement2s13Disk(double E_,double nu_,double rho_);
48 
52  virtual ~FiniteElement2s13Disk() {}
53 
54  /* INTERFACE OF DISCRETIZATIONINTERFACE */
55  virtual const fmatvec::SymMat& getM() const;
56  virtual const fmatvec::Vec& geth() const;
57  virtual const fmatvec::SqrMat& getdhdq() const;
58  virtual const fmatvec::SqrMat& getdhdu() const;
59  virtual int getqSize() const;
60  virtual int getuSize() const;
61  virtual void computeM(const fmatvec::Vec& q);
62  virtual void computeh(const fmatvec::Vec& q,const fmatvec::Vec& u);
63  virtual void computedhdz(const fmatvec::Vec& q,const fmatvec::Vec& u);
64  virtual double computeKineticEnergy(const fmatvec::Vec& q,const fmatvec::Vec& u);
65  virtual double computeGravitationalEnergy(const fmatvec::Vec& q);
66  virtual double computeElasticEnergy(const fmatvec::Vec& q);
67  virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
68  virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data);
69  virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
70  virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data);
71  virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& q,const MBSim::ContourPointData &data);
72  /***************************************************/
73 
74  /* GETTER / SETTER */
75  const fmatvec::SymMat& getK() const;
76  void setEModul(double E_);
77  void setPoissonRatio(double nu_);
78  void setDensity(double rho_);
79  void setShearCorrectionFactor(double alp_);
80  /***************************************************/
81 
88  void computeConstantSystemMatrices(const fmatvec::Vec &NodeCoordinates,double d1,double d2);
89 
99  fmatvec::Vec computeState(const fmatvec::Vec &NodeCoordinates,const fmatvec::Vec &qElement,const fmatvec::Vec &qpElement,const fmatvec::Vec &s,double d1,double d2);
100 
106  fmatvec::Mat JGeneralized(const fmatvec::Vec &NodeCoordinates,const fmatvec::Vec &s);
107 
108  private:
112  double E;
113 
117  double nu;
118 
122  double G;
123 
127  double rho;
128 
132  double alphaS;
133 
137  int RefDofs;
138 
142  int NodeDofs;
143 
147  int Nodes;
148 
152  fmatvec::SymMat M, K;
153  };
154 
155  inline const fmatvec::SymMat& FiniteElement2s13Disk::getM() const { return M; }
156  inline const fmatvec::Vec& FiniteElement2s13Disk::geth() const { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::geth): Not implemented!"); }
157  inline const fmatvec::SqrMat& FiniteElement2s13Disk::getdhdq() const { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::getdhdq): Not implemented!"); }
158  inline const fmatvec::SqrMat& FiniteElement2s13Disk::getdhdu() const { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::getdhdu): Not implemented!"); }
159  inline int FiniteElement2s13Disk::getqSize() const { return RefDofs + 4*NodeDofs; }
160  inline int FiniteElement2s13Disk::getuSize() const { return RefDofs + 4*NodeDofs; }
161  inline void FiniteElement2s13Disk::computeM(const fmatvec::Vec& q) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeM): Not implemented!"); }
162  inline void FiniteElement2s13Disk::computeh(const fmatvec::Vec& q,const fmatvec::Vec& u) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeh): Not implemented!"); }
163  inline void FiniteElement2s13Disk::computedhdz(const fmatvec::Vec& q,const fmatvec::Vec& u) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computedhdz): Not implemented!"); }
164  inline double FiniteElement2s13Disk::computeKineticEnergy(const fmatvec::Vec& q,const fmatvec::Vec& u) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeKineticEnergy): Not implemented!"); }
165  inline double FiniteElement2s13Disk::computeGravitationalEnergy(const fmatvec::Vec& q) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeGravitationalEnergy): Not implemented!"); }
166  inline double FiniteElement2s13Disk::computeElasticEnergy(const fmatvec::Vec& q) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeElasticEnergy): Not implemented!"); }
167  inline fmatvec::Vec FiniteElement2s13Disk::computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computePosition): Not implemented!"); }
168  inline fmatvec::SqrMat FiniteElement2s13Disk::computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeOrientation): Not implemented!"); }
169  inline fmatvec::Vec FiniteElement2s13Disk::computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeVelocity): Not implemented!"); }
170  inline fmatvec::Vec FiniteElement2s13Disk::computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeAngularVelocity): Not implemented!"); }
171  inline fmatvec::Mat FiniteElement2s13Disk::computeJacobianOfMotion(const fmatvec::Vec& qG,const MBSim::ContourPointData& data) { throw MBSim::MBSimError("ERROR(FiniteElement2s13Disk::computeJacobianOfMotion): Not implemented!"); }
172 
173  inline const fmatvec::SymMat& FiniteElement2s13Disk::getK() const { return K; }
174  inline void FiniteElement2s13Disk::setEModul(double E_) { E = E_; }
175  inline void FiniteElement2s13Disk::setPoissonRatio(double nu_) { nu = nu_; }
176  inline void FiniteElement2s13Disk::setDensity(double rho_) { rho = rho_; }
177  inline void FiniteElement2s13Disk::setShearCorrectionFactor(double alphaS_) { alphaS = alphaS_; }
178 }
179 
180 #endif /* _FINITE_ELEMENT_2S_13_RCM_H_ */
181