|
FhSim
3.1.0
Marine systems simulation
|
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. | |
| virtual bool | InBottomContact () const |
| 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. | |
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 |
| double | NodeInertia (unsigned long node) const |
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. | |
| 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] |
|
protectedvirtual |
Reimplemented in InternalCableWithAttractor.
| 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).
| posA | Position of cable endpoint A. |
| velA | Velocity of cable endpoint A. |
| posB | Position of cable endpoint B. |
| velB | Velocity of cable endpoint B. |
| globalPosIdxA | Global state index of posA; -1 if posA comes from a port. |
| globalVelIdxA | Global state index of velA; -1 if velA comes from a port. |
| globalPosIdxB | Global state index of posB; -1 if posB comes from a port. |
| globalVelIdxB | Global state index of velB; -1 if velB comes from a port. |
| endInertiaA | Inertia of junction node A (used when globalPosIdxA >= 0). |
| endInertiaB | Inertia of junction node B (used when globalPosIdxB >= 0). |
| X | Local state slice (adX + stateOffset from the SimObject's perspective). |
| J | Row-major Jacobian matrix (nStates x nStates), accumulated into. |
| nStates | Total state count for this SimObject. |
| stateOffset | Offset of this cable's states within the SimObject's state vector. |
| void InternalCable::AdvanceMeanTension | ( | const double * | adPosA, |
| const double * | adPosB, | ||
| const double * | adX, | ||
| double | T | ||
| ) |
Advances the elements' dynamic-stiffness mean tension once per integrator step (owner ruling R64, MARE-0357): the owner calls this from PreOdeFcn with the step's start state, and OdeFcn and the port calculations only read it. A second call at the same or an earlier time does nothing (MARE-0330).
| adPosA | The position of end A [m]. |
| adPosB | The position of end B [m]. |
| adX | The states of this cable. |
| T | The time of the step start [s]. |
| 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), the wave excitation (R104). stateOffset: byte offset of this cable's states within the SimObject's global state vector.
| double InternalCable::EndInertia | ( | int | end | ) | const |
The inertia this cable gives end A or B (0 or 1): the end element's share of its mass, at the state the elements were last evaluated at.
| void InternalCable::EvaluateElementsAt | ( | const double * | adPosA, |
| const double * | adVelA, | ||
| const double * | adPosB, | ||
| const double * | adVelB, | ||
| const double * | adX, | ||
| double | dT | ||
| ) | const |
Evaluates the elements at a state as OdeFcn does, without the derivatives, so that the masses the Jacobian divides by are those of that state (MARE-0359). Call it before ComputeStructuralJacobian.
| adPosA | The position of end A. |
| adVelA | The velocity of end A. |
| adPosB | The position of end B. |
| adVelB | The velocity of end B. |
| adX | The states of this cable. |
| dT | The time [s]. |
|
inlinevirtual |
Whether the seafloor gave this section a force at its last OdeFcn (FISH-0086); a section without bottom contact never has one.
Reimplemented in InternalCableWithBottomContact.
|
protected |
The inertia of internal node node: its share of the masses of its two elements, at the state the elements were last evaluated at (MARE-0325).
|
virtual |
Reimplemented in InternalCableWithAttractor, and InternalCableWithBottomContact.