mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
flexible_ffr_beam.h
1 /* Copyright (C) 2004-2020 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_BEAM_H_
21 #define _FLEXIBLE_BEAM_H_
22 
23 #include "mbsimFlexibleBody/flexible_body/generic_flexible_ffr_body.h"
24 #include "mbsim/utils/boost_parameters.h"
25 
26 namespace MBSim {
27 
28  BOOST_PARAMETER_NAME(visualization)
29 }
30 
31 namespace MBSimFlexibleBody {
32 
38 
39  public:
40  FlexibleFfrBeam(const std::string &name="") : GenericFlexibleFfrBody(name) { }
41  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
42  void initializeUsingXML(xercesc::DOMElement *element) override;
43  void setNumberOfNodes(int nN_) { nN = nN_; }
44  void setLength(double l_) { l = l_; }
45  void setCrossSectionArea(double A_) { A = A_; }
46  void setMomentOfInertia(const fmatvec::Vec3 &I) { Iy=I(0); Iz=I(1); Iyz=I(2); }
47  void setYoungsModulus(double E_) { E = E_; }
48  void setDensity(double rho_) { rho = rho_; }
49  void setBoundaryConditions(const fmatvec::MatVx3 &bc_) { bc <<= bc_; }
50  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, MBSim::tag, (optional (visualization,(OpenMBVFlexibleFfrBeam::Visualization),OpenMBVFlexibleFfrBeam::points)(colorRepresentation,(OpenMBVFlexibleBody::ColorRepresentation),OpenMBVFlexibleBody::none)(minimalColorValue,(double),0)(maximalColorValue,(double),1)(diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0)(pointSize,(double),0)(lineWidth,(double),0))) {
51  ombvBody = std::shared_ptr<OpenMBVFlexibleFfrBeam>(new OpenMBVFlexibleFfrBeam(visualization,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
52  }
53  void setPlotNodeNumbers(const fmatvec::VecVI &plotNodes_) { plotNodes <<= plotNodes_; }
54 
55  private:
56  int nN{3};
57  double l{1};
58  double A{1e-4};
59  double Iy{1e-10};
60  double Iz{1e-10};
61  double Iyz{0};
62  double E{2e11};
63  double rho{7870};
64  fmatvec::MatVx3 bc;
66  };
67 
68 }
69 
70 #endif
std::string name
Definition: openmbv_utils.h:65
Generic flexible body using a floating frame of reference formulation.
Definition: generic_flexible_ffr_body.h:62
Flexible beam using a floating frame of reference formulation.
Definition: flexible_ffr_beam.h:37