Marine systems simulation
MooringSystemCoribo3.h
1#pragma once
2
7#include <string>
8#include <algorithm>
9#include <iterator>
10
11#include "MooringSystemCoribo2.h"
12
13#include "./RingStructureGravityHydro.h"
14#include "./Cable/LineStructureGravityHydro.h"
15#include "./Cable/BridleCable.h"
16#include "./Cable/FrameCable.h"
17
18namespace Netcage {
20 public:
21 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 MooringSystemCoRiBo3(const std::string& name, ISimObjectCreator* const creator);
24
25 virtual void OdeFcn(const double T, const double *const X, double *const XDot, const bool IsMajorTimeStep);
26 virtual void InitialConditionSetup(const double, const double *const, double* const updatedIC, ISimObjectCreator* const);
27 virtual void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
28
29 virtual void compute(const double T, const double * const X);
30
31#ifdef FH_VISUALIZATION
32 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
33 virtual void RenderUpdate(const double T, const double* const X);
34#endif
35
36 virtual void PreOdeFcn(const double T, const double *const X, IStateUpdater* updater);
37 const double *forceFloater(const double T, const double * const X, int index);
38 protected:
39
41 CellExternalBridle(short _u, short _v) {
42 u = _u;
43 v = _v;
44 for (int i = 0; i < 12; i++) {
45 bridle[i] = nullptr;
46 floaterPos[i] = nullptr;
47 floaterVel[i] = nullptr;
48 bridleconstraint[i] = -1;
49 bufferQ[i][0] = 1;
50 for (int j = 0; j < 3; j++) {
51 bufferP[i][j] = std::numeric_limits<double>::quiet_NaN();
52 bufferV[i][j] = 0;
53 bufferO[i][j] = 0;
54 bufferF[i][j] = 0;
55 bufferQ[i][j+1] = 0;
56 }
57 }
58 }
59
60 void UpdateBuffersFromPorts(const double T, const double * const X) {
61 for (int i = 0; i < 12; i++) {
62 if ( bridle[i] == nullptr) continue;
63 auto pos = floaterPos[i]->GetPortValue(T, X);
64 auto vel = floaterVel[i]->GetPortValue(T, X);
65 for (int j = 0; j < 3; j++) {
66 bufferP[i][j] = pos[j];
67 bufferV[i][j] = vel[j];
68 }
69 }
70 }
71
72 unsigned short u, v;
73 BridleCable* bridle[12];
74 ISignalPort* floaterPos[12];
75 ISignalPort* floaterVel[12];
76 double bufferP[12][3];
77 double bufferV[12][3];
78 double bufferO[12][3];
79 double bufferQ[12][4];
80 double bufferF[12][3];
81 int bridleconstraint[12];
82 };
83 virtual void CreateCells(ISimObjectCreator* creator);
84 std::vector<CellExternalBridle*> m_cell;
85
86 ICommonComputation* m_compute3;
87
88 };
89}
Definition: BridleCable.h:8
Definition: MooringSystemCoribo2.h:16
Definition: MooringSystemCoribo3.h:19
Class modelling a Net cage.
Definition: CBottomRing.h:35
Definition: MooringSystemCoribo3.h:40