mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

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
110 bool openStructure;
111
115 double L;
116
120 int degU;
121
125 MBSim::NurbsCurve curveTranslations;
126
130 MBSim::NurbsCurve curveVelocities;
131
135 MBSim::NurbsCurve curveAngularVelocities;
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_ */
MBSimFlexibleBody::NurbsCurve1s::curveAngularVelocities
MBSim::NurbsCurve curveAngularVelocities
interpolated angular velocities of the contour
Definition: nurbs_curve_1s.h:135
MBSimFlexibleBody::NurbsCurve1s::initContourFromBody
void initContourFromBody(InitStage stage)
initialize NURBS curve
Definition: nurbs_curve_1s.cc:31
MBSimFlexibleBody::NurbsCurve1s::computeCurveTranslations
void computeCurveTranslations(bool update=false)
interpolates the translations with node-data from body
Definition: nurbs_curve_1s.cc:63
MBSimFlexibleBody::NurbsCurve1s::curveTranslations
MBSim::NurbsCurve curveTranslations
interpolated translations of the contour
Definition: nurbs_curve_1s.h:125
MBSimFlexibleBody::Contour1s
basic class for contours described by one contour parameter
Definition: contour1s.h:35
MBSimFlexibleBody::NurbsCurve1s::Elements
int Elements
number of elements
Definition: nurbs_curve_1s.h:100
MBSimFlexibleBody::NurbsCurve1s::L
double L
length of entire curve
Definition: nurbs_curve_1s.h:115
MBSimFlexibleBody::NurbsCurve1s::normalRotationGrid
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
MBSimFlexibleBody::NurbsCurve1s::computeCurveJacobians
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
MBSimFlexibleBody::NurbsCurve1s
contour 1s flexible with NURBS parametrization
Definition: nurbs_curve_1s.h:37
MBSim::Element::InitStage
InitStage
MBSimFlexibleBody::NurbsCurve1s::qSize
int qSize
number of DOFs
Definition: nurbs_curve_1s.h:105
MBSimFlexibleBody::NurbsCurve1s::degU
int degU
interpolation degree
Definition: nurbs_curve_1s.h:120
MBSim::ContourFrame
MBSimFlexibleBody::NurbsCurve1s::NurbsCurve1s
NurbsCurve1s(const std::string &name)
constructor
Definition: nurbs_curve_1s.h:43
MBSim::Element::name
std::string name
MBSimFlexibleBody::NurbsCurve1s::openStructure
bool openStructure
open or closed beam structure
Definition: nurbs_curve_1s.h:110
MBSimFlexibleBody::NurbsCurve1s::computeCurveVelocities
void computeCurveVelocities(bool update=false)
interpolates the velocities with the node-data from the body
Definition: nurbs_curve_1s.cc:87
MBSim::NurbsCurve
MBSimFlexibleBody::NurbsCurve1s::CurveJacobiansOfTranslation
std::vector< MBSim::NurbsCurve > CurveJacobiansOfTranslation
interpolated Jacobians of Translation of the contour
Definition: nurbs_curve_1s.h:145
MBSimFlexibleBody::NurbsCurve1s::computeCurveAngularVelocities
void computeCurveAngularVelocities(bool update=false)
interpolates the angular velocities with the node-data from the body
Definition: nurbs_curve_1s.cc:110
MBSim::ContactKinematics
MBSimFlexibleBody::NurbsCurve1s::CurveJacobiansOfRotation
std::vector< MBSim::NurbsCurve > CurveJacobiansOfRotation
interpolated Jacobians of Rotation on the contour
Definition: nurbs_curve_1s.h:150
MBSimFlexibleBody::NurbsCurve1s::curveVelocities
MBSim::NurbsCurve curveVelocities
interpolated velocities of the contour
Definition: nurbs_curve_1s.h:130
MBSimFlexibleBody::NurbsCurve1s::~NurbsCurve1s
~NurbsCurve1s() override=default
destructor