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

Public Member Functions

 InternalCable (ISimObjectCreator *creator, const SCableSpec &CableSpec)
 The constructor sets the pointer to the output object and the parser object.
 
 ~InternalCable ()
 The destructor deletes dynamically allocated memory.
 
virtual void FinalSetup (const double dT, const double *const adX, ISimObjectCreator *const creator)
 
virtual void OdeFcn (const double *const adPosA, const double *const adVelA, const double *const adPosB, const double *const adVelB, const double *const adX, double *const adXDot, double dT) const
 Calculates the state derivatives and the end forces.
 
void ComputeStructuralJacobian (const double *posA, const double *velA, const double *posB, const double *velB, const double *X, double *J, int nStates, int stateOffset) const
 
void AddEndpointJacobianContributions (const double *posA, const double *velA, const double *posB, const double *velB, int globalPosIdxA, int globalVelIdxA, int globalPosIdxB, int globalVelIdxB, double endInertiaA, double endInertiaB, const double *X, double *J, int nStates, int stateOffset) const
 
virtual bool InitializeStates (const double *const adPosA, const double *const adVelA, const double *const adPosB, const double *const adVelB, double *const adX)
 Method for setting initial conditions when the input is known, which may be implemented in the individual simObjects.
 
void UpdateCable (double newLength, double dT)
 Updates the cable for the next step.
 
void AddEndForcesAndInertia (double *const adEndForceA, double *const adEndForceB, double *const pdEndInertiaA, double *const pdEndInertiaB, const double *const adPosA, const double *const adVelA, const double *const adPosB, const double *const adVelB, const double *const adX, double dT)
 Adds the end forces and inertia to the supplied data structures.
 
double GetLength ()
 Calculates the length of the cable.
 

Public Attributes

unsigned long m_numElements
 The number of elements to divide the cable into.
 
unsigned long m_numNodes
 The number of nodes of the cable.
 

Protected Member Functions

void ResetAllNodeForces () const
 
void AddAllElementForces (const double *const adPosA, const double *const adVelA, const double *const adPosB, const double *const adVelB, const double *const adX, double dT) const
 
void CalcDerivatives (const double *const adX, double *const adXDot) const
 
virtual void AddElementForce (int cableElement, const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3], double adForceA[3], double adForceB[3], double dT) const
 
void UpdateInertia ()
 Updates the inertia of the cable according to the changing length.
 

Protected Attributes

unsigned long * m_iStatePos
 An array of indices to the node position states.
 
unsigned long * m_iStateVel
 An array of indices to the node velocity states.
 
SCableSpec m_CableSpec
 The cable specification.
 
double m_eA
 The stiffness of the cable.
 
sfh::timers::StopWatch m_StopWatch
 
CableElDynStiff ** m_cableElements
 An array holding the cable elements.
 
double * m_inertiaA
 The inertia of the A nodes.
 
double * m_inertiaB
 The inertia of the B nodes.
 
double ** m_aadForceA
 The force on the A nodes.
 
double ** m_aadForceB
 The force on the B nodes.
 
environment::EnvironmentProvider * m_environment
 
double m_elVelWater [3]
 
double m_elMeanPos [3]
 
double m_elMeanVel [3]
 

Member Function Documentation

◆ AddEndpointJacobianContributions()

void InternalCable::AddEndpointJacobianContributions ( const double *  posA,
const double *  velA,
const double *  posB,
const double *  velB,
int  globalPosIdxA,
int  globalVelIdxA,
int  globalPosIdxB,
int  globalVelIdxB,
double  endInertiaA,
double  endInertiaB,
const double *  X,
double *  J,
int  nStates,
int  stateOffset 
) const

Adds Jacobian contributions from boundary segments when endpoints are state variables.

ComputeStructuralJacobian treats posA/posB as frozen (no J entries for them). Call this afterwards when either endpoint belongs to the state vector (junction nodes).

Parameters
globalPosIdxAGlobal state index of posA; -1 if posA comes from a port.
globalVelIdxAGlobal state index of velA; -1 if velA comes from a port.
globalPosIdxBGlobal state index of posB; -1 if posB comes from a port.
globalVelIdxBGlobal state index of velB; -1 if velB comes from a port.
endInertiaAInertia of junction node A (used when globalPosIdxA >= 0).
endInertiaBInertia of junction node B (used when globalPosIdxB >= 0).

◆ ComputeStructuralJacobian()

void InternalCable::ComputeStructuralJacobian ( const double *  posA,
const double *  velA,
const double *  posB,
const double *  velB,
const double *  X,
double *  J,
int  nStates,
int  stateOffset 
) const

Computes the structural (spring+damper) contribution to the ODE Jacobian. Fills J (row-major, nStates x nStates) with contributions from all segments. Omitted terms: hydrodynamic drag, gravity/buoyancy (constants). stateOffset: byte offset of this cable's states within the SimObject's global state vector.

◆ OdeFcn()

virtual void InternalCable::OdeFcn ( const double *const  adPosA,
const double *const  adVelA,
const double *const  adPosB,
const double *const  adVelB,
const double *const  adX,
double *const  adXDot,
double  dT 
) const
virtual

Reimplemented in InternalCableWithAttractor.


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