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