Marine systems simulation
VirtualCurrent.h
1#pragma once
2
76#include <CEnvironment.h>
77#include <SimObject.h>
78#include <memory>
79
80class VirtualCurrent : public SimObject, ICurrentField
81{
82 public:
83 VirtualCurrent(const string& simObjectName, ISimObjectCreator* const creator);
84
85 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const creator);
86 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
87 void GetCurrent(const double T, const double* const X, const double position[3], double* currentVelocity);
88 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
89
90 void PreOdeFcn(const double T, const double* const X, IStateUpdater* updater);
91
92#ifdef FH_VISUALIZATION
93 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
94 void RenderUpdate(const double T, const double* const X);
95#endif
96 protected:
97 void SetOutputPortValues(const double T, const double* const X);
98 const double* PlanarCurrent(const double T, const double* const X, int layer);
99
100 private:
101 ICommonComputation* m_SetOutputPortValues;
102 double m_Pp, m_Pd, m_Pi, m_IntegralSaturation, m_DerivativeTInv;
103 int m_CurrentIndex, m_IntegralIndex, m_DerivativeIndex, m_layers;
104
105 std::unique_ptr<double[]> m_PlanarCurrents;
106 CEnvironment* Environment;
107
108 std::vector<int> m_CurrentIndices, m_IntegralIndices, m_DerivativeIndices;
109 std::unique_ptr<double[]> m_Depths;
110
111 double m_MaximumCurrent;
112
113 protected:
114 std::unique_ptr<ISignalPort*[]> m_Input_i;
115
116#ifdef FH_VISUALIZATION
117 Ogre::SceneNode* m_RenderNode;
118#endif
119};
Definition: CEnvironment.h:10
Definition: ICurrentField.h:4
Definition: VirtualCurrent.h:81
std::unique_ptr< ISignalPort *[]> m_Input_i
Set upper limit of the current.
Definition: VirtualCurrent.h:114
void SetOutputPortValues(const double T, const double *const X)
Set upper limit of the current.