FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
CIntegrator.h
1#ifndef CIntegrator_H
2#define CIntegrator_H
3
60#include <fhsim/simobject/SimObject.h>
61#include <string>
62
63class CIntegrator : public SimObject
64{
65 public:
67 CIntegrator(std::string sSimObjectName, ISimObjectCreator* pCreator);
68
70 void OdeFcn(const double dT, const double* const adX, double* const adXDot) const;
71
72 bool HasJacobians() const override;
73 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
74 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
75
76 bool HasPortJacobians() const override;
77 void OutputPortJacobian(const std::string& portName, double T, const double* X,
78 double* dPort_dX, int portSize, int nStates, int index = -1) override;
79 void InputPortJacobian(const std::string& portName, double T, const double* X,
80 double* dF_dInput, int portSize, int nStates) override;
81
82 const double* Output(const double T, const double* const X);
83
84 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
85
86#ifdef FH_VISUALIZATION
88 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator) { }
89
91 virtual void RenderUpdate(const double T, const double* const X) { }
92#endif
93
94 protected:
95 ISignalPort* m_IcPort;
96 ISignalPort* m_Input;
97 int m_StateIndex;
100};
101#endif
Definition CIntegrator.h:64
CIntegrator(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.
int m_iPortWidth
Definition CIntegrator.h:99