Marine systems simulation
VirtualCurrentInDir.h
1#pragma once
2
32#include <SimObject.h>
33#include <CEnvironment.h>
34#include <memory>
35
36class VirtualCurrentInDir : public SimObject, ICurrentField
37{
38public:
39 VirtualCurrentInDir(const string& simObjectName, ISimObjectCreator* const creator);
40
41 void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
42 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
43 void GetCurrent(const double T, const double* const X, const double position[3], double* currentVelocity);
44 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
45
46 void PreOdeFcn(const double T, const double *const X, IStateUpdater* updater);
47
48#ifdef FH_VISUALIZATION
49 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
50 void RenderUpdate( const double T, const double* const X);
51#endif
52protected:
53 void SetOutputPortValues(const double T, const double* const X);
54 const double * PlanarCurrent(const double T, const double * const X, int layer);
55private:
56
57 ICommonComputation* m_SetOutputPortValues;
58 double m_Pp, m_Pd, m_Pi, m_IntegralSaturation, m_DerivativeTInv;
59 int m_CurrentIndex, m_IntegralIndex, m_DerivativeIndex, m_layers;
60
61 std::unique_ptr<double[]> m_PlanarCurrents;
62 CEnvironment *Environment;
63
64 std::vector<int> m_CurrentIndices, m_IntegralIndices, m_DerivativeIndices;
65 std::unique_ptr<double[]> m_Depths;
66
67 double m_MaximumCurrent;
68 std::unique_ptr<double[]> m_Directions;
69
70 double m_MaximumCurrentRel;
71
72 double m_MinimumCurrentTot;
73
74 bool m_AdaMax;
75 std::unique_ptr<double[]> m_AdaMaxRatio;
76 std::unique_ptr<double[]> m_AdaErr;
77 std::unique_ptr<double[]> m_AdaErrTol;
78
79protected:
80 std::unique_ptr< ISignalPort*[] > m_Input_e;
81 std::unique_ptr< ISignalPort*[] > m_Input_d;
82 std::unique_ptr< ISignalPort*[] > m_Input_v;
83 std::unique_ptr< ISignalPort*[] > m_Input_vt;
84
85#ifdef FH_VISUALIZATION
86 Ogre::SceneNode* m_RenderNode;
87#endif
88};
Definition: CEnvironment.h:10
Definition: ICurrentField.h:4
Definition: VirtualCurrentInDir.h:37
void SetOutputPortValues(const double T, const double *const X)
Set upper limit of the current.