9#ifndef CNetCageScreen_H
10#define CNetCageScreen_H
15#include <ISimObjectCreator.h>
18#include <CEnvironment.h>
19#include <ICurrentVel.h>
20#include <IBasicBottom.h>
21#include "sfh/timers/ProfilerWallclock.h"
22#include "net/CNetCableElementSpec.h"
23#include "net/CNetCableElement.h"
24#include "net/CScreenElementDef.h"
25#include <environment/DeepSeaGravityWaves.h>
27#include "net/CScreenStructureSpec.h"
28#include "net/CScreenElement3N.h"
29#include "net/CNetBottomContactFilter.h"
33#ifdef FH_VISUALIZATION
35#include "sfh/ogre/NMeshGenerators.h"
36#include "sfh/ogre/C3DLine.h"
37#include <CTextRenderer.h>
46 CNetCageScreen(
const string& simobjectname, ISimObjectCreator*
const creator);
49 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot,
const bool bIsMajorTimeStep);
50 virtual void InitialConditionSetup(
const double dT,
const double *
const adCurrentIC,
double *
const adUpdatedIC, ISimObjectCreator *
const pCreator);
51 virtual void FinalSetup(
const double dT,
const double *
const adX, ISimObjectCreator *
const pCreator);
52 const double * outExternalNodeForce(
const double dT,
const double *
const adX,
int iExtNode);
56#ifdef FH_VISUALIZATION
58 virtual void RenderInit(Ogre::Root*
const pOgreRoot, ISimObjectCreator*
const pCreator);
59 virtual void RenderUpdate(
const double T,
const double*
const X);
60 void CreateCapsule( Ogre::ManualObject *capsule_manual);
66 virtual const double *
NodePos(
const double dT,
const double *
const adX,
int iExtNode);
67 virtual const double * NodeVel(
const double dT,
const double *
const adX,
int iExtNode);
68 virtual const double * BottomContact(
const double dT,
const double *
const adX);
69 void SetAddedDragPerMPS(
double AddedDragPerMPS);
75 const double* outNodeSumForce(
const double T,
const double*
const X);
76 const double* outNodeSumDragForceAbs(
const double T,
const double*
const X);
77 const double* outNodeSumDragForceDirection(
const double T,
const double*
const X);
78 const double* outNodeSumLiftForce(
const double T,
const double*
const X);
79 const double* outBottomPosition(
const double T,
const double*
const X);
80 const double* outSteadyStateEst_Tau(
const double T,
const double*
const X);
81 const double* outSteadyStateEst_K(
const double T,
const double*
const X);
82 const double* LowerMembranePosition(
const double dT,
const double*
const adX);
83 const double* outMiddleCurrentVelocity(
const double dT,
const double*
const adX);
85 const double * InternalNodeForce(
const double dT,
const double *
const adX,
int iExtNode);
86 const double * NodeForce(
const double T,
const double *
const X,
int iNode);
94 void GetNodePositionIndices( std::vector<int> &NodePositions);
95 void GetNodeVelocityIndices( std::vector<int> &NodeVelocities);
96 vector<CScreenElement3N*> getNetElements();
97 void getNetElementConnections(vector<int*> &ElementConnections);
98 void setTraversedElements(vector<bool> TraversedElements);
104 void DecomposeDragForcesInCurrentDirection(
double*
const DragForcesProjected,
const double T,
const double*
const X);
105 bool SteadyStateEstimator(
const double T,
const double*
const X);
106 void AddDeadFishWeightForce(
const double T,
const double*
const X);
108 void SetExternalPos(
const double dT,
const double *
const adX);
109 void SetExternalVel(
const double dT,
const double *
const adX);
111 virtual void CreateDataStructures();
112 virtual void AddInputPorts(ISimObjectCreator *pCreator);
113 virtual void CreateOutputPorts(ISimObjectCreator *pCreator);
114 virtual void CalcStateDerivatives(
const double *
const adX,
double *
const adXDot);
115 virtual double AddNodeBottomForce(
const double *
const adX,
int iNode,
double dDiam,
double adForceInOut[3]);
116 virtual void AddNetForces(
const double dT,
const double *
const adX);
117 virtual void AddCableForces(
const double dT,
const double *
const adX);
120 ISignalPort **m_InExternalPos;
121 ISignalPort **m_InExternalVel;
122 ISignalPort *m_MembraneDepth;
124 double* m_NodeExternalPos;
125 double* m_NodeExternalVel;
127 double m_adNodeSumForce[3];
128 double m_adSumHydDynForce[3];
129 double m_dNodeSumDragForceAbs;
130 double m_dNodeSumDragDirection;
131 double m_dNodeSumLiftForce;
132 double m_MiddleCurrentVelocity[3];
134 double* m_adNodeHydDynForce;
136 double* m_NodeInternalForces;
138 int(* m_hasPosAndVelStates)[2];
140 int m_NumNodesInputPosAndVel;
141 int m_NumNodesOutputForce;
143 VSPairStrInt m_VsNodesInputPosAndVel;
144 VSPairStrInt m_VsNodesOutputForce;
146 Eigen::MatrixXd m_SSPhi;
147 Eigen::MatrixXd m_SSY;
150 sfh::timers::StopWatch m_SSCalcIntervalWatch;
153 int m_MembraneIsInSystem;
154 double m_LowerMembraneDepth;
155 std::string m_simobjectname;
156 bool m_TerminateAtSteadyState;
161 std::string m_CageShape;
166 double* m_CageCentre;
168 int m_BottomNodeIndex;
169 double m_DeadFishInertia[3];
170 double m_DeadFishWeigthForce;
172 sfh::timers::StopWatch m_RealTimeWatch;
176 virtual void CreateNetPanels(std::vector<const CScreenElementDef*> VNetElementDefs, ISimObjectCreator *pCreator);
177 virtual void CreateNetCables(std::vector<const CNetCableElementSpec*> VCableElements, ISimObjectCreator *pCreator);
178 void AddExternalForces(
const double dT,
const double *
const adX);
179 void AddBottomForces(
const double *
const adX);
180 VSPairStrInt CreateExternalNodeMap( std::string sTag,
int* piUsed,
CScreenStructureSpec & ScreenSpec, ISimObjectCreator *pCreator);
181 void PRINTALLNODEFORCES(std::string spec,
double dT);
183 int m_iNumNodeOutputs;
184 int** m_aaiCableConn;
187 bool m_useReynoldsDependentDragCoefficients;
190 double* m_adNodeForce;
191 double* m_NodeExternalForces;
192 double m_adBottomContact[6];
195 int m_iNumNodesOriginal;
196 int m_iNumNodesOutputPosAndVel;
197 int m_iNumPanelsCalc;
198 int m_iNumCablesCalc;
199 int m_iNumNodesInputForce;
202 bool m_bUseTagForExternalNodes;
203 bool m_InternalElementWakeEffectsActive;
204 bool m_bFoldingPointRefinementUsed;
205 bool m_ExternalElementWakeEffectsActive;
216 VSPairStrInt m_VsNodesOutputPosAndVel;
217 VSPairStrInt m_VsNodesInputForce;
220 std::vector<CNetCableElement*> m_VpCableElements;
221 sfh::timers::StopWatch m_OdeTimer;
223 std::vector<CScreenElement3N*> m_VpScreenElements;
226#ifdef FH_VISUALIZATION
234#ifdef CNetStructureWakeEffect_DO_PROFILE
235 sfh::timers::ProfilerWallclock m_Profiler;
Definition: CEnvironment.h:10
Class containing the specification for a net object.
Definition: CScreenStructureSpec.h:42
Interface for calculating the bottom force on various objects.
Definition: IBasicBottom.h:23
Definition: ICurrentVel.h:12
Definition: CNetCageScreen.h:43
virtual void CreateNetPanels(std::vector< const CScreenElementDef * > VNetElementDefs, ISimObjectCreator *pCreator)
VARIABLES NEEDED AFTER REMOVING NETSTRUCTURE — START.
virtual ~CNetCageScreen()
The destructor cleans up.
ISignalPort ** m_apInExternalForces
Harmonic coeffisients in drag and lift force calculations (a3,a5,b4,b6) for CD/cd=a1*cos(Theta)+a3*co...
Definition: CNetCageScreen.h:210
double m_harmForceCoeff[4]
Spesific for screen model.
Definition: CNetCageScreen.h:208
const double * outSumHydDynForce(const double T, const double *const X)
VARIABLES NEEDED AFTER REMOVING NETSTRUCTURE — END.
bool m_UseActualElementSizeInWakeEffect
Set to true if actual size (number of u and v bars) of net element shall be used in wake effect calcu...
Definition: CNetCageScreen.h:185
int m_NElementBarsInWakeEffectCalc
Number of u and v bars in calculation of wake effect if m_UseActualElementSizeInWakeEffect is set to ...
Definition: CNetCageScreen.h:186
CNetCageScreen(const string &simobjectname, ISimObjectCreator *const creator)
The constructor sets the pointer to the output object and the parser object.
virtual const double * NodePos(const double dT, const double *const adX, int iExtNode)
Calculates the state derivatives.
Class modelling a Net cage.
Definition: CBottomRing.h:35
Class containing the specification for a net object.
Definition: CNetStructureSpec.h:22