FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
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 conn;
58 sfh::linalg::Vec2 SMeshPos;
59
61 {
62 conn = -1;
63 }
64
65 SNetNode_t(double xPos, double yPos, unsigned long connection = (unsigned long) -1)
66 {
67 conn = connection;
68 SMeshPos.x = xPos;
69 SMeshPos.y = yPos;
70 }
71
72 SNetNode_t(const sfh::linalg::Vec2 SMeshPosition, unsigned long connection = (unsigned long) -1)
73 {
74 conn = connection;
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
146 double GetThreadArea() const
147 {
148 return 2 * (Cutting.T1 + Cutting.T2) * Cutting.N * Bar.L * Bar.D;
149 }
150 };
151
152
153 enum ESectionSide_t
154 {
155 SectionSide_Front = 0,
156 SectionSide_Back,
157 SectionSide_Outer,
158 SectionSide_Inner,
159 SectionSide_T3,
160 SectionSide_Upper,
161 SectionSide_Lower
162 };
163
164 enum ESectionNode_t
165 {
166 SectionNode_FRONTPRT = 0,
167 SectionNode_FRONTSTB,
168 SectionNode_FRONTCENTER,
169 SectionNode_FRONTPRTWING,
170 SectionNode_FRONTSTBWING,
171 SectionNode_BACKPRT,
172 SectionNode_BACKSTB,
173 SectionNode_BACKCENTER,
174 SectionNode_NUM
175 };
176
177 enum EPanelEdge_t
178 {
179 Paneledge_DEFAULT = 0 ,
180 Paneledge_OTHER ,
181 Paneledge_PRT = Paneledge_DEFAULT ,
182 Paneledge_STB = Paneledge_OTHER ,
183 Paneledge_UPPER = Paneledge_DEFAULT ,
184 Paneledge_LOWER = Paneledge_OTHER ,
185 };
186
187 enum EPanel_t
188 {
189 PANEL_UPPER = 0,
190 PANEL_LOWER,
191 PANEL_PRTSIDE,
192 PANEL_STBSIDE,
193 PANEL_SIDE = PANEL_PRTSIDE,
194 };
195
196 enum EPanelNodes
197 {
198 PanelNodes_PRT = 0,
199 PanelNodes_STB,
200 PanelNodes_CENTER,
201 PanelNodes_PRTWING,
202 PanelNodes_STBWING,
203 PanelNodes_NUMPANELS,
204 PanelNodes_UPPER = PanelNodes_PRT,
205 PanelNodes_LOWER = PanelNodes_STB,
206 PanelNodes_UPPERWING = PanelNodes_PRTWING,
207 PanelNodes_LOWERWING = PanelNodes_STBWING,
208 };
209
210
211 enum ESectionType_t
212 {
213 SECTIONTYPE_WING, // A wing section.
214 SECTIONTYPE_BELLY, // A belly section not connected to wings.
215 SECTIONTYPE_SPLITTER, // A Belly section connected to two wings.
216 };
217
219 {
220 EPanel_t PanelType;
221 ESectionType_t SectionType;
222 int SectionNumber;
223 };
224
226 {
228 {
229 sectionNum = 0;
230 panel = PANEL_UPPER;
231 side = SectionSide_Front;
232 }
233 int sectionNum;
234 EPanel_t panel;
235 ESectionSide_t side;
236 };
237
239 {
240 int sectionNum;
241 EPanel_t panel;
242 ESectionSide_t side;
243 double L;
244 double D;
245 double E;
246 double rho;
247 int nodes[2];
248
249 };
250
252 {
253 TrawlSpec::EPanel_t Panel;
254 TrawlSpec::EPanelNodes NodePlacement;
255 int Section;
256 SNodeSpec(TrawlSpec::EPanel_t PanelIn, TrawlSpec::EPanelNodes NodePlacementIn, int SectionIn)
257 {
258 Panel = PanelIn;
259 NodePlacement = NodePlacementIn;
260 Section = SectionIn;
261 }
262 };
263 struct SPosXY
264 {
265 double x;
266 double y;
267 };
268
269
271 {
284 std::vector<std::vector<int> > VViPanelNodes;
285 //std::vector<std::vector<SPosXY> > VVSPanelNodePos;
286 std::vector<std::vector<SPosXY> > VVSectionNodePos;
287
288 bool frontElementIsTriangular;
289 bool aftElementIsTriangular;
290 //int numConnectedNodes;
291 //int aftSection;
293 {
294 VViPanelNodes.resize(5);
295 }
296 void Reset()
297 {
298 for (int i = 0; i < 5; i++)
299 {
300 VViPanelNodes[i].clear();
301 }
302 frontElementIsTriangular = false;
303 aftElementIsTriangular = false;
304 VVSectionNodePos.clear();
305 //numConnectedNodes = 0;
306 //aftSection = 0;
307 }
308 };
309}
310
311#endif
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NTrawlSpec.h:12
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
double GetThreadArea() const
Definition NTrawlSpec.h:146
Definition NTrawlSpec.h:252
Definition NTrawlSpec.h:95
Definition NTrawlSpec.h:271
std::vector< std::vector< int > > VViPanelNodes
Definition NTrawlSpec.h:284
Definition NTrawlSpec.h:264
Definition NTrawlSpec.h:239
Definition NTrawlSpec.h:226
Definition NTrawlSpec.h:219