Marine systems simulation
CMembraneStructure.h
1
9
10#pragma once
11
12//#define CNetStructure_DO_PROFILE
13
14// Includes
15#include <string>
16#include <CEnvironment.h>
17#include "SimObject.h"
18//#include "CNetElement3N.h"
19#include "CMembraneElement.h"
20#include <net/CNetCableElementSpec.h>
21#include <net/CNetCableElement.h>
22#include <net/CNetElementDef.h>
23#include <IBasicBottom.h>
24#include <net/CNetBottomContactFilter.h>
25#include <ICurrentVel.h>
26#include <ICurrentVel.h>
27#include <net/CNetStructureSpec.h>
28
29
30#include <CEnvironment.h>
31
32#ifdef FH_VISUALIZATION
33 #include "sfh/ogre/NMeshGenerators.h"
34 #include "sfh/ogre/C3DLine.h"
35 #include <CTextRenderer.h>
36#endif
37
38namespace Netcage {
39
40//Class definition
41class CMembraneStructure : public SimObject
42{
43public:
45 CMembraneStructure(const std::string& sSimObjectName, ISimObjectCreator* const pCreator);
48 virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot, const bool bIsMajorTimeStep);
49 virtual void InitialConditionSetup(const double dT, const double *const adCurrentIC, double *const adUpdatedIC, ISimObjectCreator *const pCreator);
50 virtual void FinalSetup(const double dT, const double *const adX, ISimObjectCreator *const pCreator);
51 const double * outExternalNodeForce(const double dT, const double *const adX, int iExtNode);
52
53#ifdef FH_VISUALIZATION
55 virtual void RenderInit(Ogre::Root *const pOgreRoot, ISimObjectCreator *const pCreator);
57 virtual void RenderUpdate(const double dT, const double *const adX);
58
59 void CreateCapsule( Ogre::ManualObject *capsule_manual);
60 C3DLine *myline;
61#endif
62 const virtual double * NodePos(const double dT, const double *const adX, int iExtNode);
63 const virtual double * NodeVel(const double dT, const double *const adX, int iExtNode);
64 const virtual double * BottomContact(const double dT, const double *const adX);
65 const virtual double * LowerMembranePosition(const double dT, const double *const adX);
66
67 void SetAddedDragPerMPS(double AddedDragPerMPS);
68protected:
69 virtual void CalcStateDerivatives(const double *const adX, double *const adXDot);
70 virtual void AddExternalForces(const double dT, const double *const adX);
71 virtual void AddNetForces(const double dT, const double *const adX);
72 virtual void AddCableForces(const double dT, const double *const adX);
73 virtual double AddNodeBottomForce(const double *const adX, int iNode, double dDiam, double adForceInOut[3]);
74 virtual void AddBottomForces(const double *const adX);
75 virtual void AddInputPorts(ISimObjectCreator *pCreator);
76 virtual void CreateNetPanels(std::vector<const CNetElementDef*> VNetElementDefs, ISimObjectCreator *pCreator);
77 virtual void CreateNetCables(std::vector<const CNetCableElementSpec*> VCableElements, ISimObjectCreator *pCreator);
78 virtual void CreateDataStructures();
79 virtual void CreateOutputPorts(ISimObjectCreator *pCreator);
80 VSPairStrInt CreateExternalNodeMap( std::string sTag, int* piUsed, CNetStructureSpec & NetSpec, ISimObjectCreator *pCreator);
81 void PRINTALLNODEFORCES(std::string spec, double dT);
82
84
85 ISignalPort **m_apInExternalForces;
86 int *m_aIStatePos;
87 int *m_aIStateVel;
89 double* m_NodeExternalForces;
91
93 int m_iNumNodesOutputPosAndVel;
94 int m_iNumPanelsCalc;
95 int m_iNumCablesCalc;
96 int m_iNumNodesOriginal;
97 int m_iNumNodesCalc;
98 int m_iNumNodeOutputs;
100
102
104 double m_adBottomContact[6];
105
106 IBasicBottom** m_ppBottom;
107 ICurrentVel** m_ppCurrentVel;
108 CEnvironment* m_pEnvironment;
110
112
113 std::vector<CNetCableElement*> m_VpCableElements;
114 std::vector<CMembraneElement*> m_VpNetElements;
115 float* m_afInertia;
116 int* m_aiNetConn;
117 int** m_aaiCableConn;
118 SAdaptationSpec_t m_SAdaptations;
119 bool m_bFoldingPointRefinementUsed;
121
122
124
126 VSPairStrInt m_VsNodesInputForce;
127 bool m_bUseTagForExternalNodes;
129
130 double* m_adNodeForce;
131 sfh::timers::StopWatch m_OdeTimer;
132
133 double m_LowerMembraneDepth;
134
135#ifdef CNetStructure_DO_PROFILE
136 sfh::timers::ProfilerWallclock m_Profiler;
137#endif
138
139
140};
141
142
143} // namespace
Definition: CEnvironment.h:10
Definition: CNetBottomContactFilter.h:7
Definition: CNetStructureSpec.h:38
Interface for calculating the bottom force on various objects.
Definition: IBasicBottom.h:23
Definition: ICurrentVel.h:12
Definition: CMembraneStructure.h:42
CNetBottomContactFilter m_BottomContactFilter
Environment.
Definition: CMembraneStructure.h:103
std::vector< CNetCableElement * > m_VpCableElements
Element properties.
Definition: CMembraneStructure.h:113
CMembraneStructure(const std::string &sSimObjectName, ISimObjectCreator *const pCreator)
The constructor sets the pointer to the output object and the parser object.
VSPairStrInt m_VsNodesOutputPosAndVel
Nodes reachable directly through input or output ports.
Definition: CMembraneStructure.h:125
virtual ~CMembraneStructure()
The destructor deletes dynamically allocated memory.
ISignalPort ** m_apInExternalForces
Interface member variables.
Definition: CMembraneStructure.h:85
int m_iNumNodesInputForce
Node counts.
Definition: CMembraneStructure.h:92
Class modelling a Net cage.
Definition: CBottomRing.h:35
Class containing the specification for a net object.
Definition: CNetStructureSpec.h:22