11#ifndef CNetCableElementTest_H
12#define CNetCableElementTest_H
19#include "sfh/linalg.h"
22#include "NetCableElementTestSpec.h"
23#ifdef FH_VISUALIZATION
25#pragma warning( disable : 4251)
28#include "sfh/ogre/CDynamicLines.h"
36 static float m_rhoWater;
40 static float m_tangentialDragCoeffDisk;
41 static float m_tangentialFrictionCoeff;
54 void AddEndForces(
const double rhoWater,
const NetVec3f &posa,
const NetVec3f &posb,
const NetVec3f &vela,
const NetVec3f &velb,
const NetVec3f &velf, NetVec3f &forceA,NetVec3f &forceB,
double angle );
68 void DeleteSpheresAndDisks();
70 void AddSpheres(
float* adD,
float* adMass,
float* adPos, std::vector<std::string> VsSphereMaterial,
int num);
71 void AddDisks(
float* adD,
float* adThickness,
float* adMass,
float* adPos, std::vector<std::string> VsDiskMaterial,
int num);
73#ifdef FH_VISUALIZATION
75 void RenderInit(Ogre::Root* ogreRoot);
78 void RenderUpdate(
const double adPosA[3],
const double adPosB[3]);
101#ifdef FH_VISUALIZATION
102 Ogre::Entity** m_renderSpheres;
103 Ogre::SceneNode** m_renderNodeSpheres;
104 Ogre::Entity** m_renderDisks;
105 Ogre::SceneNode** m_renderNodeDisks;
106 std::string m_materialName;
111 std::string m_cableName;
123 NetVec3f f_drag_a, f_drag_b;
125 NetVec3f force_sphere_a;
126 NetVec3f force_sphere_b;
127 NetVec3f force_disk_a,force_disk_b;
135 float m_normalDragCoeff;
137 float m_dampingRatio;
142 float m_massInWater[2];
143 float m_weightInWater[2];
150 float lengthArray[3];
151 float compressionvelArray[3];
153 float m_compressionSpeed;
159 float structForceArray[3];
160 float ma_dDampingCoeff;
162 float ma_dNormalDragFactor;
163 float ma_dTangentialDragFactor;
166 float m_dragReduction;
167 float m_projectedArea;
168 float m_normalVelocity;
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementTestSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementTest.h:34
int m_numSpheres
The number of spheres connected.
Definition NetCableElementTest.h:81
float * m_diskD
The diameter of the connected disks.
Definition NetCableElementTest.h:86
NetCableElementTest()
The constructor.
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
float * m_sphereMass
The mass of the connected spheres.
Definition NetCableElementTest.h:83
static float m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElementTest.h:38
void SetConstants()
Calculates parameters and sets physical constants.
float * m_diskMass
The mass of the connected disks.
Definition NetCableElementTest.h:88
static float m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElementTest.h:37
float * m_sphereD
The diameter of the connected spheres.
Definition NetCableElementTest.h:82
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElementTest.h:80
~NetCableElementTest()
The destructor.
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
float * m_diskPos
The position of the connected disks.
Definition NetCableElementTest.h:89
bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementTest **sNewCable)
Divides the element in two.
void AddEndForces(const double rhoWater, const NetVec3f &posa, const NetVec3f &posb, const NetVec3f &vela, const NetVec3f &velb, const NetVec3f &velf, NetVec3f &forceA, NetVec3f &forceB, double angle)
Calculates the end forces on the cable element.
int m_numDisks
The number of disks connected.
Definition NetCableElementTest.h:85
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition NetCableElementTest.h:91
NetCableElementTest(const NetCableElementTest *old)
The copy constructor.
float * m_diskThickness
The thickness of the connected disks.
Definition NetCableElementTest.h:87
static float m_tangentialFrictionCoeffDisk
The normal friction coefficient of a disk.
Definition NetCableElementTest.h:39
void AddHydroForcesAppendices(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on spheres and disks attached to the cable.
float * m_spherePos
The position of the connected spheres.
Definition NetCableElementTest.h:84
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElementTest.h:92