FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetStructureTestSpec.h
1#ifndef CNetStructureTestSpec_h__
2#define CNetStructureTestSpec_h__
3
4#include <string>
5#include <vector>
6#include <utility>
7
8#include "NetCableElementTestSpec.h"
9#include "NetTwineElementSpec.h"
10//#include "CNetMeshElementSpec.h"
11
12#include <fhsim/ISimObjectLogger.h>
13
14
16{
17public:
18 NetStructureTestSpec(ISimObjectLogger *logger);
20 {
21 for( size_t i=0; i < m_cableElements.size(); i++)
22 delete m_cableElements[i];
23 for( size_t i=0; i < m_twineElements.size(); i++ )
24 delete m_twineElements[i];
25 }
26
27 void FromBinaryFile(std::string fileName, std::string filePath);
28 void FromXmlFile(std::string fileName, std::string filePath);
29 int CreateExternalNodeMap(std::vector<std::string> VsInputNodes, std::vector<std::pair<std::string,int> >& VsNodes);
30 int GetNumNodesCalc(){return m_numNodesCalc;}
31 int GetNumNodesOriginal(){return m_numNodesOriginal;}
32 bool GetCatsRefinementMode(){ return m_foldingPointRefinement>0;}
33
34 std::vector< NetCableElementTestSpec*> GetCableElements(){return m_cableElements;}
35 std::vector<const NetTwineElementSpec*> GetTwineElements(){return m_twineElements;}
36 //std::vector<const CNetMeshElementSpec*> GetMeshElements(){return m_VMeshElements;}
37
38
39protected:
40 virtual void ReadBinaryInputFile(std::string fileName, std::string filePath, ISimObjectLogger* logger);
41 void RefineMesh();
42
43 void CheckNodeNumber(int nodeNumber, ISimObjectLogger *const logger, std::string nodeDescription = "");
44 void CheckNodes(ISimObjectLogger *logger);
45
46 unsigned short AddCalcNode(int aiNodes[2]);
47 unsigned short DivideCableElement(int cableNum );
48 unsigned short DivideTwineElement(int twineNum );
49 void ReadInputFile( std::string fileName, std::string filePath, ISimObjectLogger* m_logger );
50 // Calculation variables
56
57 std::vector< NetCableElementTestSpec*> m_cableElements;
58 std::vector<const NetTwineElementSpec*> m_twineElements;
59// std::vector<const CNetMeshElementSpec*> m_VMeshElements; ///< A vector of structs containing the cable data read from the input file.
60
61 // Variables for controlling the calculation mesh refinement.
63
64 std::string m_netName;
65 std::vector< std::pair<std::string,int> > m_VsNodesAvailable;
66
67 static int s_iID;
68 int m_iD;
69 ISimObjectLogger* m_logger;
70 int m_maxNumPanels;
71 int m_maxNumCables;
72 int m_maxNumNodes;
73 double m_minSideLength;
74 double m_maxSideLengthFactor;
75};
76
77#endif // CNetStructureTestSpec_h__
Definition NetStructureTestSpec.h:16
int m_numTwinesCalc
The number of elements the cable is divided into.
Definition NetStructureTestSpec.h:52
int m_numNodesCalc
The number of nodes of the net after refinement.
Definition NetStructureTestSpec.h:55
std::vector< NetCableElementTestSpec * > m_cableElements
A vector of structs containing the cable data read from the input file.
Definition NetStructureTestSpec.h:57
int m_numNodesOriginal
The number of original nodes of the net.
Definition NetStructureTestSpec.h:54
std::vector< std::pair< std::string, int > > m_VsNodesAvailable
The tag names and indices of the available external nodes.
Definition NetStructureTestSpec.h:65
int m_numCablesCalc
The number of elements the cable is divided into.
Definition NetStructureTestSpec.h:51
int m_foldingPointRefinement
refinement by folding points on each cable (Cats mode)
Definition NetStructureTestSpec.h:62
std::string m_netName
The identification name of the net.
Definition NetStructureTestSpec.h:64
std::vector< const NetTwineElementSpec * > m_twineElements
A vector of structs containing the cable data read from the input file.
Definition NetStructureTestSpec.h:58
int m_numMeshesCalc
The number of elements the cable is divided into.
Definition NetStructureTestSpec.h:53