Marine systems simulation
CCableBranched.h
1#pragma once
2
212#include <string>
213#include "SimObject.h"
214#include "sfh/timers/StopWatch.h"
215#include <IBasicBottom.h>
216#include <ICurrentVel.h>
217#include "cable/subroutines/CInternalCableWithBottomContact.h"
218
219#ifdef FH_VISUALIZATION
220# ifdef USE_BILLBOARD_LABELS
221# include "CMovableText.h"
222# endif
223#endif
224
225//Class definition
226class CCableBranched : public SimObject
227{
228public:
230 CCableBranched(std::string sSimObjectName, ISimObjectCreator* pCreator);
231 CCableBranched(std::string sSimObjectName): SimObject(sSimObjectName) {}
232 virtual void aFunction(std::string sSimObjectName, ISimObjectCreator* pCreator);
235
236 // Member functions
237 virtual void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep);
238 void FinalSetup(const double dT, const double *const adX, ISimObjectCreator* const pCreator);
239 void InitialConditionSetup(const double dT, const double *const adCurrentIC, double* const adUpdatedIC, ISimObjectCreator* const pCreator);
240#ifdef FH_VISUALIZATION
242 void RenderInit(Ogre::Root* const pOgreRoot, ISimObjectCreator* const pCreator);
243
245 void RenderUpdate(const double dT, const double* const adX);
246#endif
247
248protected:
249 virtual void CreateStates(ISimObjectCreator* pCreator);
250 void CalcOutput(const double dT, const double* const adX);
251 void OutputExternalConnForces(double dT, const double* adX);
252 void GetPosAndVelPointer(
253 int iNode,
254 double dT,
255 const double * const adX,
256 const double**const padPos,
257 const double**const padVel);
258
259 const double * GetPosPointer(
260 int iNode,
261 double dT,
262 const double * const adX);
263
264
266 virtual void AddBottomForces(double dT, const double* const adX);
267 virtual void CreateDataStructures();
268 virtual void CreateInputports(ISimObjectCreator* pCreator);
269 virtual void CreateOutputports(ISimObjectCreator* pCreator);
270
271
273 void CheckNodeNumber(int iNodeNumber, std::string sNodeDescription, ISimObjectCreator* pCreator);
274
275 ISignalPort** m_apInVel;
276 ISignalPort** m_apInPos;
277 ISignalPort** m_apInLength;
278 ICommonComputation* m_pCommonCalc;
279 const double* ExternalForce(const double dT, const double* const adX, int i);
280 const double* ExternalTension(const double dT, const double* const adX, int i);
281 const double* SectionLength(const double dT, const double* const adX, int i);
292
293 //int* m_aiNumAEndsToExt; ///< The number of elements with the A node connected to each external node.
294 //int* m_aiNumBEndsToExt; ///< The number of elements with the B node connected to each external node.
295 //int** m_aaiAEndsToExt; ///< The elements with the A node connected to each external node.
296 //int** m_aaiBEndsToExt; ///< The elements with the B node connected to each external node.
297
298 //int* m_aiNumElementsPerSection;
302 double m_dFluidRho;
304 double m_dMaxStep;
306 double* m_dStiffness;
311 double* m_dDensity;
312 double* m_dE;
313 double* m_dDiameter;
316 //double* m_adInertiaA; ///< The inertia of the connected end A of each eleemnt.
317 //double* m_adInertiaB; ///< The inertia of the connected end B of each eleemnt.
319 //double* m_adForceA; ///< The force on the A nodes.
320 //double* m_adForceB; ///< The force on the B nodes.
321 double* m_adLengths;
322 std::string m_sMaterialName;
324 double* m_adExternalTensions;
326
327 const double* m_padVelWater;
328 IBasicBottom** m_ppBottom;
329 ICurrentVel** m_ppCurrentVel;
330 //bool m_bOutputFcnCalled;
331#ifdef FH_VISUALIZATION
332#ifdef USE_BILLBOARD_LABELS
333 Ogre::SceneNode** m_aRenderNode;
334 Ogre::CMovableText** m_aBBTxt;
335 double m_dTxtSize;
336#endif
337#endif
338
339
340};
Definition: CCableBranched.h:227
int m_iNumExternalConn
The number of external connections.
Definition: CCableBranched.h:289
int * m_aiNodeConnections
The nodes connected to each cable section.
Definition: CCableBranched.h:290
double * m_dDampingRatio
The damping ratio to specify the internal damping.
Definition: CCableBranched.h:310
CInternalCable ** m_apCableSections
An array holding the cable sections.
Definition: CCableBranched.h:325
double m_dMaxLengthChangeSpeed
The maximum speed of the cable length change.
Definition: CCableBranched.h:309
double * m_adLengths
The lengths of the cable elements.
Definition: CCableBranched.h:321
int m_iNumCableSections
The number of cable sections in the branched cable, where each section may be comprised of one or mor...
Definition: CCableBranched.h:287
double m_dStepSafetyFactor
The safety factor when calculating the Young modulus of the element.
Definition: CCableBranched.h:299
double * m_dMaxTension
The maximum tension in the cable.
Definition: CCableBranched.h:314
ICommonComputation * m_pCommonCalc
Calculations necessary for more than one output port.
Definition: CCableBranched.h:278
double * m_dDensity
The density of the cable material.
Definition: CCableBranched.h:311
double m_dMaxAcceleration
The value to truncate the acceleration of each node to.
Definition: CCableBranched.h:303
double m_dNumericalDamping
The numerical damping of the cable.
Definition: CCableBranched.h:301
double * m_adNodeInertia
The inertia of the calculation nodes belonging to this simObject.
Definition: CCableBranched.h:315
int * m_aIStateVel
An array of indices to the node velocity states.
Definition: CCableBranched.h:283
int m_iNumNodesGlobal
The number of nodes of the branched cable used for conecting the internal cable sections.
Definition: CCableBranched.h:288
double * m_adNodeForce
The force on the calculation nodes belonging to this simObject.
Definition: CCableBranched.h:318
double m_dFluidRho
The density of the surrounding fluid.
Definition: CCableBranched.h:302
ISignalPort ** m_apInPos
The position input ports.
Definition: CCableBranched.h:276
double * m_adRelaxedLength_d
The desired relaxed length of the cable.
Definition: CCableBranched.h:308
ISignalPort ** m_apInLength
The cable sections length port.
Definition: CCableBranched.h:277
double m_dDrawScale
The scale for which to draw the cable diameter.
Definition: CCableBranched.h:323
double * m_dStiffness
The linear stiffness of the cable.
Definition: CCableBranched.h:306
virtual void AddBottomForces(double dT, const double *const adX)
Adds the bottom forces to the main nodes.
double * m_dDiameter
The diameter of the cable.
Definition: CCableBranched.h:313
double * m_dMeanTension
The mean tension of the cable.
Definition: CCableBranched.h:305
int m_iNumNodesCalc
The number of nodes of the cable between the cable elements.
Definition: CCableBranched.h:286
CCableBranched(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.
int m_iCableFaces
The number of faces of the cable visuaization.
Definition: CCableBranched.h:291
int m_iNumElements
The number of elements to divide the cable into.
Definition: CCableBranched.h:285
double * m_adRelaxedLength
The relaxed length of the cable.
Definition: CCableBranched.h:307
~CCableBranched()
The destructor deletes dynamically allocated memory.
double * m_dE
The stiffness of the cable material.
Definition: CCableBranched.h:312
std::string m_sMaterialName
The material name of the cable;.
Definition: CCableBranched.h:322
int * m_aIStatePos
An array of indices to the node position states.
Definition: CCableBranched.h:282
ISignalPort ** m_apInVel
The velocity input port s.
Definition: CCableBranched.h:275
void CheckNodeNumber(int iNodeNumber, std::string sNodeDescription, ISimObjectCreator *pCreator)
Checks to see if a specified nodenumber is ok.
double m_dEAdaptationPeriod
The time constant of the adaptation of the mean tension.
Definition: CCableBranched.h:300
double m_dMaxStep
The maximum steplength of the simulation.
Definition: CCableBranched.h:304
int * m_aIStateCable
An array of indices to the cable sections states.
Definition: CCableBranched.h:284
Definition: CInternalCable.h:195
Interface for calculating the bottom force on various objects.
Definition: IBasicBottom.h:23
Definition: ICurrentVel.h:12