All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
contour1s_flexible.h
1 /* Copyright (C) 2004-2015 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: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _CONTOUR1S_FLEXIBLE_H_
21 #define _CONTOUR1S_FLEXIBLE_H_
22 
23 #include "mbsimFlexibleBody/contours/contour1s.h"
24 #include "mbsimFlexibleBody/utils/contact_utils.h"
25 #include "mbsim/utils/eps.h"
26 
27 namespace MBSim {
28  class ContactKinematics;
29 }
30 
31 namespace MBSimFlexibleBody {
32 
45  class Contour1sFlexible : public Contour1s {
46  public:
51  Contour1sFlexible(const std::string & name) : Contour1s(name), sOld(-1e12) { }
52 
53  /* INHERITED INTERFACE OF ELEMENT */
54  virtual std::string getType() const { return "Contour1sFlexible"; }
55  /***************************************************/
56 
57  virtual MBSim::ContourFrame* createContourFrame(const std::string &name="P");
58 
59  virtual fmatvec::Vec3 evalPosition(const fmatvec::Vec2 &zeta) { return evalPosition(zeta(0)); }
60  virtual fmatvec::Vec3 evalWs(const fmatvec::Vec2 &zeta) { return evalWs(zeta(0)); }
61  virtual fmatvec::Vec3 evalWt(const fmatvec::Vec2 &zeta) { return evalWt(zeta(0)); }
62  virtual fmatvec::Vec3 evalWu(const fmatvec::Vec2 &zeta) { return evalWs(zeta); }
63  virtual fmatvec::Vec3 evalWv(const fmatvec::Vec2 &zeta) { return evalWt(zeta); }
64 
65  virtual bool isZetaOutside(const fmatvec::Vec2 &zeta) { return zeta(0) < etaNodes[0] or zeta(0) > etaNodes[etaNodes.size()-1]; }
66 
67  MBSim::ContactKinematics * findContactPairingWith(std::string type0, std::string type1) { return findContactPairingFlexible(type0.c_str(), type1.c_str()); }
68 
69  void setNodes(const std::vector<double> &nodes_) { etaNodes = nodes_; }
70 
71  void resetUpToDate();
72  virtual void updatePositions(double s);
73 
74  fmatvec::Vec3 evalPosition(double s) { if(fabs(s-sOld)>MBSim::macheps()) updatePositions(s); return WrOP; }
75  fmatvec::Vec3 evalWs(double s) { if(fabs(s-sOld)>MBSim::macheps()) updatePositions(s); return Ws; }
76  fmatvec::Vec3 evalWt(double s) { if(fabs(s-sOld)>MBSim::macheps()) updatePositions(s); return Wt; }
77 
78  void updatePositions(MBSim::ContourFrame *frame);
79  void updateVelocities(MBSim::ContourFrame *frame);
80  void updateAccelerations(MBSim::ContourFrame *frame);
81  void updateJacobians(MBSim::ContourFrame *frame, int j=0);
82  void updateGyroscopicAccelerations(MBSim::ContourFrame *frame);
83 
84  protected:
85  fmatvec::Vec3 WrOP, Ws, Wt;
86 
87  double sOld;
88  };
89 
90 }
91 
92 #endif /* _CONTOUR1S_FLEXIBLE_H_ */
basic class for contours described by one contour parameter
Definition: contour1s.h:35
numerical description of contours with one contour parameter
Definition: contour1s_flexible.h:45
Contour1sFlexible(const std::string &name)
constructor
Definition: contour1s_flexible.h:51

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML