FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
TorpedoAnchor.h
1#ifndef CTorpedoAnchor_H
2#define CTorpedoAnchor_H
3
91#include <fhsim/simobject/ISimObjectCreator.h>
92namespace rigidbody
93{
94class CRigidCompositeBody;
95};
96namespace environment
97{
98class EnvironmentProvider;
99}
100
101class TorpedoAnchor : public SimObject
102{
103 public:
104 TorpedoAnchor(const std::string& simObjectName, ISimObjectCreator* const creator);
106 void OdeFcn(const double T, const double* const X, double* const XDot) const;
107
108 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const creator);
109
110#ifdef FH_VISUALIZATION
111 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
112 virtual void RenderUpdate(const double T, const double* const X);
113#endif
114
115 const double* Position(const double T, const double* const X);
116 const double* Velocity(const double T, const double* const X);
117 const double* Theta(const double T, const double* const X);
118 const double* Omega(const double T, const double* const X);
119
120 // Jacobian support (partial: kinematics + quaternion dynamics; force terms omitted)
121 bool HasJacobians() const override;
122 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
123 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
124
125 protected:
127
128 double m_MaterialRho; // Total mass of anchor [kg]
129 double m_ShankLength; // Total volume displacement of anchor [m^3]
130 double m_ShankDiameter; // Relative added mass (to displaced fluid volume) [-]
131 double m_ShankThickness; // Total length of anchor [m]
132 double m_ShankFlukeAngle; // Length from anchor-tip to fluke [m]
133 double m_FlukeWidth; // Fluke width times fluke height [m^2]
134 double m_FlukeSideLength; // Main diameter of shank [m]
135 double m_FlukePointLength; // Length of fluke point [m]
136 double m_FlukeThickness; // Thickness of fluke [m]
137
138 ISignalPort* m_Force;
139 int m_PositionIndex;
140 int m_VelocityIndex;
141 int m_ThetaIndex;
142 int m_OmegaIndex;
143
144 environment::EnvironmentProvider* m_environment;
145
146#ifdef FH_VISUALIZATION
147 Ogre::SceneNode* m_RenderNode;
148#endif
149};
150
151#endif
Definition TorpedoAnchor.h:102
Definition CRigidCompositeBody.h:12