Marine systems simulation
RundDorg.h
1#pragma once
89//#include "ITrawlCable.h"
90//#include "ICollidableObject.h"
91//#include "ConstraintCableInterface.h"
92#include "SimObject.h"
93#include "eigen_matrix_defs.h"
94#include "TrawlCableConstraintSets.h"
95
96#ifdef FH_VISUALIZATION
97#include "sfh/ogre/C3DLine.h"
98#endif
99
100class RundDorg : public SimObject//, public ITrawlCable
101{
102public:
108 RundDorg(const string& simObjectName, ISimObjectCreator* const creator);
109
114
119 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
120
124 void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
125
130 void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
131
132
133#ifdef FH_VISUALIZATION
134 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
135 void RenderUpdate( const double T, const double* const X);
136#endif
137
138protected:
139 void MainCalculations(const double T, const double* const X);
140
141 struct element{int p; int q; int v; int w; int n;};
142 void DistributeCatenary(CoRiBoDynamics::vec3 P1, CoRiBoDynamics::vec3 P2, vector<element> elements, double L, double* states, int i1, int i2, ISimObjectCreator* creator);
143
144 CEnvironment* m_environment;
145
146 enum Chirality {PORT, STARBOARD};
147 Chirality m_Chirality;
148
149 enum WeightType {FOIL, CLUMP};
150 WeightType m_WeightType;
151
152 double m_FoilMass;
153 double m_FoilArea;
154 double m_FoilLx;
155 double m_FoilLy;
156 double m_FoilLz;
157 CoRiBoDynamics::vec3 m_WeightMainConnection;
158 CoRiBoDynamics::vec3 m_WeightFishLine1Connection;
159 CoRiBoDynamics::vec3 m_WeightFishLine2Connection;
160
161 double m_ClumpWeightMass;
162 double m_ClumpWeightLength;
163 double m_ClumpWeightRadius;
164
165 int m_NumMain;
168
172
176
178
182
186
187 ICommonComputation* m_MainCalculations;
188
189 vector<element> m_MainElements;
190 vector<element> m_Line1Elements;
191 vector<element> m_Line2Elements;
192 element m_FoilElement;
193 element m_FoilWeightElement;
194 element m_ClumpWeightElement;
195
196 const double* MainForce(const double T, const double* const X);
197 double m_MainForce[3];
198 int m_MainForceConnectionIndex;
199
200 const double* Line1Force( const double T, const double* const X );
201 double m_Line1Force[3];
202 int m_Line1ConnectionIndex;
203
204 const double* Line2Force( const double T, const double* const X );
205 double m_Line2Force[3];
206 int m_Line2ConnectionIndex;
207
208 const double* WeightPosition(const double T, const double* const X);
209
210 /*const double* WeightMainForce( const double T, const double* const X );
211 double m_WeightMainForce[3];
212 const double* WeightLine1Force( const double T, const double* const X );
213 double m_WeightLine1Force[3];
214 const double* WeightLine2Force( const double T, const double* const X );
215 double m_WeightLine2Force[3];*/
216
217 ISignalPort* MainPosition;
218 ISignalPort* m_MainVelocity;
219
220 ISignalPort* m_Line1Position;
221 ISignalPort* m_Line1Velocity;
222
223 ISignalPort* m_Line2Position;
224 ISignalPort* m_Line2Velocity;
225
226#ifdef FH_VISUALIZATION
227 bool m_HQ_Render;
228 Ogre::SceneNode** m_MainNodes;
229 Ogre::SceneNode** m_Line1Nodes;
230 Ogre::SceneNode** m_Line2Nodes;
231 Ogre::SceneNode* m_WeightNode;
232 C3DLine* m_MainLine;
233 C3DLine* m_Line1Line;
234 C3DLine* m_Line2Line;
235#endif
236};
Definition: CEnvironment.h:10
Definition: ConstraintSolver.h:31
Definition: TrawlCableConstraintSets.h:116
Definition: TrawlCableConstraintSets.h:10
Definition: RundDorg.h:101
void FinalSetup(const double T, const double *const X, ISimObjectCreator *const creator)
int m_NumLine1
The number of discrete cable elements in the warp.
Definition: RundDorg.h:166
double m_MainDiameter
The number of discrete cable elements int the lower bridle.
Definition: RundDorg.h:169
CoRiBoDynamics::ConstraintSolver * m_ConstraintSolver
Length of discrete cable elements.
Definition: RundDorg.h:183
RundDorg(const string &simObjectName, ISimObjectCreator *const creator)
void InitialConditionSetup(const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
double m_Line2ElementLength
Length of discrete cable elements.
Definition: RundDorg.h:181
double m_Line1ElementLength
Length of discrete cable elements.
Definition: RundDorg.h:180
CoRiBoDynamics::TrawlCableJointConstraint * m_JointConstraint
6dof rigid body constrained dynamic solver
Definition: RundDorg.h:184
CoRiBoDynamics::EnvironmentForces * m_environmentForces
structural joint constraints
Definition: RundDorg.h:185
double m_MainElementLength
Frequency response coefficient.
Definition: RundDorg.h:179
double m_frequencyCoefficient
Bridle cable length.
Definition: RundDorg.h:177
double m_Line1Diameter
Nominal cable diameter.
Definition: RundDorg.h:170
int m_NumLine2
The number of discrete cable elements in the top bridle.
Definition: RundDorg.h:167
double m_Line2Length
Bridle cable length.
Definition: RundDorg.h:175
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
double m_Line2Diameter
Nominal cable diameter.
Definition: RundDorg.h:171
double m_MainLength
Nominal cable diameter.
Definition: RundDorg.h:173
double m_Line1Length
Warp cable length.
Definition: RundDorg.h:174
Definition: RundDorg.h:141