FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ScreenStructureSpec.h
1
9
10
11#ifndef CScreenStructureSpec_H
12#define CScreenStructureSpec_H
13
14// Includes
15#include <string>
16#include "NetCableElementSpec.h"
17#include "NetStructureSpec.h"
18#include "ScreenElementDef.h"
19#include <fhsim/InputReader.h>
20#include <fhsim/ISimObjectLogger.h>
21
23/*
24struct SAdaptationSpec_t
25{
26 double maxCableTension;
27 double maxStepLength;
28 double meanCableTension;
29 double minCableLength;
30 double stepSafetyFactor;
31 double adaptationPeriod;
32 double massFactor;
33 double maxAcceleration;
34 double maxVelocity;
35 double addedDragPerMPS;
36};
37*/
38
39
40//Class definition
42{
43public:
45 ScreenStructureSpec(ISimObjectLogger *logger);
48
49 virtual void FromFile(std::string fileName, std::string filePath);
50 void FromBinaryFile(std::string fileName, std::string filePath);
51 int CreateExternalNodeMap(std::vector<std::string> VsInputNodes, VSPairStrInt& VsNodes);
52 int GetNumNodesCalc(){return m_numNodesCalc;}
53 int GetNumNodesOriginal(){return m_numNodesOriginal;}
54 std::vector<const ScreenElementDef*> GetNetPanels(){return m_VSScreenData;}
55 std::vector<const ScreenElementDef*> GetNetScreens(){return m_VSScreenData;}
56 std::vector<const NetCableElementSpec*> GetCableElements(){return m_VCableElements;}
57 SAdaptationSpec_t GetAdaptationSpec() {return m_SAdaptationSpec;}
58
59 bool GetCatsRefinementMode();
60 void PrintInfo();
61
62protected:
63 virtual void ReadInputFile(std::string fileName, std::string filePath, ISimObjectLogger* logger);
64 virtual void ReadBinaryInputFile(std::string fileName, std::string filePath, ISimObjectLogger* logger);
65 void FindNodesToDivide(int nodesToDivide[2], double *length, double *lengthFactor);
66 void RefineMesh();
67 void RefineMesh2();
68
69 void CheckNodeNumber(int nodeNumber, ISimObjectLogger *const logger, std::string nodeDescription = "");
70 void CheckNodes(ISimObjectLogger *logger);
71 unsigned short AddCalcNode(int aiNodes[2]);
72 unsigned short DivideCableElement(int CableNum );
73
74 // Calculation variables
79
80 //std::vector<const ScreenElementDef*> m_VSPanelData; ///< A vector of structs containing the section data read from the input file.
81 std::vector<const ScreenElementDef*> m_VSScreenData;
82 std::vector<const NetCableElementSpec*> m_VCableElements;
83
84 // Variables for controlling the calculation mesh refinement.
91 double m_scale;
92
93 std::string m_netName;
94 VSPairStrInt m_VsNodesAvailable;
95
97
98 static int s_iID;
99 int m_iD;
100 ISimObjectLogger* m_logger;
101};
102
103
104#endif
105
Definition NetStructureSpec.h:38
Class containing the specification for a net object.
Definition ScreenStructureSpec.h:42
int m_maxNumCables
The maximum number of cable elements used for the calculations.
Definition ScreenStructureSpec.h:90
virtual ~ScreenStructureSpec()
The destructor deletes dynamically allocated memory.
int m_foldingPointRefinement
refinement by folding points on each cable (Cats mode)
Definition ScreenStructureSpec.h:85
std::vector< const ScreenElementDef * > m_VSScreenData
A vector of structs containing the net screen data read from the input file.
Definition ScreenStructureSpec.h:81
int m_maxNumNodes
The maximum number of nodes used for net calculations.
Definition ScreenStructureSpec.h:88
SAdaptationSpec_t m_SAdaptationSpec
A struct containing adaptations for faster integration of the net structure.
Definition ScreenStructureSpec.h:96
ScreenStructureSpec(ISimObjectLogger *logger)
The constructor sets the pointer to the output object and the parser object.
int m_numNodesOriginal
The number of original nodes of the net.
Definition ScreenStructureSpec.h:77
double m_scale
The scale of the trawl net in relation to the specifications.
Definition ScreenStructureSpec.h:91
int m_numNodesCalc
The number of nodes of the net after refinement.
Definition ScreenStructureSpec.h:78
int m_numCablesCalc
The number of elements the cable is divided into.
Definition ScreenStructureSpec.h:76
int m_maxNumPanels
The maximum number of net panels used for the calculations.
Definition ScreenStructureSpec.h:89
VSPairStrInt m_VsNodesAvailable
The tag names and indices of the available external nodes.
Definition ScreenStructureSpec.h:94
double m_maxSideLengthFactor
The maximum element side length factor.
Definition ScreenStructureSpec.h:86
std::string m_netName
The identification name of the net.
Definition ScreenStructureSpec.h:93
std::vector< const NetCableElementSpec * > m_VCableElements
A vector of structs containing the cable data read from the input file.
Definition ScreenStructureSpec.h:82
double m_minSideLength
The side length limit for the elements to be further subdivided.
Definition ScreenStructureSpec.h:87
int m_numPanelsCalc
The number of elements the net is divided into.
Definition ScreenStructureSpec.h:75
Class containing the specification for a net object.
Definition NetStructureSpec.h:22