Marine systems simulation
C6DofCable.h
1#pragma once
2
75#include <Eigen/Eigen>
76#include <SimObject.h>
77
78#ifdef FH_VISUALIZATION
79 #include "sfh/ogre/C3DLine.h"
80#endif
81
82namespace RbCable
83{
84 class C6DofCable : public SimObject
85 {
86 public:
87 C6DofCable(const string& simObjectName, ISimObjectCreator* const creator);
89 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
90 void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
91
92 const double* forceA(const double T, const double* const X);
93 const double* forceB(const double T, const double* const X);
94
95 // const double* const energy(const double T, const double* const X);
96
97 void calculations(const double T, const double* const X);
98
99#ifdef FH_VISUALIZATION
100 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
101 void RenderUpdate( const double T, const double* const X);
102 Ogre::ColourValue tensionColor(double N);
103#endif
104
105 protected:
106
107 typedef Eigen::Matrix<double,3,3> mat3;
108 typedef Eigen::Matrix<double,3,1> vec3;
109
110 // double m_energy[3];
111
112 int m_numElements;
113 double m_totalLength;
114 double m_radius;
115 double m_alpha;
116 double m_beta;
117 double m_epsilon;
118 double m_weight;
119 double m_rho;
120 double m_surfacePosZ;
121 double m_rhoWater;
122 double m_Ct; // tangential damping coefficient
123 double m_Cn; // normal damping coefficient
124
125 double m_L;
126 double m_M;
127 double m_Ixy;
128 double m_Iz;
129 mat3 m_baseM;
130
131 struct element {vec3 k; vec3 LkXw; mat3 Mi; mat3 JMiJt; int p; int q; int v; int w;};
132 element* m_el;
133
134 ISignalPort* m_posA;
135 ISignalPort* m_posB;
136 ISignalPort* m_velA;
137 ISignalPort* m_velB;
138
139 ICommonComputation* m_calcDynamics;
140 Eigen::Matrix<double,Eigen::Dynamic,1> m_lambda;
141 Eigen::Matrix<double,Eigen::Dynamic,1> m_F;
142 //double* m_lambda;
143
144 double m_forceA[3];
145 double m_forceB[3];
146
147#ifdef FH_VISUALIZATION
148 Ogre::ManualObject* m_ManualObject;
149 //Ogre::SceneManager* m_SceneMgr;
150 double m_scale;
151 Ogre::SceneNode* m_ManualObjectNode;
152 // C3DLine* m_line; ///< white linestrip visualization object
153#endif
154 };
155}
Definition: C6DofCable.h:85
C6DofCable(const string &simObjectName, ISimObjectCreator *const creator)
reads parameters, registers states, output and intput ports.
Definition: C6DofCable.h:131