FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
HydroBall Class Reference
+ Inheritance diagram for HydroBall:
+ Collaboration diagram for HydroBall:

Public Member Functions

 HydroBall (const std::string &simObjectName, ISimObjectCreator *const creator)
 
void OdeFcn (const double T, const double *const X, double *const XDot) const
 
bool HasJacobians () const override
 
void OdeJacobian (double T, const double *X, double *J, int nStates) override
 
int GetJacobianSparsity (int nStates, int *rowPtr, int *colIdx) override
 
void InitialConditionSetup (const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
 

Protected Member Functions

void SetOutputPortValues (const double T, const double *const X) const
 
const double * Position (const double T, const double *const X)
 
const double * Velocity (const double T, const double *const X)
 
int LocalIndex (int globalStateIndex) const
 

Protected Attributes

ICommonComputation * m_SetOutputPortValues
 
ISignalPort * m_ForceExt
 
ISignalPort * m_Current
 
int m_PositionIndex
 
int m_VelocityIndex
 
double m_Position [3]
 
double m_Velocity [3]
 
double m_Mass
 
double m_Radius
 
double m_DragCoef
 
double m_RhoWater
 
double m_RhoBall
 

Member Function Documentation

◆ LocalIndex()

int HydroBall::LocalIndex ( int  globalStateIndex) const
inlineprotected

Turns a model-global state index into one local to this SimObject.

OdeFcn and the port functions are handed the whole model's state vector, so they use the global indices AddState returned directly. OdeJacobian is handed this object's own slice, whose first element is Position, so every index it uses goes through this function (BASE-0033).


The documentation for this class was generated from the following file: