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