Marine systems simulation
TrawlCable.h
1#pragma once
2
90#include "ITrawlCable.h"
91//#include "ICollidableObject.h"
92//#include "ConstraintCableInterface.h"
93
94
95#ifdef FH_VISUALIZATION
96#include "sfh/ogre/C3DLine.h"
97#endif
98
99class TrawlCable : public SimObject, public ITrawlCable
100{
101public:
107 TrawlCable(const string& simObjectName, ISimObjectCreator* const creator);
108
113
118 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
119
123 void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
124
129 void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
130
131
132#ifdef FH_VISUALIZATION
133 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
134 void RenderUpdate( const double T, const double* const X);
135#endif
136
137 void Compute( const double T, const double *const X );
138 void AddDependency( ICommonComputation* dependecy );
139 CoRiBoDynamics::ConstraintSolver* GetConstraintSolver();
143 double getRegulatorTimeConstant();
144
145protected:
146 void MainCalculations(const double T, const double* const X);
147
148 struct element{int p; int q; int v; int w; int n;};
149 void DistributeCatenary(CoRiBoDynamics::vec3 P1, CoRiBoDynamics::vec3 P2, vector<element> elements, double L, double* states, int i1, int i2, ISimObjectCreator* creator);
150
151 CEnvironment* m_environment;
152
153 enum Chirality {PORT, STARBOARD};
154 Chirality m_Chirality;
155
156 double m_TrawlDoorMass;
157 double m_TrawlDoorArea;
158 double m_TrawlDoorLx;
159 double m_TrawlDoorLy;
160 double m_TrawlDoorLz;
161 CoRiBoDynamics::vec3 m_TrawlDoorWarpConnection;
162 CoRiBoDynamics::vec3 m_TrawlDoorTopBridleConnection;
163 CoRiBoDynamics::vec3 m_TrawlDoorBottomBridleConnection;
164
165 double m_ClumpWeightMass;
166 double m_ClumpWeightLength;
167 double m_ClumpWeightRadius;
168
169 int m_NumTopWarp;
170 double m_TopWarpLength;
171 double m_TopWarpElementLength;
172
173 int m_NumWarp;
176
180
184
187
191
193 //double m_collisionStiffness; /// Gamma value of contact constraint.
194
199
200 std::set<ICommonComputation*> m_ExternalDependencies;
201
202 ICommonComputation* m_MainCalculations;
203 ITrawlCable* m_ExtTrawlCable;
204
205 vector<element> m_TopWarpElements;
206 vector<element> m_WarpElements;
207 vector<element> m_TopBridleElements;
208 vector<element> m_BottomBridleElements;
209 element m_TrawlDoorElement;
210 element m_TrawlDoorWeightElement;
211
212 element m_ClumpWeightElement;
213
214 const double* winchForce(const double T, const double* const X);
215 double m_winchForce[3];
216 int m_WinchPointConnectionIndex;
217
218 const double* TopBridleEndForce( const double T, const double* const X );
219 double m_TopBridleEndForce[3];
220 int m_TopBridleEndPointConnectionIndex;
221
222 const double* BottomBridleEndForce( const double T, const double* const X );
223 double m_BottomBridleEndForce[3];
224 int m_BottomBridleEndPointConnectionIndex;
225
226 const double* trawlDoorPosition(const double T, const double* const X);
227
228
229 ICommonComputation* m_ContactForceCalculations;
230 void ContactForceCalculations(const double T, const double* const X);
231 const double* normalForceTrawlDoor(const double T, const double* const X);
232 const double* normalForceClumpWeight(const double T, const double* const X);
233 const double* normalForceTopBridle(const double T, const double* const X);
234 const double* normalForceBottomBridle(const double T, const double* const X);
235 const double* normalForceWarp(const double T, const double* const X);
236 const double* contactPositionTopBridle(const double T, const double* const X);
237 const double* contactPositionBottomBridle(const double T, const double* const X);
238 const double* contactPositionWarp(const double T, const double* const X);
239 double m_normalForceTrawlDoor[1];
240 double m_normalForceClumpWeight[1];
241 double m_normalForceTopBridle[3];
242 double m_normalForceBottomBridle[3];
243 double m_normalForceWarp[3];
244
245 ISignalPort* m_WinchPosition;
246 ISignalPort* m_WinchVelocity;
247
248 ISignalPort* m_TopBridleEndPosition;
249 ISignalPort* m_TopBridleEndVelocity;
250
251 ISignalPort* m_BottomBridleEndPosition;
252 ISignalPort* m_BottomBridleEndVelocity;
253
254#ifdef FH_VISUALIZATION
255 bool m_HQ_Render;
256 Ogre::SceneNode** m_TopWarpNodes;
257 Ogre::SceneNode** m_WarpNodes;
258 Ogre::SceneNode** m_TopBridleNodes;
259 Ogre::SceneNode** m_BottomBridleNodes;
260 Ogre::SceneNode* m_TrawlDoorNode;
261 Ogre::SceneNode* m_ClumpWeightNode;
262 C3DLine* m_TopWarpLine;
263 C3DLine* m_WarpLine;
264 C3DLine* m_TopBridleLine;
265 C3DLine* m_BottomBridleLine;
266#endif
267};
Definition: CEnvironment.h:10
Definition: ConstraintSolver.h:31
Definition: TrawlCableConstraintSets.h:116
Definition: TrawlCableConstraintSets.h:70
Definition: TrawlCableConstraintSets.h:10
Definition: ITrawlCable.h:17
Definition: TrawlCable.h:100
double m_CollisionFrequencyCoefficient
Frequency response coefficient.
Definition: TrawlCable.h:186
double m_TopBridleLength
Warp cable length.
Definition: TrawlCable.h:182
double m_WarpLength
Nominal cable diameter.
Definition: TrawlCable.h:181
void InitialConditionSetup(const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
double m_frequencyCoefficient
Bridle cable length.
Definition: TrawlCable.h:185
CoRiBoDynamics::TrawlCableJointConstraint * m_JointConstraint
collision constraints
Definition: TrawlCable.h:197
double m_TopBridleDiameter
Nominal cable diameter.
Definition: TrawlCable.h:178
double m_BottomBridleElementLength
Length of discrete cable elements.
Definition: TrawlCable.h:190
CoRiBoDynamics::TrawlCableCollisionManager * m_CollisionManager
6dof rigid body constrained dynamic solver
Definition: TrawlCable.h:196
CoRiBoDynamics::TrawlCableCollisionManager * GetCollisionManager()
6dof rigid body constrained dynamic solver
int m_NumTopBridle
The number of discrete cable elements in the warp.
Definition: TrawlCable.h:174
double m_BottomBridleDiameter
Nominal cable diameter.
Definition: TrawlCable.h:179
CoRiBoDynamics::EnvironmentForces * GetEnvironmentForces()
structural joint constraints
double m_WarpElementLength
Frequency response coefficient.
Definition: TrawlCable.h:188
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
CoRiBoDynamics::TrawlCableJointConstraint * GetJointConstraint()
collision constraints
TrawlCable(const string &simObjectName, ISimObjectCreator *const creator)
double m_WarpDiameter
The number of discrete cable elements int the lower bridle.
Definition: TrawlCable.h:177
double m_BottomBridleLength
Bridle cable length.
Definition: TrawlCable.h:183
double m_collisionDampingFactor
Length of discrete cable elements.
Definition: TrawlCable.h:192
int m_NumBottomBridle
The number of discrete cable elements in the top bridle.
Definition: TrawlCable.h:175
CoRiBoDynamics::EnvironmentForces * m_environmentForces
structural joint constraints
Definition: TrawlCable.h:198
double m_TopBridleElementLength
Length of discrete cable elements.
Definition: TrawlCable.h:189
ICommonComputation * m_MainCalculations
list of all (unique) CommonComputation nodes that have registered external geometry in the cable coll...
Definition: TrawlCable.h:202
void FinalSetup(const double T, const double *const X, ISimObjectCreator *const creator)
CoRiBoDynamics::ConstraintSolver * m_ConstraintSolver
Relative damping coefficient of contact constraint. 1 is critical damping.
Definition: TrawlCable.h:195
Definition: TrawlCable.h:148