Marine systems simulation
CScreenStructureSpec.h
1
9
10
11#ifndef CScreenStructureSpec_H
12#define CScreenStructureSpec_H
13
14// Includes
15#include <string>
16#include "CNetCableElementSpec.h"
17#include "CNetStructureSpec.h"
18#include "CScreenElementDef.h"
19#include "CInputReader.h"
20#include "ISimObjectLogger.h"
21
23/*
24struct SAdaptationSpec_t
25{
26 double dMaxCableTension;
27 double dMaxStepLength;
28 double dMeanCableTension;
29 double dMinCableLength;
30 double dStepSafetyFactor;
31 double dAdaptationPeriod;
32 double dMassFactor;
33 double dMaxAcceleration;
34 double dMaxVelocity;
35 double dAddedDragPerMPS;
36};
37*/
38
39
40//Class definition
42{
43public:
45 CScreenStructureSpec(ISimObjectLogger *pLogger);
48
49 virtual void FromFile(std::string sFileName, std::string sFilePath);
50 void FromBinaryFile(std::string sFileName, std::string sFilePath);
51 int CreateExternalNodeMap(std::vector<std::string> VsInputNodes, VSPairStrInt& VsNodes);
52 int GetNumNodesCalc(){return m_iNumNodesCalc;}
53 int GetNumNodesOriginal(){return m_iNumNodesOriginal;}
54 std::vector<const CScreenElementDef*> GetNetPanels(){return m_VSScreenData;}
55 std::vector<const CScreenElementDef*> GetNetScreens(){return m_VSScreenData;}
56 std::vector<const CNetCableElementSpec*> 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 sFileName, std::string sFilePath, ISimObjectLogger* pLogger);
64 virtual void ReadBinaryInputFile(std::string sFileName, std::string sFilePath, ISimObjectLogger* pLogger);
65 void FindNodesToDivide(int iNodesToDivide[2], double *dLength, double *dLengthFactor);
66 void RefineMesh();
67 void RefineMesh2();
68
69 void CheckNodeNumber(int iNodeNumber, ISimObjectLogger *const pLogger, std::string sNodeDescription = "");
70 void CheckNodes(ISimObjectLogger *pLogger);
71 unsigned short AddCalcNode(int aiNodes[2]);
72 unsigned short DivideCableElement(int CableNum );
73
74 // Calculation variables
79
80 //std::vector<const CScreenElementDef*> m_VSPanelData; ///< A vector of structs containing the section data read from the input file.
81 std::vector<const CScreenElementDef*> m_VSScreenData;
82 std::vector<const CNetCableElementSpec*> m_VCableElements;
83
84 // Variables for controlling the calculation mesh refinement.
91 double m_dScale;
92
93 std::string m_sNetName;
94 VSPairStrInt m_VsNodesAvailable;
95
97
98 static int s_iID;
99 int m_iID;
100 ISimObjectLogger* m_pLogger;
101};
102
103
104#endif
105
Definition: CNetStructureSpec.h:38
Class containing the specification for a net object.
Definition: CScreenStructureSpec.h:42
int m_iNumNodesOriginal
The number of original nodes of the net.
Definition: CScreenStructureSpec.h:77
std::vector< const CNetCableElementSpec * > m_VCableElements
A vector of structs containing the cable data read from the input file.
Definition: CScreenStructureSpec.h:82
std::vector< const CScreenElementDef * > m_VSScreenData
A vector of structs containing the net screen data read from the input file.
Definition: CScreenStructureSpec.h:81
CScreenStructureSpec(ISimObjectLogger *pLogger)
The constructor sets the pointer to the output object and the parser object.
int m_iNumNodesCalc
The number of nodes of the net after refinement.
Definition: CScreenStructureSpec.h:78
int m_iMaxNumCables
The maximum number of cable elements used for the calculations.
Definition: CScreenStructureSpec.h:90
int m_iNumCablesCalc
The number of elements the cable is divided into.
Definition: CScreenStructureSpec.h:76
double m_dMaxSideLengthFactor
The maximum element side length factor.
Definition: CScreenStructureSpec.h:86
int m_iNumPanelsCalc
The number of elements the net is divided into.
Definition: CScreenStructureSpec.h:75
int m_iMaxNumPanels
The maximum number of net panels used for the calculations.
Definition: CScreenStructureSpec.h:89
int m_iMaxNumNodes
The maximum number of nodes used for net calculations.
Definition: CScreenStructureSpec.h:88
int m_iFoldingPointRefinement
refinement by folding points on each cable (Cats mode)
Definition: CScreenStructureSpec.h:85
std::string m_sNetName
The identification name of the net.
Definition: CScreenStructureSpec.h:93
SAdaptationSpec_t m_SAdaptationSpec
A struct containing adaptations for faster integration of the net structure.
Definition: CScreenStructureSpec.h:96
virtual ~CScreenStructureSpec()
The destructor deletes dynamically allocated memory.
double m_dMinSideLength
The side length limit for the elements to be further subdivided.
Definition: CScreenStructureSpec.h:87
double m_dScale
The scale of the trawl net in relation to the specifications.
Definition: CScreenStructureSpec.h:91
VSPairStrInt m_VsNodesAvailable
The tag names and indices of the available external nodes.
Definition: CScreenStructureSpec.h:94
Class containing the specification for a net object.
Definition: CNetStructureSpec.h:22