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