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

Public Member Functions

 Crowfoot (const std::string &simObjectName, ISimObjectCreator *const creator)
 Reads parameters, registers states, input/output ports and shared resources.
 
void OdeFcn (const double T, const double *const X, double *const XDot) const override
 
void AcceptedStep (const double T, const double *const X) override
 
void UpdateVelocity (const double T)
 Backward-differences the solved collecting point position.
 
virtual void InitialConditionSetup (const double dT, const double *const adCurrentIC, double *const adUpdatedIC, ISimObjectCreator *const creator)
 
virtual const double * PositionOut (const double t, const double *const x)
 
virtual const double * VelocityOut (const double t, const double *const x)
 
virtual const double * LineForceOut (const double t, const double *const x, int lineIndex)
 
virtual const double * LineTensionOut (const double t, const double *const x, int lineIndex)
 

Protected Attributes

int m_numLines
 
std::vector< const double * > m_linesPos
 
std::vector< double * > m_linesForce
 
std::vector< double > m_linesTension
 
ISignalPort ** m_inFasteningPositions
 
ISignalPort ** m_inLengths
 
ISignalPort * m_inExternalForce
 
CrowfootMathm_crowfoot
 
double m_velocity [3]
 
double m_instantPos [3]
 
double m_prevPos [3]
 Solved position at the previous accepted step.
 
double m_prevTime
 Time of the previous accepted step.
 
bool m_hasPrevPos
 Whether an accepted step has been seen yet.
 
sfh::filters::FIR m_filter
 

Constructor & Destructor Documentation

◆ Crowfoot()

Crowfoot::Crowfoot ( const std::string &  simObjectName,
ISimObjectCreator *const  creator 
)

The constructor performs all initial setup for a crow foot simobject. Reading in parameters, setting up communication interface i.e. output ports, input ports, and states, plus additional 'one time only' resource setup.

Reads the "NumLines" parameter. Registers the input ports "ExternalForce", "LinePos<N>" and "LineLength<N>" and the output ports "LineForce<N>", "LineTension<N>", "ExternalPos" and "ExternalVel". Registers no states.

Parameters
[in]simObjectName-> The name of the simobject
[in]creator-> Retrieve parameters. Register states, ports and shared resources

Member Function Documentation

◆ UpdateVelocity()

void Crowfoot::UpdateVelocity ( const double  T)

Divides the change in the solved position since the previous accepted step by the length of that step, and stores the result for the "ExternalVel" output port. The first accepted step has no predecessor, so the velocity is left at zero until a positive time interval is available.

Parameters
[in]T-> Current simulation time

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