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

Public Member Functions

 HydroCable (const std::string &simObjectName, ISimObjectCreator *const creator)
 
void OdeFcn (const double T, const double *const X, double *const XDot) const
 
void InitialConditionSetup (const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
 
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
 

Protected Member Functions

void SetOutputPortValues (const double T, const double *const X) const
 
Eigen::Vector3d Drag (int k, int l, const double T, const double *const X) const
 
Eigen::Vector3d Spring (int k, int l, const double T, const double *const X) const
 
Eigen::Vector3d Damp (int k, int l, const double T, const double *const X) const
 
void computeSegmentJacobian (const double *pk, const double *pl, const double *vk, const double *vl, double *dF_dpk, double *dF_dpl, double *dF_dvk, double *dF_dvl) const
 
const double * ForceA (const double T, const double *const X)
 
const double * ForceB (const double T, const double *const X)
 
const double * PosA (const double T, const double *const X)
 
const double * PosB (const double T, const double *const X)
 
int LocalIndex (int globalStateIndex) const
 

Protected Attributes

ICommonComputation * m_SetOutputPortValues
 
ISignalPort * m_PositionA
 
ISignalPort * m_PositionB
 
ISignalPort * m_VelocityA
 
ISignalPort * m_VelocityB
 
ISignalPort * m_Current
 
std::vector< int > m_PositionIndex
 
std::vector< int > m_VelocityIndex
 
int m_stateBase = 0
 Global index of this object's first state, Position1; cached in the constructor.
 
int m_NumPoints
 
double m_ForceA [3]
 
double m_ForceB [3]
 
double m_PosA [3]
 
double m_PosB [3]
 
double m_ElementMass
 
double m_ElementLength0
 
double m_SpringCoef
 
double m_DamperCoef
 
double m_GravYancy
 
double m_CrossDragCoef
 
double m_AlongDragCoef
 
double m_RhoWater
 
double m_Mass
 
double m_Length
 
double m_Diameter
 
double m_RhoCable
 
double m_Modulus
 

Member Function Documentation

◆ computeSegmentJacobian()

void HydroCable::computeSegmentJacobian ( const double *  pk,
const double *  pl,
const double *  vk,
const double *  vl,
double *  dF_dpk,
double *  dF_dpl,
double *  dF_dvk,
double *  dF_dvl 
) const
protected

Computes [3x3] Jacobian blocks for Spring(k,l) + Damp(k,l). Force convention: force ON node k FROM neighbor l, with d = pl - pk. OdeJacobian adds the Drag(k,l) blocks with AddCableSegmentDragJacobian. dF_dpk, dF_dpl, dF_dvk, dF_dvl are row-major [3x3] matrices.

◆ LocalIndex()

int HydroCable::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 Position1, so every index it uses goes through this function (BASE-0033).


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