Marine systems simulation
CNetCableElement.h
1
10
11#ifndef CNetCableElement_H
12#define CNetCableElement_H
13
14// Includes
15//#include <string>
16
17//#include "CFhSimMgr.h"
18#include "cable/subroutines/CCableElDynStiff.h"
19#include "CNetCableElementSpec.h"
20#ifdef FH_VISUALIZATION
21#pragma warning(push)
22#pragma warning( disable : 4251 )
23 #include <Ogre.h>
24#pragma warning(pop)
25
26 #include "sfh/ogre/CDynamicLines.h"
27 //#include "MeshGenerators.h"
28#endif
29
30//Class definition
32{
33public:
35
38
40
41 // Calculates the end forces on the cable element.
42 void AddEndForces(
43 double dDeltaT,
44 const double adPosA[3],
45 const double adVelA[3],
46 const double adPosB[3],
47 const double adVelB[3],
48 const double adFluidVel[3],
49 const double dRhoWater,
50 double adForceA[3],
51 double adForceB[3],
52 bool isScreen = false);
53
56
59
61 bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetCableElement** pSNewCable);
62
65
66 void DeleteSpheresAndDisks();
67
68 void AddSpheres(double* adD, double* adMass, double* adPos, std::vector<std::string> VsSphereMaterial, unsigned int iNum);
69 void AddDisks(double* adD, double* adThickness, double* adMass, double* adPos, std::vector<std::string> VsDiskMaterial, unsigned int iNum);
70
71 double GetStrainEnergy(double dDeltaT, const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3],const double adFluidVel[3],const double dRhoWater);
72
73#ifdef FH_VISUALIZATION
75 void RenderInit(Ogre::Root* pOgreRoot);
76
78 void RenderUpdate( const double adPosA[3], const double adPosB[3]);
79#endif
81 int m_iFromNodes[2];
82 int m_aiConn[2];
84 unsigned int m_iNumSpheres;
85 double* m_adSphereD;
87 double* m_adSpherePos;
88 unsigned int m_iNumDisks;
89 double* m_adDiskD;
91 double* m_adDiskMass;
92 double* m_adDiskPos;
94 std::vector<std::string> m_VsDiskMeshName;
95 std::vector<std::string> m_VsSphereMeshName;
96
97protected:
98
100 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
101
102 // Constants
106
107#ifdef FH_VISUALIZATION
108 Ogre::Entity** m_aRenderSpheres;
109 Ogre::SceneNode** m_aRenderNodeSpheres;
110 Ogre::Entity** m_aRenderDisks;
111 Ogre::SceneNode** m_aRenderNodeDisks;
112#endif
113
114};
115
116
117#endif
Definition: CCableElDynStiff.h:33
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition: CNetCableElementSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition: CNetCableElement.h:32
double * m_adDiskD
The diameter of the connected disks.
Definition: CNetCableElement.h:89
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
double m_dDragCoeffSphere
The drag coefficient of a sphere.
Definition: CNetCableElement.h:103
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition: CNetCableElement.h:94
double m_dTangentialFrictionCoeffDisk
The normal drag coefficient of a disk.
Definition: CNetCableElement.h:105
bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetCableElement **pSNewCable)
Divides the element in two.
int m_iFromNodes[2]
The nodes which this cable is constructed by dividing.
Definition: CNetCableElement.h:81
double m_dRefineFactor
The factor telling how much mesh refinement is desired for this element.
Definition: CNetCableElement.h:83
double m_dNodeOffset
The offset between the original nodes of the added node of this cable.
Definition: CNetCableElement.h:80
double * m_adSphereMass
The mass of the connected spheres.
Definition: CNetCableElement.h:86
double * m_adDiskThickness
The thickness of the connected disks.
Definition: CNetCableElement.h:90
double * m_adSpherePos
The position of the connected spheres.
Definition: CNetCableElement.h:87
unsigned int m_iNumSpheres
The number of spheres connected.
Definition: CNetCableElement.h:84
double m_dNormalDragCoeffDisk
The normal drag coefficient of a disk.
Definition: CNetCableElement.h:104
double * m_adSphereD
The diameter of the connected spheres.
Definition: CNetCableElement.h:85
double * m_adDiskMass
The mass of the connected disks.
Definition: CNetCableElement.h:91
double * m_adDiskPos
The position of the connected disks.
Definition: CNetCableElement.h:92
void AddHydroForcesAppendices(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on spheres and disks attached to the cable.
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition: CNetCableElement.h:95
double m_dAddedWeightInWater
The weight in water added to the element.
Definition: CNetCableElement.h:93
int m_aiConn[2]
The node numbers that the element is connected to.
Definition: CNetCableElement.h:82
unsigned int m_iNumDisks
The number of disks connected.
Definition: CNetCableElement.h:88
void SetConstants()
Calculates parameters and sets physical constants.