FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
InternalCableWithAttractor Class Reference

Class containing a cable object to be part of larger cable structures. More...

#include <InternalCableWithAttractor.h>

+ Inheritance diagram for InternalCableWithAttractor:
+ Collaboration diagram for InternalCableWithAttractor:

Public Member Functions

 InternalCableWithAttractor (ISimObjectCreator *creator, const SCableSpec &CableSpec, std::string attractorName)
 The constructor sets the pointer to the output object and the parser object.
 
virtual void FinalSetup (const double dT, const double *const adX, ISimObjectCreator *const creator)
 
void SetAttractor (AttractorBase *attractor)
 Sets the attractor to use.
 
void UpdateAttractorMotion (double dT, const double *adX) const
 
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.
 
- Public Member Functions inherited from InternalCableWithBottomContact
 InternalCableWithBottomContact (ISimObjectCreator *creator, const SCableSpec &CableSpec)
 The constructor sets the pointer to the output object and the parser object.
 
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 override
 As InternalCable::OdeFcn, and records whether the seafloor gave any element a force.
 
bool InBottomContact () const override
 
- Public Member Functions inherited from InternalCable
 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.
 
void EvaluateElementsAt (const double *adPosA, const double *adVelA, const double *adPosB, const double *adVelB, const double *adX, double dT) const
 
double EndInertia (int end) const
 
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)
 Sets the unstretched length of the cable, divided equally between its elements.
 
void AdvanceMeanTension (const double *adPosA, const double *adPosB, const double *adX, double T)
 
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.
 

Protected Member Functions

void AddAttractorForces (const double *const adX) const
 Adds the attractor forces to each cable node.
 
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 override
 Adds the forces from each cable element.
 
- Protected Member Functions inherited from InternalCable
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
 
double NodeInertia (unsigned long node) const
 

Protected Attributes

std::string m_attractorName
 
AttractorBase * m_attractor
 A pointer to the attractor to use.
 
AttractorBase::Motion m_attractorMotion
 As UpdateAttractorMotion found it.
 
- Protected Attributes inherited from InternalCableWithBottomContact
environment::EnvironmentProvider * m_environment
 
environment::SeafloorForcesInterface * m_seafloor
 
bool m_inBottomContact = false
 Whether AddElementForce added a seafloor force since the last OdeFcn began.
 
- Protected Attributes inherited from InternalCable
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.
 
double m_meanTensionTime = std::numeric_limits<double>::quiet_NaN()
 The time of the last AdvanceMeanTension.
 
CableElDynStiff ** m_cableElements
 An array holding the cable elements.
 
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]
 

Additional Inherited Members

- Public Attributes inherited from InternalCable
unsigned long m_numElements
 The number of elements to divide the cable into.
 
unsigned long m_numNodes
 The number of nodes of the cable.
 

Detailed Description

Author
Karl-Johan Reite

Member Function Documentation

◆ AddElementForce()

void InternalCableWithAttractor::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
overrideprotectedvirtual

Reimplemented from InternalCableWithBottomContact.

◆ FinalSetup()

virtual void InternalCableWithAttractor::FinalSetup ( const double  dT,
const double *const  adX,
ISimObjectCreator *const  creator 
)
virtual

Reimplemented from InternalCableWithBottomContact.

◆ OdeFcn()

virtual void InternalCableWithAttractor::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 from InternalCable.

◆ UpdateAttractorMotion()

void InternalCableWithAttractor::UpdateAttractorMotion ( double  dT,
const double *  adX 
) const

Takes the attractor's motion at (dT, adX), adX the model-global states, for the forces that follow. The owning cable calls it under its section lock before it evaluates the section.


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