mbsimflexiblebody 4.0.0 MBSim Flexible Body Module

linear_external.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: thorsten.schindler@mytum.de
18 * rzander@users.berlios.de
19 */
20
21 #ifndef _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_
22 #define _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_
23
24 #include "mbsimFlexibleBody/flexible_body.h"
25 #include "mbsim/mbsim_event.h"
26 #include <fstream>
27
28 namespace MBSimFlexibleBody {
29
30 class ContourInterpolation;
31
43 class FlexibleBodyLinearExternal : public FlexibleBody {
44 public:
49 FlexibleBodyLinearExternal(const std::string &name);
50
54 virtual ~FlexibleBodyLinearExternal() {}
55
56 /* INHERITED INTERFACE OF ELEMENT */
57 /***************************************************/
58
59 /* INHERITED INTERFACE OF OBJECT */
60 virtual void init(InitStage stage, const MBSim::InitConfigSet &config) { new MBSim::MBSimError("(FlexibleBodyLinearExternal::init): Not implemented!"); }
61 virtual void facLLM() {}
62 /***************************************************/
63
64 /* INHERITED INTERFACE OF FLEXIBLEBODY */
65 virtual void BuildElements() { new MBSim::MBSimError("(FlexibleBodyLinearExternal::BuildElements): Not implemented!"); }
66 virtual void GlobalVectorContribution(int n, const fmatvec::Vec& locVec, fmatvec::Vec& gloVec);
67 virtual void GlobalMatrixContribution(int n, const fmatvec::Mat& locMat, fmatvec::Mat& gloMat);
68 virtual void GlobalMatrixContribution(int n, const fmatvec::SymMat& locMat, fmatvec::SymMat& gloMat);
75 virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::Frame::Feature ff, MBSim::Frame *frame=0);
76 virtual void updateJacobiansForFrame(MBSim::ContourPointData &data, MBSim::Frame *frame=0);
77 /***************************************************/
78
86 void readMassMatrix(const std::string &massfilename);
87
92 void setMassMatrix(const fmatvec::SymMat &mat);
93
98 void readStiffnessMatrix(const std::string &stiffnessfilename);
99
104 void setStiffnessMatrix(const fmatvec::SqrMat &mat);
105
112 void setProportionalDamping(const double &a, const double &b);
113
114 // /*! plot parameters of "BodyFlexibleLinearExternal"
115 // */
116 // void plotParameters();
117
118 using FlexibleBody::addFrame;
127 // void addFrame(const std::string &name, const std::string &jacobifilename);
128
135 // void addFrame(const std::string &name, const fmatvec::Mat &J_, const fmatvec::Vec &r_);
136
142 // void addContour(Contour *contour, const std::string &jacobifilename);
143
150 // void addContour(Contour *contour, const fmatvec::Mat &J_, const fmatvec::Vec &r_);
151
153 // void addContourInterpolation(ContourInterpolation *contour);
154
157 void setWrON00(const fmatvec::Vec &WrON00_) {WrON00 = WrON00_;}
158
159 /* geerbt */
160 fmatvec::Mat computeJacobianMatrix(const MBSim::ContourPointData &CP);
161
162 protected:
164 int nContours;
165
167 std::vector<MBSim::ContourPointData> contourType;
168
170 fmatvec::Vec WrON00;
171
177 void updateStateDependentVariables(double t);
184 void updateContours(double t);
185
190 MBSim::ContourPointData addInterface(const std::string &jacbifilename);
196 MBSim::ContourPointData addInterface(const fmatvec::Mat &J, const fmatvec::Vec &r);
197
198 /* empty function since mass, damping and stiffness matrices are constant !!! */
199 void updateJh_internal(double t);
200 };
201
202 }
203
204 #endif /* _FLEXIBLE_BODY_LINEAR_EXTERNAL_H_ */
205
MBSimFlexibleBody::FlexibleBodyLinearExternal::setProportionalDamping
void setProportionalDamping(const double &a, const double &b)
Definition: linear_external.cc:57
MBSimFlexibleBody::FlexibleBody
upmost class for flexible body implementation
Definition: flexible_body.h:50
MBSimFlexibleBody::FlexibleBodyLinearExternal::nContours
int nContours
Definition: linear_external.h:164
MBSimFlexibleBody::FlexibleBodyLinearExternal::setStiffnessMatrix
void setStiffnessMatrix(const fmatvec::SqrMat &mat)
Definition: linear_external.cc:147
MBSimFlexibleBody::FlexibleBodyLinearExternal::contourType
std::vector< MBSim::ContourPointData > contourType
Definition: linear_external.h:167
MBSimFlexibleBody::FlexibleBodyLinearExternal::WrON00
fmatvec::Vec WrON00
Definition: linear_external.h:170
MBSimFlexibleBody::FlexibleBodyLinearExternal::readMassMatrix
void readMassMatrix(const std::string &massfilename)
Definition: linear_external.cc:134
MBSimFlexibleBody::FlexibleBodyLinearExternal::GlobalMatrixContribution
virtual void GlobalMatrixContribution(int n, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat)
insert 'local' information in global matrices
Definition: linear_external.cc:49
MBSimFlexibleBody::FlexibleBodyLinearExternal::setWrON00
void setWrON00(const fmatvec::Vec &WrON00_)
Definition: linear_external.h:157
MBSimFlexibleBody::FlexibleBodyLinearExternal::FlexibleBodyLinearExternal
FlexibleBodyLinearExternal(const std::string &name)
constructor
Definition: linear_external.cc:36
MBSimFlexibleBody::FlexibleBodyLinearExternal::readStiffnessMatrix
void readStiffnessMatrix(const std::string &stiffnessfilename)
Definition: linear_external.cc:151
MBSimFlexibleBody::FlexibleBodyLinearExternal::updateContours
void updateContours(double t)
Definition: linear_external.cc:108
MBSimFlexibleBody::FlexibleBodyLinearExternal::~FlexibleBodyLinearExternal
virtual ~FlexibleBodyLinearExternal()
destructor
Definition: linear_external.h:54
MBSimFlexibleBody::FlexibleBodyLinearExternal::addInterface
MBSim::ContourPointData addInterface(const std::string &jacbifilename)
MBSimFlexibleBody::FlexibleBodyLinearExternal::setMassMatrix
void setMassMatrix(const fmatvec::SymMat &mat)
Definition: linear_external.cc:129
MBSim::Element::InitStage
InitStage
MBSimFlexibleBody::FlexibleBodyLinearExternal::BuildElements
virtual void BuildElements()
references finite element coordinates to assembled coordinates
Definition: linear_external.h:65
MBSimFlexibleBody::FlexibleBodyLinearExternal::updateStateDependentVariables
void updateStateDependentVariables(double t)
Definition: linear_external.cc:64
MBSim::Element::name
std::string name
MBSim::Body::frame
std::vector< Frame * > frame
MBSimFlexibleBody::FlexibleBodyLinearExternal
Linear models from external preprocessing, e.g. Finite Element model.
Definition: linear_external.h:43
MBSim::Frame
MBSimFlexibleBody::FlexibleBodyLinearExternal::updateKinematicsForFrame
virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::Frame::Feature ff, MBSim::Frame *frame=0)
Definition: linear_external.cc:72
MBSim::MBSimError
MBSimFlexibleBody::FlexibleBodyLinearExternal::GlobalVectorContribution
virtual void GlobalVectorContribution(int n, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec)
insert 'local' information in global vectors
Definition: linear_external.cc:45