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