99#include <fhsim_environment/hydrodynamics/CylinderHydro.h>
101#include <Eigen/Eigen>
104#include "CableJointMoment.h"
105#include "cable/GaussPointDrag.h"
106#include "ElementInertia.h"
108#include <fhsim/PrintDuringExec.h>
109#include <fhsim/simobject/SimObject.h>
110#include <fhsim_environment/EnvironmentProvider.h>
111#include <fhsim_environment/SeafloorForcesInterface.h>
112#include <fhsim_environment/ElementFlowInteraction.h>
113#ifdef FH_VISUALIZATION
114# include "sfh/ogre/C3DLine.h"
128inline bool IsBelowSurface(
double z,
double surfaceElevation)
130 return z + surfaceElevation > 0.0;
228 CableRM(
const std::string& simObjectName, ISimObjectCreator*
const creator);
239 void OdeFcn(
const double T,
const double*
const X,
double*
const XDot)
const;
241 void InitialConditionSetup(
const double T,
const double*
const currentIC,
double*
const updatedIC, ISimObjectCreator*
const creator);
242 void FinalSetup(
const double T,
const double*
const X, ISimObjectCreator*
const creator);
244 void PreOdeFcn(
const double T,
const double*
const X)
override;
255 const double*
forceA(
const double T,
const double*
const X);
265 const double*
forceB(
const double T,
const double*
const X);
285 void QueryJointWater(
const double T,
const double*
const X);
286 void calculationsCommon(
const double T,
const double*
const X)
const;
288#ifdef FH_VISUALIZATION
289 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
290 void RenderUpdate(
const double T,
const double*
const X);
294 typedef Eigen::Matrix<double, 3, 3> mat3;
295 typedef Eigen::Matrix<double, 3, 1> vec3;
305 void DistributeCatenary(Eigen::Matrix<double, 3, 1> P1, Eigen::Matrix<double, 3, 1> P2,
double L,
double lengthA,
double lengthB,
const double* currentIC,
double* states,
int i1,
int i2);
309 void DistributeOnArcMidpoints(
const vec3& P1,
const Eigen::Matrix<double, 2, 1>& CatenaryU,
double HorizontalDistance,
double VerticalDifference,
double L,
const double* currentIC,
double* states,
int i1,
int i2);
313 void SetElementUnlessUserSet(
int i,
const vec3& centre,
double angle,
const Eigen::Matrix<double, 2, 1>& CatenaryU,
const double* currentIC,
double* states);
323 environment::wake::ElementFlowInteraction
m_flow;
326 double m_totalLength;
374 ISignalPort* m_retractedLengthA;
375 ISignalPort* m_retractedLengthB;
376 ISignalPort* m_retractedSpeedA;
377 ISignalPort* m_retractedSpeedB;
379 int m_retractedNodesA;
380 int m_retractedNodesB;
412 ICommonComputation* m_calcDynamics;
413 Eigen::Matrix<double, Eigen::Dynamic, 1> m_lambda;
414 Eigen::Matrix<double, Eigen::Dynamic, 1> m_F_MDotV;
415 Eigen::Matrix<double, Eigen::Dynamic, 1> m_B;
420#ifdef FH_VISUALIZATION
422 Ogre::SceneNode** m_ManualObjectNodes;
bool m_gaussPointDrag
Gauss-point drag with the water at the joints (MARE-0396).
Definition Cable.h:352
void ReportError(const std::string &message) const
void BuildChain(wet_cylinder_water::ChainJoints &chain, const double *X, int firstElement, int numElements) const
Builds chain from elements firstElement ... firstElement + numElements - 1 at the state X.
Retraction ClampRetraction(double lengthA, double lengthB, double speedA, double speedB) const
CableRM(const std::string &simObjectName, ISimObjectCreator *const creator)
Reads parameters, registers states, input/output ports and shared resources.
environment::wake::ElementFlowInteraction m_flow
The flow at the element centres, the other objects' wakes taken per step (MARE-0223); the Environment...
Definition Cable.h:323
wet_cylinder_water::ChainJoints m_takeJoints
The joints of all elements, where the wakes are taken (PreOdeFcn); buffers kept from call to call.
Definition Cable.h:354
void SetElementUnlessUserSet(int i, const vec3 ¢re, double angle, const Eigen::Matrix< double, 2, 1 > &CatenaryU, const double *currentIC, double *states)
PrintDuringExec * m_print
Null if the creator has no printer (fhsim::kSimMgrKeyPrinter), as in a unit test.
Definition Cable.h:321
void DistributeOnArcMidpoints(const vec3 &P1, const Eigen::Matrix< double, 2, 1 > &CatenaryU, double HorizontalDistance, double VerticalDifference, double L, const double *currentIC, double *states, int i1, int i2)
void PreOdeFcn(const double T, const double *const X) override
Takes the other objects' wakes at the centres of all elements for the step (MARE-0223).
void DistributeCatenary(Eigen::Matrix< double, 3, 1 > P1, Eigen::Matrix< double, 3, 1 > P2, double L, double lengthA, double lengthB, const double *currentIC, double *states, int i1, int i2)
JointLaw m_joint
The bending and twist moments of the joints between the elements (MARE-0395).
Definition Cable.h:333
const double * forceB(const double T, const double *const X)
Output port. Returns current force in endpoint B of cable.
const double * forceA(const double T, const double *const X)
Output port. Returns current force in endpoint A of cable.
environment::SeafloorForcesInterface * m_seafloor
The shared SeafloorForces, from FinalSetup: the soil load of each element, a rigid cylinder.
Definition Cable.h:322
void calculations(const double T, const double *const X)
Performs a series of computations within the cable object.
void OdeFcn(const double T, const double *const X, double *const XDot) const
Computes object derivatives as a function of time, states and input ports.
wet_cylinder_water::ChainJoints m_chainJoints
The joints of the free elements and the water at them; buffers kept from call to call.
Definition Cable.h:353
Definition GaussPointDrag.h:58
The retraction of the two ends as the model uses it at one instant (ClampRetraction).
Definition Cable.h:385
int nodesB
Whole elements retracted at end B.
Definition Cable.h:391
double lengthB
Retracted length at end B [m], after the limits.
Definition Cable.h:387
int nodesA
Whole elements retracted at end A.
Definition Cable.h:390
double speedA
Retraction speed at end A [m/s]; 0 where the length was limited.
Definition Cable.h:388
double speedB
Retraction speed at end B [m/s]; 0 where the length was limited.
Definition Cable.h:389
double lengthA
Retracted length at end A [m], after the limits.
Definition Cable.h:386
mat3 MiT
The inverse of the translational inertia with the added mass normal to the axis, global frame (MARE-0...
Definition Cable.h:363
mat3 Mi
The inverse of the rotational inertia, global frame.
Definition Cable.h:362
Definition CableJointMoment.h:26