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 <vector>
16#include "CommonTypes.h"
17#include "NetCableElementSpec.h"
18#include "NetElementDef.h"
19#include <fhsim/InputReader.h>
20#include <fhsim/ISimObjectLogger.h>
21
24{
25 double maxCableTension;
26 double maxStepLength;
27 double meanCableTension;
28 double minCableLength;
29 double stepSafetyFactor;
30 double adaptationPeriod;
31 double massFactor;
32 double maxVelocity;
33 double addedDragPerMPS;
34};
35
36
37//Class definition
39{
40public:
42 NetStructureSpec(ISimObjectLogger *logger);
45
46 virtual void FromFile(std::string fileName, std::string filePath);
47 void FromBinaryFile(std::string fileName, std::string filePath);
53 bool FromNetSpec(const std::string& specPath);
58 std::vector<std::string> DefaultNodes(const std::string& parameter) const;
59 int CreateExternalNodeMap(std::vector<std::string> VsInputNodes, VSPairStrInt& VsNodes);
60 int GetNumNodesCalc(){return m_numNodesCalc;}
61 int GetNumNodesOriginal(){return m_numNodesOriginal;}
62 std::vector<const NetElementDef*> GetNetPanels(){return m_VSPanelData;}
63 std::vector<const NetCableElementSpec*> GetCableElements(){return m_VCableElements;}
64 SAdaptationSpec_t GetAdaptationSpec() {return m_SAdaptationSpec;}
65
66 bool GetCatsRefinementMode();
67 void PrintInfo();
68
69protected:
71 virtual void ReadInput(InputReader& FileReader, ISimObjectLogger* logger);
74 virtual void ReadBinaryInputFile(std::string fileName, std::string filePath, ISimObjectLogger* logger);
75 void FindNodesToDivide(int nodesToDivide[2], double *length, double *lengthFactor);
76 void RefineMesh();
77 void RefineMesh2();
78
79 void CheckNodeNumber(int nodeNumber, ISimObjectLogger *const logger, std::string nodeDescription = "");
80 void CheckNodes(ISimObjectLogger *logger);
81 unsigned short AddCalcNode(int aiNodes[2]);
82 unsigned short DivideCableElement(int CableNum );
83
84 // Calculation variables
89
90 std::vector<const NetElementDef*> m_VSPanelData;
91 std::vector<const NetCableElementSpec*> m_VCableElements;
92
93 // Variables for controlling the calculation mesh refinement.
100 double m_scale;
101
102 std::string m_netName;
103 VSPairStrInt m_VsNodesAvailable;
104
106
107 std::vector<std::string> m_defaultNodesInputForce;
108 std::vector<std::string> m_defaultNodesOutputPosAndVel;
109
110 static int s_iID;
111 int m_iD;
112 ISimObjectLogger* m_logger;
113};
114
115
116#endif
117
Definition NetStructureSpec.h:39
int m_numNodesCalc
The number of nodes of the net after refinement.
Definition NetStructureSpec.h:88
double m_maxSideLengthFactor
The maximum element side length factor.
Definition NetStructureSpec.h:95
int m_numNodesOriginal
The number of original nodes of the net.
Definition NetStructureSpec.h:87
void CheckAndRefine()
Checks the node numbers and refines the mesh of the net just read.
std::vector< const NetCableElementSpec * > m_VCableElements
A vector of structs containing the cable data read from the input file.
Definition NetStructureSpec.h:91
int m_numCablesCalc
The number of elements the cable is divided into.
Definition NetStructureSpec.h:86
VSPairStrInt m_VsNodesAvailable
The tag names and indices of the available external nodes.
Definition NetStructureSpec.h:103
int m_maxNumPanels
The maximum number of net panels used for the calculations.
Definition NetStructureSpec.h:98
virtual void ReadInput(InputReader &FileReader, ISimObjectLogger *logger)
Reads a <Net> document, from a file or from text.
SAdaptationSpec_t m_SAdaptationSpec
A struct containing adaptations for faster integration of the net structure.
Definition NetStructureSpec.h:105
int m_foldingPointRefinement
refinement by folding points on each cable (Cats mode)
Definition NetStructureSpec.h:94
virtual ~NetStructureSpec()
The destructor deletes dynamically allocated memory.
int m_maxNumCables
The maximum number of cable elements used for the calculations.
Definition NetStructureSpec.h:99
int m_numPanelsCalc
The number of elements the net is divided into.
Definition NetStructureSpec.h:85
double m_minSideLength
The side length limit for the elements to be further subdivided.
Definition NetStructureSpec.h:96
std::vector< std::string > m_defaultNodesOutputPosAndVel
DefaultNodes("NodesOutputPosAndVel").
Definition NetStructureSpec.h:108
NetStructureSpec(ISimObjectLogger *logger)
The constructor sets the pointer to the output object and the parser object.
std::vector< std::string > m_defaultNodesInputForce
DefaultNodes("NodesInputForce").
Definition NetStructureSpec.h:107
double m_scale
The scale of the trawl net in relation to the specifications.
Definition NetStructureSpec.h:100
std::vector< std::string > DefaultNodes(const std::string &parameter) const
bool FromNetSpec(const std::string &specPath)
int m_maxNumNodes
The maximum number of nodes used for net calculations.
Definition NetStructureSpec.h:97
std::vector< const NetElementDef * > m_VSPanelData
A vector of structs containing the section data read from the input file.
Definition NetStructureSpec.h:90
std::string m_netName
The identification name of the net.
Definition NetStructureSpec.h:102
Class containing the specification for a net object.
Definition NetStructureSpec.h:24