FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
RigidBarCable.h
1#pragma once
2
91#include <string>
92#include <fhsim/simobject/SimObject.h>
93#ifdef FH_VISUALIZATION
94#include "sfh/ogre/CDynamicLines.h"
95#endif
96#include <limits>
97
98#include "subroutines/RBCEngine.h"
99
100
101//Class definition
102class RigidBarCable : public SimObject
103{
104public:
106 RigidBarCable(std::string simObjectName, ISimObjectCreator* creator);
108
109
112
113#ifdef FH_VISUALIZATION
115 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
117
119 void RenderUpdate(const double T, const double* const X);
121#endif
122
123 // Member functions
125 void OdeFcn(const double T, const double* const X,
126 double* const XDot) const;
128
129 // Output port
130 const double* const ForceA(const double T, const double* const X);
131 const double* const ForceB(const double T, const double* const X);
132 const double* const PosR(const double T, const double* const X,
133 const int index);
134 const double* const VelR(const double T, const double* const X,
135 const int index);
136
137protected:
138 void InitialConditionSetup(const double T,
139 const double *const currentIC,
140 double* const updatedIC,
141 ISimObjectCreator* const creator);
142
143
144
145 protected:
146 // States
147 int m_ISVecR;
148 int m_ISVecRdot;
149 int m_ISVecB;
150 int m_ISVecBdot;
151 int m_ISEndNodeSum;
152
153#ifdef FH_VISUALIZATION
154 Ogre::Entity* m_RenderSpring;
155 Ogre::SceneNode* m_RenderNode;
156 int m_numPoints;
157 CDynamicLines* m_lines = nullptr;
158#endif
159
160 private:
161 // Input port
162 ISignalPort* m_PosA;
163 ISignalPort* m_VelA;
164 ISignalPort* m_PosB;
165 ISignalPort* m_VelB;
166
167 RBCEngine *m_engine;
168
169 double *m_forceOutA;
170 double *m_forceOutB;
171 double *m_posROut;
172 double *m_velROut;
173
174 int m_NofBarElements;
175};
Class containing a Rigid Bar Cable (RBC) calculation engine.
Definition RBCEngine.h:20
Definition RigidBarCable.h:103
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.