mbsimflexiblebody  3.0.0
flexible_body_linear_external.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  * rzander@users.berlios.de
19  */
20 
21 #ifndef _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_
22 #define _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_
23 
24 #include "mbsimFlexibleBody/flexible_body.h"
25 #include "mbsim/mbsim_event.h"
26 #include <fstream>
27 
28 namespace MBSimFlexibleBody {
29 
30  class ContourInterpolation;
31 
44  public:
49  FlexibleBodyLinearExternal(const std::string &name);
50 
55 
56  /* INHERITED INTERFACE OF ELEMENT */
57  virtual std::string getType() const { return "FlexibleBodyLinearExternal"; }
58  /***************************************************/
59 
60  /* INHERITED INTERFACE OF OBJECT */
61  virtual void init(MBSim::InitStage stage) { new MBSim::MBSimError("ERROR(FlexibleBodyLinearExternal::init): Not implemented!"); }
62  virtual void facLLM() {}
63  /***************************************************/
64 
65  /* INHERITED INTERFACE OF FLEXIBLEBODY */
66  virtual void BuildElements() { new MBSim::MBSimError("ERROR(FlexibleBodyLinearExternal::BuildElements): Not implemented!"); }
67  virtual void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec);
68  virtual void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat);
69  virtual void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat);
76  virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::FrameFeature ff, MBSim::Frame *frame=0);
77  virtual void updateJacobiansForFrame(MBSim::ContourPointData &data, MBSim::Frame *frame=0);
78  /***************************************************/
79 
87  void readMassMatrix(const std::string &massfilename);
88 
93  void setMassMatrix(const fmatvec::SymMat &mat);
94 
99  void readStiffnessMatrix(const std::string &stiffnessfilename);
100 
105  void setStiffnessMatrix(const fmatvec::SqrMat &mat);
106 
113  void setProportionalDamping(const double &a, const double &b);
114 
115 // /*! plot parameters of "BodyFlexibleLinearExternal"
116 // */
117 // void plotParameters();
118 
128 // void addFrame(const std::string &name, const std::string &jacobifilename);
129 
136 // void addFrame(const std::string &name, const fmatvec::Mat &J_, const fmatvec::Vec &r_);
137 
143 // void addContour(Contour *contour, const std::string &jacobifilename);
144 
151 // void addContour(Contour *contour, const fmatvec::Mat &J_, const fmatvec::Vec &r_);
152 
154 // void addContourInterpolation(ContourInterpolation *contour);
155 
158  void setWrON00(const fmatvec::Vec &WrON00_) {WrON00 = WrON00_;}
159 
160  /* geerbt */
161  fmatvec::Mat computeJacobianMatrix(const MBSim::ContourPointData &CP);
162 
163  protected:
166 
168  std::vector<MBSim::ContourPointData> contourType;
169 
171  fmatvec::Vec WrON00;
172 
178  void updateStateDependentVariables(double t);
185  void updateContours(double t);
186 
191  MBSim::ContourPointData addInterface(const std::string &jacbifilename);
197  MBSim::ContourPointData addInterface(const fmatvec::Mat &J, const fmatvec::Vec &r);
198 
199  /* empty function since mass, damping and stiffness matrices are constant !!! */
200  void updateJh_internal(double t);
201  };
202 
203 }
204 
205 #endif /* _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_ */
206