Marine systems simulation
SupergridWinchCable.h
1#pragma once
2
3#include "SupergridCable.h"
4#include <Eigen/StdVector>
5#include "InitializerTools3DCurve.h"
6#include <fstream>
7#include "Winch.h"
8
9#ifdef FH_VISUALIZATION
10#include "sfh/ogre/C3DArrow.h"
11#endif
12
13namespace CoRiBoDynamics {
14
15namespace Structures {
16
17
18class SupergridWinchCableCollisionManager;
19
28public:
29 SupergridWinchCable(ConstraintSolver* solver, ISimObjectCreator* creator, Environment_Interface* environment, int rigid_element_buffer_size, double beta, std::string name, Winch* winch);
31
32 Winch* GetWinch();
33
34 TowingBlock* GetTowingBlock();
35
41 void GetFirstFreeDiscreteElementIndex(int& super_ix, int& sub_ix);
42
47
48
53 virtual void AllocateElementBuffer(const double T, double* const X);
54
55 virtual bool InitialConditionSetup(const double T, double* const updatedIC, const vec3& PB, Winch::InitialStatesLoader winch_init_states);
56
57
58 /*
59 Extends SuperGridLineStructure with connection to winch, and straightening of subelements that are about to be merged to superelement
60 */
61 virtual void ComputeConstraints(const double T, const double * const X);
62
64
65 void SetTowingBlock(TowingBlock* towing_block);
66
67 virtual const std::vector<CollisionManager::ExternalObject*> GetTowingBlockGeometry();
68
69#ifdef FH_VISUALIZATION
70 virtual void RenderInit(Ogre::Root* const ogreRoot);
71 virtual void RenderUpdate(const double T, const double* const X);
72#endif
73
74 virtual void XmlInfo(TiXmlElement& xml_node);
75
76protected:
77 void InitializeElementAllocation();
78 void InitializeFreespanCurve(Utilities::CurveSegment* curve_initializer, double T, double* const updatedIC);
79
80 void ComputeDiscreteCableLength(size_t& super_ix, size_t& sub_ix, double &length);
81
82 size_t m_num_retracted_super;
83 size_t m_num_retracted_sub;
84 size_t m_sub_super_threshold_ix;
85 double m_sub_super_threshold_strength;
86 size_t m_num_free_rigid_elements;
87
89 TowingBlock* m_towing_block;
90
91 SupergridWinchCableCollisionManager* m_collision_manager;
92};
93
94
101public:
103
104 /*
105 Extends SupergridCableCollisionManager to check contact between cable elements and elements on winch.
106 Skips contact between first element and most recent element on winch
107 */
108 virtual void ComputeConstraints(const double T, const double * const X);
109
110
111 /*
112 Check contact between cable elements and base geometry of winch and block
113 */
114 void DrumAndBlock(const double * const X);
115
116protected:
117 SupergridWinchCable* m_winch_cable;
118};
119
120
121}
122}
Definition: ConstraintSolver.h:31
Definition: SupergridLineStructure.h:15
Definition: SupergridLineStructure.h:237
virtual void ComputeConstraints(const double T, const double *const X)
Definition: SupergridWinchCable.h:27
SupergridWinchCableCollisionManager * GetCollisionManager()
Computes structural connections.
virtual void ComputeConstraints(const double T, const double *const X)
Winch * m_winch
current number of inactive rigid elements in the "free tail"
Definition: SupergridWinchCable.h:88
virtual void AllocateElementBuffer(const double T, double *const X)
void InitializeFreespanCurve(Utilities::CurveSegment *curve_initializer, double T, double *const updatedIC)
initial coupling of rigid elements and discrete elements
void GetFirstFreeDiscreteElementIndex(int &super_ix, int &sub_ix)
Definition: Winch.h:34
Definition: InitializerTools3DCurve.h:13
Definition: CollisionManager.h:6