All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
fixed_nodal_frame.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 _FIXED_NODAL_FRAME_H__
21 #define _FIXED_NODAL_FRAME_H__
22 
23 #include "mbsim/frames/frame.h"
24 
25 namespace MBSimFlexibleBody {
26 
31  class FixedNodalFrame : public MBSim::Frame {
32 
33  public:
34  FixedNodalFrame(const std::string &name = "dummy") : MBSim::Frame(name), R(0), ARP(fmatvec::SqrMat3(fmatvec::EYE)), E(fmatvec::Eye()), nq(0) { }
35 
36  FixedNodalFrame(const std::string &name, const fmatvec::Vec3 &r, const fmatvec::Mat3xV &Phi_, const fmatvec::Mat3xV &Psi_, const fmatvec::SqrMat3 &A=fmatvec::SqrMat3(fmatvec::EYE)) : MBSim::Frame(name), R(0), RrRP(r), ARP(A), E(fmatvec::Eye()), Phi(Phi_), Psi(Psi_), nq(0) { }
37 
38  std::string getType() const { return "FixedNodalFrame"; }
39 
40  virtual void init(InitStage stage);
41 
42  int getNumberOfModeShapes() const { return nq; }
43  void setNumberOfModeShapes(int nq_) { nq = nq_; }
44 
45  void updateqRef(const fmatvec::Vec& ref) { q>>ref; }
46  void updateqdRef(const fmatvec::Vec& ref) { qd>>ref; }
47  void updateqddRef(const fmatvec::Vec& ref) { qdd>>ref; }
48 
49  void setRelativePosition(const fmatvec::Vec3 &r) { RrRP = r; }
50  void setRelativeOrientation(const fmatvec::SqrMat3 &A) { ARP = A; }
51  void setShapeMatrixOfTranslation(const fmatvec::Mat3xV &Phi_) { Phi = Phi_; }
52  void setShapeMatrixOfRotation(const fmatvec::Mat3xV &Psi_) { Psi = Psi_; }
53  void setStressMatrix(const fmatvec::Matrix<fmatvec::General, fmatvec::Fixed<6>, fmatvec::Var, double> &sigmahel_) { sigmahel = sigmahel_; }
54  void setNonlinearStressMatrix(const std::vector<fmatvec::Matrix<fmatvec::General, fmatvec::Fixed<6>, fmatvec::Var, double> > &sigmahen_) { sigmahen = sigmahen_; }
55  void setInitialStress(const fmatvec::Vector<fmatvec::Fixed<6>, double > &sigma0_) { sigma0 = sigma0_; }
56  void setGeometricStiffnessMatrixDueToForce(const std::vector<fmatvec::SqrMatV> &K0F_) { K0F = K0F_; }
57  void setGeometricStiffnessMatrixDueToMoment(const std::vector<fmatvec::SqrMatV> &K0M_) { K0M = K0M_; }
58 
59  void setFrameOfReference(MBSim::Frame *frame) { R = frame; }
60 
61  const fmatvec::Vec3& getRelativePosition() const { return RrRP; }
62  const fmatvec::SqrMat3& getRelativeOrientation() const { return ARP; }
63  const MBSim::Frame* getFrameOfReference() const { return R; }
64 
65  const fmatvec::Vec3& getGlobalRelativePosition(bool check=true) const { assert((not check) or (not updPos)); return WrRP; }
66  const fmatvec::Mat3xV& getGlobalPhi(bool check=true) const { assert((not check) or (not updPos)); return WPhi; }
67  const fmatvec::Mat3xV& getGlobalPsi(bool check=true) const { assert((not check) or (not updPos)); return WPsi; }
68 
69  const fmatvec::Vec3& evalGlobalRelativePosition();
70  const fmatvec::Mat3xV& evalGlobalPhi();
71  const fmatvec::Mat3xV& evalGlobalPsi();
72  void updatePositions();
73  void updateVelocities();
74  void updateAccelerations();
75  void updateJacobians(int j=0);
76  void updateGyroscopicAccelerations();
77 
78  virtual void plot();
79 
80  virtual void initializeUsingXML(xercesc::DOMElement *element);
81 
82  protected:
83  MBSim::Frame *R;
84  fmatvec::Vec3 RrRP, WrRP;
85  fmatvec::SqrMat3 ARP, APK, E;
86  fmatvec::Mat3xV WPhi, WPsi, Phi, Psi;
87  std::vector<fmatvec::SqrMatV> K0F, K0M;
88  fmatvec::Vector<fmatvec::Fixed<6>, double> sigma0;
90  std::vector<fmatvec::Matrix<fmatvec::General, fmatvec::Fixed<6>, fmatvec::Var, double> > sigmahen;
91  fmatvec::Vec q, qd, qdd;
92  int nq;
93  };
94 
95 }
96 
97 #endif
fixed nodal frame on flexible bodies
Definition: fixed_nodal_frame.h:31

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML