FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetCableElementWithConstraints.h
1
10
11#ifndef NetCableElementWithConstraints_H
12#define NetCableElementWithConstraints_H
13
14// Includes
15//#include <string>
16//#include <fhsim/FhSimMgr.h>
17#include "cable/subroutines/CableElDynStiff.h"
18#include "NetCableElementSpec.h"
19#ifdef FH_VISUALIZATION
20#pragma warning(push)
21#pragma warning( disable : 4251 )
22 #include <Ogre.h>
23#pragma warning(pop)
24 #include "sfh/ogre/CDynamicLines.h"
25//#include "MeshGenerators.h"
26#endif
27
28//Class definition
30{
31public:
34
38
41
44 double deltaT,
45 const double adPosA[3],
46 const double adVelA[3],
47 const double adPosB[3],
48 const double adVelB[3],
49 const double adFluidVel[3],
50 const double rhoWater,
51 double adForceA[3],
52 double adForceB[3]);
53
56
59
61 bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementWithConstraints** sNewCable);
62
65
66 void DeleteSpheresAndDisks();
67
68 void AddSpheres(double* adD, double* adMass, double* adPos, std::vector<std::string> VsSphereMaterial, int num);
69 void AddDisks(double* adD, double* adThickness, double* adMass, double* adPos, std::vector<std::string> VsDiskMaterial, int num);
70
71#ifdef FH_VISUALIZATION
73 void RenderInit(Ogre::Root* ogreRoot);
74
76 void RenderUpdate( const double adPosA[3], const double adPosB[3]);
77#endif
78 double m_nodeOffset;
79 int m_fromNodes[2];
80 int m_conn[2];
83 double* m_sphereD;
84 double* m_sphereMass;
85 double* m_spherePos;
87 double* m_diskD;
89 double* m_diskMass;
90 double* m_diskPos;
92 std::vector<std::string> m_VsDiskMeshName;
93 std::vector<std::string> m_VsSphereMeshName;
94
95protected:
96
98 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
99
100 // Constants
104
105#ifdef FH_VISUALIZATION
106 Ogre::Entity** m_renderSpheres;
107 Ogre::SceneNode** m_renderNodeSpheres;
108 Ogre::Entity** m_renderDisks;
109 Ogre::SceneNode** m_renderNodeDisks;
110#endif
111
112};
113
114
115#endif
Definition CableElDynStiff.h:34
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementWithConstraints.h:30
double m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElementWithConstraints.h:102
double * m_diskD
The diameter of the connected disks.
Definition NetCableElementWithConstraints.h:87
~NetCableElementWithConstraints()
The destructor.
NetCableElementWithConstraints(const NetCableElementWithConstraints *old)
The copy constructor.
int m_numDisks
The number of disks connected.
Definition NetCableElementWithConstraints.h:86
int m_fromNodes[2]
The nodes which this cable is constructed by dividing.
Definition NetCableElementWithConstraints.h:79
double * m_spherePos
The position of the connected spheres.
Definition NetCableElementWithConstraints.h:85
double * m_diskPos
The position of the connected disks.
Definition NetCableElementWithConstraints.h:90
int m_numSpheres
The number of spheres connected.
Definition NetCableElementWithConstraints.h:82
void AddEndForces(double deltaT, const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3], const double adFluidVel[3], const double rhoWater, double adForceA[3], double adForceB[3])
Calculates the end forces on the cable element.
void AddHydroForcesAppendices(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on spheres and disks attached to the cable.
NetCableElementWithConstraints()
The constructor.
double m_refineFactor
The factor telling how much mesh refinement is desired for this element.
Definition NetCableElementWithConstraints.h:81
void SetConstants()
Calculates parameters and sets physical constants.
double * m_diskThickness
The thickness of the connected disks.
Definition NetCableElementWithConstraints.h:88
double m_nodeOffset
The offset between the original nodes of the added node of this cable.
Definition NetCableElementWithConstraints.h:78
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
double m_tangentialFrictionCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElementWithConstraints.h:103
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElementWithConstraints.h:93
double m_addedWeightInWater
The weight in water added to the element.
Definition NetCableElementWithConstraints.h:91
double * m_sphereMass
The mass of the connected spheres.
Definition NetCableElementWithConstraints.h:84
double * m_diskMass
The mass of the connected disks.
Definition NetCableElementWithConstraints.h:89
double m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElementWithConstraints.h:101
double * m_sphereD
The diameter of the connected spheres.
Definition NetCableElementWithConstraints.h:83
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition NetCableElementWithConstraints.h:92
bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementWithConstraints **sNewCable)
Divides the element in two.
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElementWithConstraints.h:80