Marine systems simulation
CCable.h
1#pragma once
158
159#include <string>
160#include "SimObject.h"
161#include "cable/subroutines/CCableElDynStiff.h"
162#include "cable/subroutines/CInternalCableWithBottomContact.h"
163
164#include "sfh/timers/Timer.h"
165#include "IBasicBottom.h"
166#include "ICurrentVel.h"
167
168//Class definition
169class CCable : public SimObject
170{
171public:
173 CCable(std::string sSimObjectName, ISimObjectCreator* pCreator);
174
177
178 // Member functions
179 void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep);
180 void InitialConditionSetup(const double dT, const double *const adCurrentIC, double* const adUpdatedIC, ISimObjectCreator* const pCreator);
181 void FinalSetup(const double dT, const double *const adX, ISimObjectCreator* const pCreator);
182 void CalcOutput(const double dT, const double* const adX);
183
184 const double* OutForceA(const double dT, const double* const adX);
185 const double* OutForceB(const double dT, const double* const adX);
186 const double* OutPosA(const double dT, const double* const adX);
187 const double* OutPosB(const double dT, const double* const adX);
188
189#ifdef FH_VISUALIZATION
190
192 void RenderInit(Ogre::Root* const pOgreRoot, ISimObjectCreator* const pCreator);
193
195 void RenderUpdate(const double dT, const double* const adX);
196#endif
197protected:
198
199 void UpdateLength(double dNewLength, double dDeltaT);
200
202 void UpdateStiffness(const double* const adForceA, const double* const adForceB);
203
206
207
208 ISignalPort* m_pInLength;
209 ISignalPort* m_pInVelA;
210 ISignalPort* m_pInVelB;
211 ISignalPort* m_pInPosA;
212 ISignalPort* m_pInPosB;
214 ICommonComputation* m_pCommonCalc;
215
216 // Member variables
219
220 double m_dInertiaA;
221 double m_dInertiaB;
222 double m_adForceA[3];
223 double m_adForceB[3];
224 double* m_adLengths;
225 std::string m_sCableName;
226
227 CInternalCableWithBottomContact* m_pInternalCable; //< The cable calculations.
229 IBasicBottom** m_ppBottom;
230 ICurrentVel** m_ppCurrentVel;
231
232};
Definition: Cable.h:101
ISignalPort * m_pInVelA
The velocity A input port.
Definition: CCable.h:209
void UpdateStiffness(const double *const adForceA, const double *const adForceB)
Updates the stiffness of the cable to ensure that this is not too large.
ISignalPort * m_pInLength
The cable length input port.
Definition: CCable.h:208
int m_iNumElements
The number of elements to divide the cable into.
Definition: CCable.h:217
CCable(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.
std::string m_sCableName
The identification name of the cable;.
Definition: CCable.h:225
double m_adForceA[3]
The force on the end A.
Definition: CCable.h:222
double * m_adLengths
The lengths of the cable elements.
Definition: CCable.h:224
~CCable()
The destructor deletes dynamically allocated memory.
SCableSpec m_CableSpec
The cable specification.
Definition: CCable.h:228
void InitialConditionSetup(const double dT, const double *const adCurrentIC, double *const adUpdatedIC, ISimObjectCreator *const pCreator)
functionality for setting initialconditions based on input port results.
double m_dInertiaA
The inertia of the end A.
Definition: CCable.h:220
ISignalPort * m_pInPosA
The position A input port.
Definition: CCable.h:211
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
free allocated memory
ISignalPort * m_pInPosB
The position B input port.
Definition: CCable.h:212
ISignalPort * m_pInVelB
The velocity B input port.
Definition: CCable.h:210
int m_IStates
The index to the internal states of the cable.
Definition: CCable.h:213
void UpdateInertia()
Updates the inertia of the cable according to the changing length.
double m_dInertiaB
The inertia of the end B.
Definition: CCable.h:221
int m_iNumNodes
The number of nodes of the cable.
Definition: CCable.h:218
ICommonComputation * m_pCommonCalc
Calculations necessary for more than one output port.
Definition: CCable.h:214
double m_adForceB[3]
The force on the end B.
Definition: CCable.h:223
Class containing a cable object to be part of other structures.
Definition: CInternalCableWithBottomContact.h:21
Interface for calculating the bottom force on various objects.
Definition: IBasicBottom.h:23
Definition: ICurrentVel.h:12
Contains some specifications used for simulating cables.
Definition: CInternalCable.h:31