Marine systems simulation
HydroCable.h
1#ifndef HYDRO_CABLE_H
2#define HYDRO_CABLE_H
3
4#include "SimObject.h"
5
6#include "sfh/constants.h"
7#include "sfh/math.h"
8#include "sfh/text.h"
9#include "sfh/util.h"
10
11#include <Eigen/Dense>
12
13#include <memory>
14
88class HydroCable : public SimObject
89{
90 public:
91 HydroCable(const std::string& simObjectName, ISimObjectCreator* const creator);
92 void OdeFcn(const double T, const double* const X, double* const XDot, const bool IsMajorTimeStep);
93 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
94
95#ifdef FH_VISUALIZATION
96 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
97 void RenderUpdate(const double T, const double* const X);
98#endif
99
100 protected:
101 void SetOutputPortValues(const double T, const double* const X);
102 Eigen::Vector3d Drag(int k, int l, const double T, const double* const X);
103 Eigen::Vector3d Spring(int k, int l, const double T, const double* const X);
104 Eigen::Vector3d Damp(int k, int l, const double T, const double* const X);
105 const double* ForceA(const double T, const double* const X);
106 const double* ForceB(const double T, const double* const X);
107 const double* PosA(const double T, const double* const X);
108 const double* PosB(const double T, const double* const X);
109
110 ICommonComputation* m_SetOutputPortValues;
111 ISignalPort* m_PositionA;
112 ISignalPort* m_PositionB;
113 ISignalPort* m_VelocityA;
114 ISignalPort* m_VelocityB;
115 ISignalPort* m_Current;
116
117 std::vector<int> m_PositionIndex, m_VelocityIndex;
118
119 int m_NumPoints;
120 double m_ForceA[3];
121 double m_ForceB[3];
122 // NEW START
123 double m_PosA[3];
124 double m_PosB[3];
125 // NEW END
126
127 double m_ElementMass, m_ElementLength0;
128 double m_SpringCoef, m_DamperCoef, m_GravYancy;
129 double m_CrossDragCoef, m_AlongDragCoef, m_RhoWater;
130 double m_Mass, m_Length, m_Diameter, m_RhoCable, m_Modulus;
131
132#ifdef FH_VISUALIZATION
133 Ogre::ManualObject* m_Line;
134#endif
135};
136
137#endif
Definition: HydroCable.h:89