Marine systems simulation
Loading...
Searching...
No Matches
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
166//Class definition
167class CCable : public SimObject
168{
169public:
171 CCable(std::string sSimObjectName, ISimObjectCreator* pCreator);
172
175
176 // Member functions
177 void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep);
178 void InitialConditionSetup(const double dT, const double *const adCurrentIC, double* const adUpdatedIC, ISimObjectCreator* const pCreator);
179 void FinalSetup(const double dT, const double *const adX, ISimObjectCreator* const pCreator);
180 void CalcOutput(const double dT, const double* const adX);
181
182 const double* OutForceA(const double dT, const double* const adX);
183 const double* OutForceB(const double dT, const double* const adX);
184 const double* OutPosA(const double dT, const double* const adX);
185 const double* OutPosB(const double dT, const double* const adX);
186
187#ifdef FH_VISUALIZATION
188
190 void RenderInit(Ogre::Root* const pOgreRoot, ISimObjectCreator* const pCreator);
191
193 void RenderUpdate(const double dT, const double* const adX);
194#endif
195protected:
196
197 void UpdateLength(double dNewLength, double dDeltaT);
198
200 void UpdateStiffness(const double* const adForceA, const double* const adForceB);
201
204
205
206 ISignalPort* m_pInLength;
207 ISignalPort* m_pInVelA;
208 ISignalPort* m_pInVelB;
209 ISignalPort* m_pInPosA;
210 ISignalPort* m_pInPosB;
212 ICommonComputation* m_pCommonCalc;
213
214 // Member variables
217
218 double m_dInertiaA;
219 double m_dInertiaB;
220 double m_adForceA[3];
221 double m_adForceB[3];
222 double* m_adLengths;
223 std::string m_sCableName;
224
225 CInternalCableWithBottomContact* m_pInternalCable; //< The cable calculations.
227
228};
Definition Cable.h:105
ISignalPort * m_pInVelA
The velocity A input port.
Definition CCable.h:207
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:206
int m_iNumElements
The number of elements to divide the cable into.
Definition CCable.h:215
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:223
double m_adForceA[3]
The force on the end A.
Definition CCable.h:220
double * m_adLengths
The lengths of the cable elements.
Definition CCable.h:222
~CCable()
The destructor deletes dynamically allocated memory.
SCableSpec m_CableSpec
The cable specification.
Definition CCable.h:226
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:218
ISignalPort * m_pInPosA
The position A input port.
Definition CCable.h:209
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:210
ISignalPort * m_pInVelB
The velocity B input port.
Definition CCable.h:208
int m_IStates
The index to the internal states of the cable.
Definition CCable.h:211
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:219
int m_iNumNodes
The number of nodes of the cable.
Definition CCable.h:216
ICommonComputation * m_pCommonCalc
Calculations necessary for more than one output port.
Definition CCable.h:212
double m_adForceB[3]
The force on the end B.
Definition CCable.h:221
Class containing a cable object to be part of other structures.
Definition CInternalCableWithBottomContact.h:20
Contains some specifications used for simulating cables.
Definition CInternalCable.h:31