mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
flexible_ffr_body.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_FFR_BODY_H_
21#define _FLEXIBLE_FFR_BODY_H_
22
23#include "mbsimFlexibleBody/flexible_body/generic_flexible_ffr_body.h"
24#include <openmbvcppinterface/flexiblebody.h>
25#include <openmbvcppinterface/objectfactory.h>
26#include <openmbvcppinterface/group.h>
27
28namespace OpenMBV {
29 class FlexibleBody;
30}
31
32namespace MBSimFlexibleBody {
33
39
40 public:
41 FlexibleFfrBody(const std::string &name="") : GenericFlexibleFfrBody(name) { }
42
43 // Interface for basic data
49 void setMass(double m_) { m = m_; }
50 void setPositionIntegral(const fmatvec::Vec3 &rdm_) { rdm = rdm_; }
51 void setPositionPositionIntegral(const fmatvec::SymMat3& rrdm_) { rrdm = rrdm_; }
52 void setShapeFunctionIntegral(const fmatvec::Mat3xV &Pdm_) { Pdm <<= Pdm_; }
53
54 void setPositionShapeFunctionIntegralArray(const std::vector<fmatvec::Mat3xV> &rPdm_) { rPdm = rPdm_; }
55
56 void setShapeFunctionShapeFunctionIntegralArray(const std::vector<std::vector<fmatvec::SqrMatV>> &PPdm_) { PPdm = PPdm_; }
57
58 void setStiffnessMatrix(const fmatvec::SymMatV &Ke0_) { Ke0 <<= Ke0_; }
59 void setDampingMatrix(const fmatvec::SymMatV &De0_) { De0 <<= De0_; }
60 void setModalDamping(const fmatvec::VecV &mDamping_) { mDamping <<= mDamping_; }
61 void setProportionalDamping(const fmatvec::Vec2 &beta_) { beta = beta_; }
62 // End of interface
63
64 // Interface for nonlinear stiffness matrices
65 void setNonlinearStiffnessMatrixOfFirstOrderArray(const std::vector<fmatvec::SqrMatV> &Knl1_) { Knl1 = Knl1_; }
66
67 void setNonlinearStiffnessMatrixOfSecondOrderArray(const std::vector<std::vector<fmatvec::SqrMatV>> &Knl2_) { Knl2 = Knl2_; }
68 // End of interface
69
70 // Interface for reference stresses
71 void setInitialStressIntegral(const fmatvec::VecV &ksigma0_) { ksigma0 <<= ksigma0_; }
72 void setNonlinearInitialStressIntegral(const fmatvec::SqrMatV &ksigma1_) { ksigma1 <<= ksigma1_; }
73 // End of interface
74
75 // Interface for geometric stiffness matrices
76 void setGeometricStiffnessMatrixDueToAccelerationArray(const std::vector<fmatvec::SqrMatV> &K0t_) { K0t = K0t_; }
77
78 void setGeometricStiffnessMatrixDueToAngularAccelerationArray(const std::vector<fmatvec::SqrMatV> &K0r_) { K0r = K0r_; }
79
80 void setGeometricStiffnessMatrixDueToAngularVelocityArray(const std::vector<fmatvec::SqrMatV> &K0om_) { K0om = K0om_; }
81 // End of interface
82
83 void setNodeNumbers(const std::vector<int> &nodeNumbers_) { nodeNumbers = nodeNumbers_; }
84
85 void setNodalRelativePositionArray(const std::vector<fmatvec::Vec3> &r) { KrKP = r; }
86
87 void setNodalRelativeOrientationArray(const std::vector<fmatvec::SqrMat3> &A) { ARP = A; }
88
89 void setNodalShapeMatrixOfTranslationArray(const std::vector<fmatvec::Mat3xV> &Phi_) { Phi = Phi_; }
90
91 void setNodalShapeMatrixOfRotationArray(const std::vector<fmatvec::Mat3xV> &Psi_) { Psi = Psi_; }
92
93 void setNodalStressMatrixArray(const std::vector<fmatvec::Matrix<fmatvec::General, fmatvec::Fixed<6>, fmatvec::Var, double>> &sigmahel_) { sigmahel = sigmahel_; }
94
95 void setNodalNonlinearStressMatrixArray(const std::vector<std::vector<fmatvec::Matrix<fmatvec::General, fmatvec::Fixed<6>, fmatvec::Var, double>> > &sigmahen_) { sigmahen = sigmahen_; }
96
97 void setNodalInitialStressArray(const std::vector<fmatvec::Vector<fmatvec::Fixed<6>, double>> &sigma0_) { sigma0 = sigma0_; }
98
99 void setNodalGeometricStiffnessMatrixDueToForceArray(const std::vector<std::vector<fmatvec::SqrMatV>> &K0F_) { K0F = K0F_; }
100
101 void setNodalGeometricStiffnessMatrixDueToMomentArray(const std::vector<std::vector<fmatvec::SqrMatV>> &K0M_) { K0M = K0M_; }
102
103 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
104 void initializeUsingXML(xercesc::DOMElement *element) override;
105
106 void setOpenMBVFlexibleBody(const std::shared_ptr<OpenMBV::FlexibleBody> &body);
107 void setOpenMBVNodeNumbers(const std::vector<int> &visuNodes_) { visuNodes = visuNodes_; }
108 void setOpenMBVColorRepresentation(OpenMBVFlexibleBody::ColorRepresentation ombvColorRepresentation_) { ombvColorRepresentation = ombvColorRepresentation_; }
109 void setPlotNodeNumbers(const std::vector<int> &plotNodes_) { plotNodes = plotNodes_; }
110
111 private:
112 fmatvec::Vec2 beta;
113 fmatvec::VecV mDamping;
114 };
115
116}
117
118#endif
Flexible body using a floating frame of reference formulation.
Definition: flexible_ffr_body.h:38
void setMass(double m_)
Set mass.
Definition: flexible_ffr_body.h:49
Generic flexible body using a floating frame of reference formulation.
Definition: generic_flexible_ffr_body.h:62
std::string name