FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
RigidBarCable.h
1#pragma once
2
88#include <string>
89#include <fhsim/simobject/SimObject.h>
90#ifdef FH_VISUALIZATION
91#include "sfh/ogre/CDynamicLines.h"
92#endif
93#include <limits>
94
95#include "subroutines/RBCEngine.h"
96
97
98//Class definition
99class RigidBarCable : public SimObject
100{
101public:
103 RigidBarCable(std::string simObjectName, ISimObjectCreator* creator);
105
106
109
110#ifdef FH_VISUALIZATION
112 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
114
116 void RenderUpdate(const double T, const double* const X);
118#endif
119
120 // Member functions
122 void OdeFcn(const double T, const double* const X,
123 double* const XDot) const;
125
126 // Output port
127 const double* const ForceA(const double T, const double* const X);
128 const double* const ForceB(const double T, const double* const X);
129 const double* const PosR(const double T, const double* const X,
130 const int index);
131 const double* const VelR(const double T, const double* const X,
132 const int index);
133
134protected:
135 void InitialConditionSetup(const double T,
136 const double *const currentIC,
137 double* const updatedIC,
138 ISimObjectCreator* const creator);
139
140
141
142 protected:
143 // States
144 int m_ISVecR;
145 int m_ISVecRdot;
146 int m_ISVecB;
147 int m_ISVecBdot;
148 int m_ISEndNodeSum;
149
150#ifdef FH_VISUALIZATION
151 Ogre::Entity* m_RenderSpring;
152 Ogre::SceneNode* m_RenderNode;
153 int m_numPoints;
154 CDynamicLines* m_lines;
155#endif
156
157 private:
158 // Input port
159 ISignalPort* m_PosA;
160 ISignalPort* m_VelA;
161 ISignalPort* m_PosB;
162 ISignalPort* m_VelB;
163 ISignalPort **m_forceBa;
164 ISignalPort **m_forceBb;
165
166 RBCEngine *m_engine;
167
168 double *m_forceOutA;
169 double *m_forceOutB;
170 double *m_posROut;
171 double *m_velROut;
172
173 int m_NofBarElements;
174};
Class containing a Rigid Bar Cable (RBC) calculation engine.
Definition RBCEngine.h:20
Definition RigidBarCable.h:100
void OdeFcn(const double T, const double *const X, double *const XDot) const
Calculates the time derivative of the state vector.
RigidBarCable(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
~RigidBarCable()
The destructor cleans up dynamically allocated memory.