FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetStructureSpec Class Reference
+ Collaboration diagram for NetStructureSpec:

Public Member Functions

 NetStructureSpec (ISimObjectLogger *logger)
 The constructor sets the pointer to the output object and the parser object.
 
virtual ~NetStructureSpec ()
 The destructor deletes dynamically allocated memory.
 
virtual void FromFile (std::string fileName, std::string filePath)
 
void FromBinaryFile (std::string fileName, std::string filePath)
 
bool FromNetSpec (const std::string &specPath)
 
std::vector< std::string > DefaultNodes (const std::string &parameter) const
 
int CreateExternalNodeMap (std::vector< std::string > VsInputNodes, VSPairStrInt &VsNodes)
 
int GetNumNodesCalc ()
 
int GetNumNodesOriginal ()
 
std::vector< const NetElementDef * > GetNetPanels ()
 
std::vector< const NetCableElementSpec * > GetCableElements ()
 
SAdaptationSpec_t GetAdaptationSpec ()
 
bool GetCatsRefinementMode ()
 
void PrintInfo ()
 

Protected Member Functions

virtual void ReadInput (InputReader &FileReader, ISimObjectLogger *logger)
 Reads a <Net> document, from a file or from text.
 
void CheckAndRefine ()
 Checks the node numbers and refines the mesh of the net just read.
 
virtual void ReadBinaryInputFile (std::string fileName, std::string filePath, ISimObjectLogger *logger)
 
void FindNodesToDivide (int nodesToDivide[2], double *length, double *lengthFactor)
 
void RefineMesh ()
 
void RefineMesh2 ()
 
void CheckNodeNumber (int nodeNumber, ISimObjectLogger *const logger, std::string nodeDescription="")
 
void CheckNodes (ISimObjectLogger *logger)
 
unsigned short AddCalcNode (int aiNodes[2])
 
unsigned short DivideCableElement (int CableNum)
 

Protected Attributes

int m_numPanelsCalc
 The number of elements the net is divided into.
 
int m_numCablesCalc
 The number of elements the cable is divided into.
 
int m_numNodesOriginal
 The number of original nodes of the net.
 
int m_numNodesCalc
 The number of nodes of the net after refinement.
 
std::vector< const NetElementDef * > m_VSPanelData
 A vector of structs containing the section data read from the input file.
 
std::vector< const NetCableElementSpec * > m_VCableElements
 A vector of structs containing the cable data read from the input file.
 
int m_foldingPointRefinement
 refinement by folding points on each cable (Cats mode)
 
double m_maxSideLengthFactor
 The maximum element side length factor.
 
double m_minSideLength
 The side length limit for the elements to be further subdivided.
 
int m_maxNumNodes
 The maximum number of nodes used for net calculations.
 
int m_maxNumPanels
 The maximum number of net panels used for the calculations.
 
int m_maxNumCables
 The maximum number of cable elements used for the calculations.
 
double m_scale
 The scale of the trawl net in relation to the specifications.
 
std::string m_netName
 The identification name of the net.
 
VSPairStrInt m_VsNodesAvailable
 The tag names and indices of the available external nodes.
 
SAdaptationSpec_t m_SAdaptationSpec
 A struct containing adaptations for faster integration of the net structure.
 
std::vector< std::string > m_defaultNodesInputForce
 DefaultNodes("NodesInputForce").
 
std::vector< std::string > m_defaultNodesOutputPosAndVel
 DefaultNodes("NodesOutputPosAndVel").
 
int m_iD
 
ISimObjectLogger * m_logger
 

Static Protected Attributes

static int s_iID
 

Member Function Documentation

◆ DefaultNodes()

std::vector< std::string > NetStructureSpec::DefaultNodes ( const std::string &  parameter) const

The external nodes a net SimObject's node list parameter defaults to: for a net read by FromNetSpec, the specification's Connect nodes for NodesInputForce and its Connect and Output nodes for NodesOutputPosAndVel, as fhsim_trawlwriter writes them; none otherwise.

◆ FromNetSpec()

bool NetStructureSpec::FromNetSpec ( const std::string &  specPath)

Meshes the XML net specification in specPath (doc/user/net-specification.md) into the <Net> text fhsim_trawlwriter writes to a net file, and reads that text as FromFile reads the file.

Parameters
specPathThe specification's path, as it is opened.
Returns
false, with the error reported to the logger, if the specification cannot be read.

The documentation for this class was generated from the following file: