mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
nurbs_curve_1s.h
1 /* Copyright (C) 2004-2012 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 NurbsCurve1s_H_
21 #define NurbsCurve1s_H_
22 
23 #include "mbsimFlexibleBody/contours/contour1s.h"
24 #include "mbsim/numerics/nurbs/nurbs_curve.h"
25 
26 namespace MBSimFlexibleBody {
27 
37  class NurbsCurve1s : public Contour1s {
38  public:
43  NurbsCurve1s(const std::string &name) : Contour1s(name), Elements(0), openStructure(false), L(0.), degU(0), curveTranslations(), curveVelocities(), curveAngularVelocities(), normalRotationGrid() { }
44 
48  ~NurbsCurve1s() override = default;
49 
50  /* INHERITED INTERFACE OF ELEMENT */
51  /***************************************************/
52 
53  /* INHERITED INTERFACE OF CONTOURCONTINUUM */
54  virtual void computeRootFunctionPosition(MBSim::ContourFrame *frame);
55  virtual void computeRootFunctionFirstTangent(MBSim::ContourFrame *frame);
56  virtual void computeRootFunctionNormal(MBSim::ContourFrame *frame);
57  virtual void computeRootFunctionSecondTangent(MBSim::ContourFrame *frame);
58  /***************************************************/
59 
60  /* INHERITED INTERFACE OF CONTOUR */
61  MBSim::ContactKinematics *findContactPairingWith(const std::type_info &type0, const std::type_info &type1) override;
62  /***************************************************/
63 
64  /* GETTER / SETTER */
65  void setNormalRotationGrid(const fmatvec::Vec& normal_) { normalRotationGrid = normal_(fmatvec::RangeV(0,2)); }
66  /***************************************************/
67 
72  void initContourFromBody(InitStage stage);
73 
77  void computeCurveTranslations(bool update = false);
78 
82  void computeCurveVelocities(bool update = false);
83 
87  void computeCurveAngularVelocities(bool update = false);
88 
94  void computeCurveJacobians(bool trans = true, bool rot = true, bool update = false);
95 
96  protected:
100  int Elements;
101 
105  int qSize;
106 
111 
115  double L;
116 
120  int degU;
121 
126 
131 
136 
140  fmatvec::Vec3 normalRotationGrid;
141 
145  std::vector<MBSim::NurbsCurve> CurveJacobiansOfTranslation; // size = number of generalized coordinates
146 
150  std::vector<MBSim::NurbsCurve> CurveJacobiansOfRotation; // size = number of generalized coordinates
151 
152  };
153 
154 }
155 
156 #endif /* NurbsCurve1s_H_ */
MBSim::NurbsCurve curveAngularVelocities
interpolated angular velocities of the contour
Definition: nurbs_curve_1s.h:135
void initContourFromBody(InitStage stage)
initialize NURBS curve
Definition: nurbs_curve_1s.cc:31
void computeCurveTranslations(bool update=false)
interpolates the translations with node-data from body
Definition: nurbs_curve_1s.cc:63
MBSim::NurbsCurve curveTranslations
interpolated translations of the contour
Definition: nurbs_curve_1s.h:125
basic class for contours described by one contour parameter
Definition: contour1s.h:35
int Elements
number of elements
Definition: nurbs_curve_1s.h:100
double L
length of entire curve
Definition: nurbs_curve_1s.h:115
fmatvec::Vec3 normalRotationGrid
closest normal on rotation grid to update direction of normal of nurbs-curve and to avoid jumping ...
Definition: nurbs_curve_1s.h:140
void computeCurveJacobians(bool trans=true, bool rot=true, bool update=false)
interpolates the Jacobians of translation with the node-data from the body
Definition: nurbs_curve_1s.cc:133
contour 1s flexible with NURBS parametrization
Definition: nurbs_curve_1s.h:37
int qSize
number of DOFs
Definition: nurbs_curve_1s.h:105
int degU
interpolation degree
Definition: nurbs_curve_1s.h:120
NurbsCurve1s(const std::string &name)
constructor
Definition: nurbs_curve_1s.h:43
bool openStructure
open or closed beam structure
Definition: nurbs_curve_1s.h:110
void computeCurveVelocities(bool update=false)
interpolates the velocities with the node-data from the body
Definition: nurbs_curve_1s.cc:87
std::vector< MBSim::NurbsCurve > CurveJacobiansOfTranslation
interpolated Jacobians of Translation of the contour
Definition: nurbs_curve_1s.h:145
void computeCurveAngularVelocities(bool update=false)
interpolates the angular velocities with the node-data from the body
Definition: nurbs_curve_1s.cc:110
std::vector< MBSim::NurbsCurve > CurveJacobiansOfRotation
interpolated Jacobians of Rotation on the contour
Definition: nurbs_curve_1s.h:150
MBSim::NurbsCurve curveVelocities
interpolated velocities of the contour
Definition: nurbs_curve_1s.h:130
~NurbsCurve1s() override=default
destructor