FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ScreenElementDef.h
1
11#pragma once
12#ifndef CScreenElementDef_H
13#define CScreenElementDef_H
14
15// Includes
16#include "SNetSectionData.h"
17#include "NetElementDef.h"
18#include <fhsim/Exceptions.h>
19//#include <fhsim/PrintDuringExec.h>
20//Class definition
21
23{
24public:
25 enum NodePosition
26 {
27 NODE_ON_EDGE_AB = 100,
28 NODE_ON_EDGE_BC = 101,
29 NODE_ON_EDGE_CA = 102,
30 NODE_NOT_ON_EDGE = -100
31 };
32
33 double refineFactor;
35
38
40 bool Divide(int aiNodes[2], int newNode, int newElementID, ScreenElementDef** ppSNewPanel);
41
43 bool Panel2Triangles(int newElementID, ScreenElementDef* sNewPanel);
44
46 bool Check() const;
47
49 double CalcEdgeLength(int edgeIndex) const;
50
52 unsigned short FindLongestEdge() const;
53
55 double CalcLongestEdge() const;
56
58 double CalcLengthFactor() const;
59
61 bool PanelEdge2Nodes(unsigned short edge, int aiNodes[2]) const;
62
64 double FindLongestEdge(int aiNodes[2]) const;
65
66 void DivideEdge(int newNode, int newElementID, ScreenElementDef* sNewPanel, int nodeNoOldPanel, int nodeNoNewPanel, double divideAtDistance=0.5);
67
68 NodePosition NodesDefineEdge(int aiNodes[2]);
69
70private:
71 bool Test(bool bOk, std::string message) const;
72 bool Test(int iIn1, int iIn2, bool shouldBeEqual, std::string sArg1) const;
73 bool Test(double dIn1, double dIn2, bool shouldBeEqual, std::string sArg1) const;
74 bool Test(std::string sIn1, std::string sIn2, bool shouldBeEqual, std::string sArg1) const;
75
76};
77#endif
Class containing the description of a net panel and methods necessary for taking this over to triangu...
Definition NetElementDef.h:22
Definition ScreenElementDef.h:23
bool PanelEdge2Nodes(unsigned short edge, int aiNodes[2]) const
Finds the global nodes connected to the specified edge.
bool Check() const
Does the initialization and checking to make sure that the panel is ready for simulation.
unsigned short FindLongestEdge() const
Finds the longest edge of the panel.
double CalcLengthFactor() const
Calculates the largest length factor of the panel.
double CalcEdgeLength(int edgeIndex) const
Calculates the length of the specified edge.
double FindLongestEdge(int aiNodes[2]) const
Finds the nodes connected to the longest edge of the panel.
bool Panel2Triangles(int newElementID, ScreenElementDef *sNewPanel)
Divides the panel in two triangular ones, if the panel is quadrangular.
double CalcLongestEdge() const
Calculates the longest edge length of the panel.
double refineFactor
The refine factor of the panel.
Definition ScreenElementDef.h:33
ScreenElementDef()
Constructor.
bool Divide(int aiNodes[2], int newNode, int newElementID, ScreenElementDef **ppSNewPanel)
Divides the panel in two, if the panel has an edge between the two provided nodes.
Definition NTrawlSpec.h:217