mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

1s.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 _FLEXIBLE_BODY_1S_H_
21 #define _FLEXIBLE_BODY_1S_H_
22
23 #include "mbsimFlexibleBody/flexible_body.h"
24 #include "mbsimFlexibleBody/frames/frame_1s.h"
25 #include <openmbvcppinterface/spineextrusion.h>
26
27 namespace MBSimFlexibleBody {
28
33 class FlexibleBody1s : public FlexibleBodyContinuum<double> {
34 public:
39 FlexibleBody1s(const std::string &name, bool openStructure);
40
41 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
42 void plot() override;
43
44 void setLength(double L_) { L = L_; }
45 double getLength() const { return L; }
46
47 bool getOpenStructure() const { return openStructure; }
48
49 void addFrame(Frame1s *frame);
50 using FlexibleBodyContinuum<double>::addFrame;
51
52 virtual void updatePositions(Frame1s* frame);
53 virtual void updateVelocities(Frame1s* frame);
54 virtual void updateAccelerations(Frame1s* frame);
55 virtual void updateJacobians(Frame1s* frame, int j=0);
56 virtual void updateGyroscopicAccelerations(Frame1s* frame);
57
58 virtual fmatvec::Vec3 getPosition(double s);
59 virtual fmatvec::SqrMat3 getOrientation(double s);
60 virtual fmatvec::Vec3 getAngles(double s) { return fmatvec::Vec3(); }
61
62 void setOpenMBVSpineExtrusion(const std::shared_ptr<OpenMBV::SpineExtrusion> &body) { openMBVBody=body; }
63
64 protected:
68 double L;
69
73 bool openStructure;
74
75 Frame1s P;
76 };
77
78 }
79
80 #endif
MBSimFlexibleBody::FlexibleBody1s
tbd
Definition: 1s.h:33
MBSimFlexibleBody::Frame1s
Definition: frame_1s.h:27
MBSimFlexibleBody::FlexibleBody1s::FlexibleBody1s
FlexibleBody1s(const std::string &name, bool openStructure)
constructor:
Definition: 1s.cc:32
MBSimFlexibleBody::FlexibleBody1s::openStructure
bool openStructure
flag for open (cantilever beam) or closed (rings) structures
Definition: 1s.h:73
MBSimFlexibleBody::FlexibleBodyContinuum
flexible body entirely described within MBSim holding all informations about continuum approximations
Definition: flexible_body.h:227
MBSim::Element::InitStage
InitStage
MBSim::Element::name
std::string name
MBSim::Body::frame
std::vector< Frame * > frame
MBSimFlexibleBody::FlexibleBody1s::L
double L
length of beam
Definition: 1s.h:68