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