mbsimflexiblebody  3.0.0
flexible_band.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 _FLEXIBLE_BAND_H_
21 #define _FLEXIBLE_BAND_H_
22 
23 #include "mbsimFlexibleBody/contours/contour1s_flexible.h"
24 #include "mbsim/contour.h"
25 
26 namespace MBSimFlexibleBody {
27 
35  class FlexibleBand : public Contour1sFlexible {
36  public:
41  FlexibleBand(const std::string& name);
42 
43  /* INHERITED INTERFACE OF ELEMENT */
44  virtual std::string getType() const { return "FlexibleBand"; }
45  /***************************************************/
46 
47  /* INHERITED INTERFACE OF CONTOUR */
48  virtual void updateKinematicsForFrame(MBSim::ContourPointData& cp, MBSim::FrameFeature ff);
49  virtual void updateJacobiansForFrame(MBSim::ContourPointData &cp, int j = 0);
50  virtual fmatvec::Vec computePosition(MBSim::ContourPointData &cp) { updateKinematicsForFrame(cp, MBSim::position_cosy); return cp.getFrameOfReference().getPosition(); }
51  virtual fmatvec::Vec computeVelocity(MBSim::ContourPointData &cp) { updateKinematicsForFrame(cp, MBSim::velocity_cosy); return cp.getFrameOfReference().getVelocity(); }
52  /***************************************************/
53 
54  /* INHERITED INTERFACE OF CONTOURCONTINUUM */
55  virtual void computeRootFunctionPosition(MBSim::ContourPointData &cp) { Contour1sFlexible::updateKinematicsForFrame(cp, MBSim::position); }
56  virtual void computeRootFunctionFirstTangent(MBSim::ContourPointData &cp) { Contour1sFlexible::updateKinematicsForFrame(cp, MBSim::firstTangent); }
57  /***************************************************/
58 
59  /* GETTER / SETTER */
60  void setCn(const fmatvec::Vec& Cn_);
61  void setWidth(double width_);
62 
67  void setNormalDistance(double nDist_);
68 
73  double getNormalDistance() {return nDist;};
74  double getWidth() const;
75  /***************************************************/
76 
77  private:
81  fmatvec::Vec Cn;
82 
86  double width;
87 
91  double nDist;
92  };
93 
94  inline void FlexibleBand::setWidth(double width_) { width = width_; }
95  inline void FlexibleBand::setNormalDistance(double nDist_) { nDist = nDist_; }
96  inline double FlexibleBand::getWidth() const { return width; }
97 
98 }
99 
100 #endif /* _FLEXIBLE_BAND_H_ */
101