Marine systems simulation
CNetCableElementWithConstraints.h
1
10
11#ifndef CNetCableElementWithConstraints_H
12#define CNetCableElementWithConstraints_H
13
14// Includes
15//#include <string>
16//#include "CFhSimMgr.h"
17#include "cable/subroutines/CCableElDynStiff.h"
18#include "CNetCableElementSpec.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 dDeltaT,
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 dRhoWater,
51 double adForceA[3],
52 double adForceB[3]);
53
56
59
61 bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetCableElementWithConstraints** pSNewCable);
62
65
66 void DeleteSpheresAndDisks();
67
68 void AddSpheres(double* adD, double* adMass, double* adPos, std::vector<std::string> VsSphereMaterial, int iNum);
69 void AddDisks(double* adD, double* adThickness, double* adMass, double* adPos, std::vector<std::string> VsDiskMaterial, int iNum);
70
71#ifdef FH_VISUALIZATION
73 void RenderInit(Ogre::Root* pOgreRoot);
74
76 void RenderUpdate( const double adPosA[3], const double adPosB[3]);
77#endif
79 int m_iFromNodes[2];
80 int m_aiConn[2];
83 double* m_adSphereD;
85 double* m_adSpherePos;
87 double* m_adDiskD;
89 double* m_adDiskMass;
90 double* m_adDiskPos;
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_aRenderSpheres;
107 Ogre::SceneNode** m_aRenderNodeSpheres;
108 Ogre::Entity** m_aRenderDisks;
109 Ogre::SceneNode** m_aRenderNodeDisks;
110#endif
111
112};
113
114
115#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: CNetCableElementWithConstraints.h:30
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition: CNetCableElementWithConstraints.h:93
double * m_adSphereMass
The mass of the connected spheres.
Definition: CNetCableElementWithConstraints.h:84
double m_dAddedWeightInWater
The weight in water added to the element.
Definition: CNetCableElementWithConstraints.h:91
double m_dRefineFactor
The factor telling how much mesh refinement is desired for this element.
Definition: CNetCableElementWithConstraints.h:81
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
double * m_adDiskPos
The position of the connected disks.
Definition: CNetCableElementWithConstraints.h:90
CNetCableElementWithConstraints()
The constructor.
void SetConstants()
Calculates parameters and sets physical constants.
int m_aiConn[2]
The node numbers that the element is connected to.
Definition: CNetCableElementWithConstraints.h:80
double * m_adDiskD
The diameter of the connected disks.
Definition: CNetCableElementWithConstraints.h:87
double * m_adDiskMass
The mass of the connected disks.
Definition: CNetCableElementWithConstraints.h:89
double m_dNormalDragCoeffDisk
The normal drag coefficient of a disk.
Definition: CNetCableElementWithConstraints.h:102
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
double m_dNodeOffset
The offset between the original nodes of the added node of this cable.
Definition: CNetCableElementWithConstraints.h:78
double * m_adSphereD
The diameter of the connected spheres.
Definition: CNetCableElementWithConstraints.h:83
int m_iNumDisks
The number of disks connected.
Definition: CNetCableElementWithConstraints.h:86
double * m_adDiskThickness
The thickness of the connected disks.
Definition: CNetCableElementWithConstraints.h:88
int m_iFromNodes[2]
The nodes which this cable is constructed by dividing.
Definition: CNetCableElementWithConstraints.h:79
CNetCableElementWithConstraints(const CNetCableElementWithConstraints *pOld)
The copy constructor.
void AddEndForces(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, double adForceA[3], double adForceB[3])
Calculates the end forces on the cable element.
double m_dDragCoeffSphere
The drag coefficient of a sphere.
Definition: CNetCableElementWithConstraints.h:101
~CNetCableElementWithConstraints()
The destructor.
double * m_adSpherePos
The position of the connected spheres.
Definition: CNetCableElementWithConstraints.h:85
void AddHydroForcesAppendices(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on spheres and disks attached to the cable.
int m_iNumSpheres
The number of spheres connected.
Definition: CNetCableElementWithConstraints.h:82
double m_dTangentialFrictionCoeffDisk
The normal drag coefficient of a disk.
Definition: CNetCableElementWithConstraints.h:103
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition: CNetCableElementWithConstraints.h:92
bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetCableElementWithConstraints **pSNewCable)
Divides the element in two.