Marine systems simulation
CCrowfoot.h
1#ifndef C_CROWFOOT_H
2#define C_CROWFOOT_H
3
71#include <SimObject.h>
72#include <string>
73#include <vector>
74#include "trawl/subroutines/CCrowfootMath.h"
75#include "sfh/filters/FIR.h"
76#include <float.h>
77
78class CCrowfoot : public SimObject
79{
80public:
96 CCrowfoot(const std::string& simObjectName, ISimObjectCreator* const creator);
97 //virtual void FinalSetup(const double T, const double* const X, ISimObjectCreator* const pCreator);
98 virtual ~CCrowfoot();
99
100 void OdeFcn(const double T , const double* const X, double* const XDot, const bool IsMajorTimeStep);
101
102 virtual void InitialConditionSetup(const double dT, const double *const adCurrentIC, double *const adUpdatedIC, ISimObjectCreator *const pCreator);
103 //virtual void FinalSetup(const double dT, const double *const adX, ISimObjectCreator *const pCreator);
104
105 const virtual double * PositionOut(const double t, const double *const x);
106 const virtual double * VelocityOut(const double t, const double *const x);
107 const virtual double * LineForceOut(const double t, const double *const x, int lineIndex);
108 const virtual double * LineTensionOut(const double t, const double *const x, int lineIndex);
109
110
111#ifdef FH_VISUALIZATION
120 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
121
130 void RenderUpdate(const double T, const double* const X);
131#endif
132
133
134
135protected:
136 int m_numLines;
137 std::vector<const double*> m_linesPos;
138 std::vector<double*> m_linesForce;
139 //std::vector<double> m_linesLength;
140 std::vector<double> m_linesTension;
141
142 ISignalPort** m_inFasteningPositions;
143 ISignalPort** m_inLengths;
144 ISignalPort* m_inExternalForce;
145 CCrowfootMath* m_crowfoot;
146
147 //int m_IStatePos;
148 //int m_IStateVel;
149 //int m_IStateErrorIntegral;
150 double m_velocity[3];
151 double m_instantPos[3];
152 //double m_integratorGain;
153 //double m_proportionalGain;
154 //double m_dampingGain;
155 //double m_distForMaxSpeed;
156 //double m_maximumSpeed;
157 //sfh::timers::StopWatch m_derivativeTimer;
158 //double m_timeStep;
159 //double m_lastError[3];
160 //double m_tmpError[3];
161 sfh::filters::FIR m_filter;
162
163# ifdef FH_VISUALIZATION
164
165# endif
166};
167#endif
Definition: CCrowfootMath.h:39
Definition: CCrowfoot.h:79
CCrowfoot(const std::string &simObjectName, ISimObjectCreator *const creator)
Reads parameters, registers states, input/output ports and shared resources.