mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
generic_ffr_interface_node_frame.h
1/* Copyright (C) 2004-2022 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 _GENERIC_FFR_INTERFACE_NODE_FRAME_H__
21#define _GENERIC_FFR_INTERFACE_NODE_FRAME_H__
22
23#include "mbsimFlexibleBody/frames/node_based_frame.h"
24
25namespace MBSimFlexibleBody {
26
32
33 public:
34 GenericFfrInterfaceNodeFrame(const std::string &name = "dummy") : NodeBasedFrame(name), Id(fmatvec::Eye()) { }
35
36 void setApproximateShapeMatrixOfRotation(bool approximateShapeMatrixOfRotation_) { approximateShapeMatrixOfRotation = approximateShapeMatrixOfRotation_; }
37 bool getApproximateShapeMatrixOfRotation() const { return approximateShapeMatrixOfRotation; }
38
39 void updatePositions() override;
40 void updateVelocities() override;
41 void updateAccelerations() override;
42 void updateJacobians(int j=0) override;
43 void updateGyroscopicAccelerations() override;
44 const fmatvec::Vec3& evalGlobalRelativePosition() { if(updPos) updatePositions(); return WrRP; }
45 const fmatvec::Vec3& evalGlobalRelativeVelocity() { if(updVel) updateVelocities(); return Wvrel; }
46 const fmatvec::Vec3& evalGlobalRelativeAngularVelocity() { if(updVel) updateVelocities(); return Womrel; }
47 fmatvec::Vec3& getGlobalRelativeVelocity(bool check=true) { assert((not check) or (not updVel)); return Wvrel; }
48
49 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
50 void initializeUsingXML(xercesc::DOMElement *element) override;
51
52 protected:
53 MBSim::Frame *R;
54
58 fmatvec::VecVI nodes;
59
63 fmatvec::VecV weights;
64
65 fmatvec::Vec3 KrKP, WrRP, Wvrel, Womrel;
66 fmatvec::SqrMat3 ARP;
67 fmatvec::Mat3xV Phi, Psi;
68 fmatvec::SqrMat3 Id;
69
70 bool approximateShapeMatrixOfRotation{false};
71 };
72
73}
74
75#endif
base class for interface node frames
Definition: generic_ffr_interface_node_frame.h:31
fmatvec::VecVI nodes
node numbers
Definition: generic_ffr_interface_node_frame.h:58
fmatvec::VecV weights
weights
Definition: generic_ffr_interface_node_frame.h:63
node based frame
Definition: node_based_frame.h:31
std::string name