Marine systems simulation
NTrawlSpec.h
1#ifndef N_TRAWL_SPEC_H
2#define N_TRAWL_SPEC_H
3
4#include <vector>
5//"
6#include <sfh/linalg.h>
7
8#ifdef FH_VISUALIZATION
9 #include "OgreColourValue.h"
10#endif
11namespace TrawlSpec
12{
13
14 enum EBottomContact
15 {
16 BottomContact_ForceP = 0,
17 BottomContact_ForceS,
18 BottomContact_ForceC,
19 BottomContact_DistanceP,
20 BottomContact_DistanceS,
21 BottomContact_DistanceC
22 };
23
24 enum ENetExternalNodes_t
25 {
26 NetExternalNodes_Wing1 = 0,
27 NetExternalNodes_Wing2,
28 NetExternalNodes_Wing3,
29 NetExternalNodes_Wing4,
30 NetExternalNodes_Wing5,
31 NetExternalNodes_Wing6,
32 NetExternalNodes_Wing7,
33 NetExternalNodes_Wing8,
34 NetExternalNodes_HeadlineSide,
35 NetExternalNodes_HeadlineC,
36 NetExternalNodes_FishlineSide,
37 NetExternalNodes_FishlineC,
38 NetExternalNodes_Codend,
39 NetExternalNodes_NumNodes,
40 };
41
43 {
44 std::vector<int> ViPrtNodes;
45 std::vector<int> ViStbNodes;
46 void Reset()
47 {
48 ViPrtNodes.clear();
49 ViStbNodes.clear();
50 ViPrtNodes.resize(NetExternalNodes_NumNodes);
51 ViStbNodes.resize(NetExternalNodes_NumNodes);
52 };
53 };
54
56 {
57 int iConn;
58 sfh::linalg::Vec2 SMeshPos;
59
61 {
62 iConn = -1;
63 }
64
65 SNetNode_t(double xPos, double yPos, unsigned long iConnection = (unsigned long) -1)
66 {
67 iConn = iConnection;
68 SMeshPos.x = xPos;
69 SMeshPos.y = yPos;
70 }
71
72 SNetNode_t(const sfh::linalg::Vec2 SMeshPosition, unsigned long iConnection = (unsigned long) -1)
73 {
74 iConn = iConnection;
75 SMeshPos = SMeshPosition;
76 }
77 };
78 struct SMeshBar
79 {
80 double D;
81 double L;
82 double E;
83 double Rho;
84
85 SMeshBar(double diam = 0, double length = 0, double stiffness = 0, double rho = 0)
86 {
87 D = diam;
88 L = length;
89 E = stiffness;
90 Rho = rho;
91 }
92 };
93
94 struct SPanelCut
95 {
96 double N;
97 double T1;
98 double T2;
99 double T3;
100 double cutN;
101 double cutB;
102 double cutT;
103
104 void Reset()
105 {
106 N = 0;
107 T1 = 0;
108 T2 = 0;
109 T3 = -1;
110 cutN = 0;
111 cutB = 0;
112 cutT = 0;
113 }
114 SPanelCut(double N_in = 0, double T1_in = 0, double T2_in = 0, double T3_in = -1,
115 double cutN_in = 0, double cutB_in = 0, double cutT_in = 0)
116 {
117 N = N_in;
118 T1 = T1_in;
119 T2 = T2_in;
120 T3 = T3_in;
121 cutN = cutN_in;
122 cutB = cutB_in;
123 cutT = cutT_in;
124 }
125 };
126
128 {
129 int ID;
130 SMeshBar Bar;
131 SPanelCut Cutting;
132 double reinforcementRatio;
133 double refineFactor;
135#ifdef FH_VISUALIZATION
136 Ogre::ColourValue twineColour;
137#endif
138
140 {
141 IsOtherWing = false;
142 }
143
144 double GetThreadArea() const
145 {
146 return (Cutting.T1 + Cutting.T2) * Cutting.N * Bar.L * Bar.D; // The knots should *maybe* be accounted for.
147 }
148 };
149
150
151 enum ESectionSide_t
152 {
153 SectionSide_Front = 0,
154 SectionSide_Back,
155 SectionSide_Outer,
156 SectionSide_Inner,
157 SectionSide_T3,
158 SectionSide_Upper,
159 SectionSide_Lower
160 };
161
162 enum ESectionNode_t
163 {
164 SectionNode_FRONTPRT = 0,
165 SectionNode_FRONTSTB,
166 SectionNode_FRONTCENTER,
167 SectionNode_FRONTPRTWING,
168 SectionNode_FRONTSTBWING,
169 SectionNode_BACKPRT,
170 SectionNode_BACKSTB,
171 SectionNode_BACKCENTER,
172 SectionNode_NUM
173 };
174
175 enum EPanelEdge_t
176 {
177 Paneledge_DEFAULT = 0 ,
178 Paneledge_OTHER ,
179 Paneledge_PRT = Paneledge_DEFAULT ,
180 Paneledge_STB = Paneledge_OTHER ,
181 Paneledge_UPPER = Paneledge_DEFAULT ,
182 Paneledge_LOWER = Paneledge_OTHER ,
183 };
184
185 enum EPanel_t
186 {
187 PANEL_UPPER = 0,
188 PANEL_LOWER,
189 PANEL_PRTSIDE,
190 PANEL_STBSIDE,
191 PANEL_SIDE = PANEL_PRTSIDE,
192 };
193
194 enum EPanelNodes
195 {
196 PanelNodes_PRT = 0,
197 PanelNodes_STB,
198 PanelNodes_CENTER,
199 PanelNodes_PRTWING,
200 PanelNodes_STBWING,
201 PanelNodes_NUMPANELS,
202 PanelNodes_UPPER = PanelNodes_PRT,
203 PanelNodes_LOWER = PanelNodes_STB,
204 PanelNodes_UPPERWING = PanelNodes_PRTWING,
205 PanelNodes_LOWERWING = PanelNodes_STBWING,
206 };
207
208
209 enum ESectionType_t
210 {
211 SECTIONTYPE_WING, // A wing section.
212 SECTIONTYPE_BELLY, // A belly section not connected to wings.
213 SECTIONTYPE_SPLITTER, // A Belly section connected to two wings.
214 };
215
217 {
218 EPanel_t PanelType;
219 ESectionType_t SectionType;
220 int SectionNumber;
221 };
222
224 {
226 {
227 sectionNum = 0;
228 panel = PANEL_UPPER;
229 side = SectionSide_Front;
230 }
231 int sectionNum;
232 EPanel_t panel;
233 ESectionSide_t side;
234 };
235
237 {
238 int sectionNum;
239 EPanel_t panel;
240 ESectionSide_t side;
241 double L;
242 double D;
243 double E;
244 double rho;
245 int nodes[2];
246
247 };
248
250 {
251 TrawlSpec::EPanel_t Panel;
252 TrawlSpec::EPanelNodes NodePlacement;
253 int Section;
254 SNodeSpec(TrawlSpec::EPanel_t PanelIn, TrawlSpec::EPanelNodes NodePlacementIn, int SectionIn)
255 {
256 Panel = PanelIn;
257 NodePlacement = NodePlacementIn;
258 Section = SectionIn;
259 }
260 };
261 struct SPosXY
262 {
263 double x;
264 double y;
265 };
266
267
269 {
282 std::vector<std::vector<int> > VViPanelNodes;
283 //std::vector<std::vector<SPosXY> > VVSPanelNodePos;
284 std::vector<std::vector<SPosXY> > VVSectionNodePos;
285
286 bool bFrontElementIsTriangular;
287 bool bAftElementIsTriangular;
288 //int iNumConnectedNodes;
289 //int iAftSection;
291 {
292 VViPanelNodes.resize(5);
293 }
294 void Reset()
295 {
296 for (int i = 0; i < 5; i++)
297 {
298 VViPanelNodes[i].clear();
299 }
300 bFrontElementIsTriangular = false;
301 bAftElementIsTriangular = false;
302 VVSectionNodePos.clear();
303 //iNumConnectedNodes = 0;
304 //iAftSection = 0;
305 }
306 };
307}
308
309#endif
Definition: NTrawlSpec.h:79
Definition: NTrawlSpec.h:43
Definition: NTrawlSpec.h:56
Definition: NTrawlSpec.h:128
bool IsOtherWing
This signals that this wing is on the "other" side. Only used for not symmetric wings,...
Definition: NTrawlSpec.h:134
Definition: NTrawlSpec.h:250
Definition: NTrawlSpec.h:95
Definition: NTrawlSpec.h:269
std::vector< std::vector< int > > VViPanelNodes
Definition: NTrawlSpec.h:282
Definition: NTrawlSpec.h:262
Definition: NTrawlSpec.h:237
Definition: NTrawlSpec.h:224
Definition: NTrawlSpec.h:217