11#ifndef CNetCableElementTest_H
12#define CNetCableElementTest_H
16#include "sfh/linalg.h"
18#include "CNetCableElementTestSpec.h"
19#ifdef FH_VISUALIZATION
21#pragma warning( disable : 4251)
24#include "sfh/ogre/CDynamicLines.h"
32 static float m_dRhoWater;
36 static float m_dTangentialDragCoeffDisk;
37 static float m_dTangentialFrictionCoeff;
42 static void *
operator new (
size_t size)
45 return _aligned_malloc(size,16);
49 return aligned_alloc(16, size);
53 static void operator delete(
void *p )
70 void AddEndForces(
const double dRhoWater,
const sfh::linalg::sse_vec3f &posa,
const sfh::linalg::sse_vec3f &posb,
const sfh::linalg::sse_vec3f &vela,
const sfh::linalg::sse_vec3f &velb,
const sfh::linalg::sse_vec3f &velf, sfh::linalg::sse_vec3f &forceA,sfh::linalg::sse_vec3f &forceB,
double angle );
84 void DeleteSpheresAndDisks();
86 void AddSpheres(
float* adD,
float* adMass,
float* adPos, std::vector<std::string> VsSphereMaterial,
int iNum);
87 void AddDisks(
float* adD,
float* adThickness,
float* adMass,
float* adPos, std::vector<std::string> VsDiskMaterial,
int iNum);
89#ifdef FH_VISUALIZATION
91 void RenderInit(Ogre::Root* pOgreRoot);
94 void RenderUpdate(
const double adPosA[3],
const double adPosB[3]);
117#ifdef FH_VISUALIZATION
118 Ogre::Entity** m_aRenderSpheres;
119 Ogre::SceneNode** m_aRenderNodeSpheres;
120 Ogre::Entity** m_aRenderDisks;
121 Ogre::SceneNode** m_aRenderNodeDisks;
122 std::string m_sMaterialName;
127 std::string m_sCableName;
129 sfh::linalg::sse_vec3f n;
130 sfh::linalg::sse_vec3f n2[2];
132 sfh::linalg::sse_vec3f vel;
133 sfh::linalg::sse_vec3f vel_t;
134 sfh::linalg::sse_vec3f vel_n;
135 sfh::linalg::sse_vec3f vel_n_a;
136 sfh::linalg::sse_vec3f vel_n_b;
138 sfh::linalg::sse_vec3f f_struct;
139 sfh::linalg::sse_vec3f f_drag_a, f_drag_b;
141 sfh::linalg::sse_vec3f force_sphere_a;
142 sfh::linalg::sse_vec3f force_sphere_b;
143 sfh::linalg::sse_vec3f force_disk_a,force_disk_b;
151 float m_dNormalDragCoeff;
153 float m_dDampingRatio;
158 float m_adMassInWater[2];
159 float m_adWeightInWater[2];
166 float lengthArray[3];
167 float compressionvelArray[3];
169 float m_compressionSpeed;
175 float structForceArray[3];
176 float ma_dDampingCoeff;
178 float ma_dNormalDragFactor;
179 float ma_dTangentialDragFactor;
182 float m_dragReduction;
183 float m_projectedArea;
184 float m_normalVelocity;
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition: CNetCableElementTestSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition: CNetCableElementTest.h:30
float * m_adSphereMass
The mass of the connected spheres.
Definition: CNetCableElementTest.h:99
static float m_dTangentialFrictionCoeffDisk
The normal friction coefficient of a disk.
Definition: CNetCableElementTest.h:35
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: CNetCableElementTest.h:97
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
static float m_dDragCoeffSphere
The drag coefficient of a sphere.
Definition: CNetCableElementTest.h:33
float * m_adSphereD
The diameter of the connected spheres.
Definition: CNetCableElementTest.h:98
float * m_adSpherePos
The position of the connected spheres.
Definition: CNetCableElementTest.h:100
void AddEndForces(const double dRhoWater, const sfh::linalg::sse_vec3f &posa, const sfh::linalg::sse_vec3f &posb, const sfh::linalg::sse_vec3f &vela, const sfh::linalg::sse_vec3f &velb, const sfh::linalg::sse_vec3f &velf, sfh::linalg::sse_vec3f &forceA, sfh::linalg::sse_vec3f &forceB, double angle)
Calculates the end forces on the cable element.
void SetConstants()
Calculates parameters and sets physical constants.
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
float * m_adDiskD
The diameter of the connected disks.
Definition: CNetCableElementTest.h:102
float * m_adDiskPos
The position of the connected disks.
Definition: CNetCableElementTest.h:105
CNetCableElementTest()
The constructor.
bool Divide(int aiNodes[2], int iNewNode, int iNewElementID, CNetCableElementTest **pSNewCable)
Divides the element in two.
float * m_adDiskMass
The mass of the connected disks.
Definition: CNetCableElementTest.h:104
int m_iNumDisks
The number of disks connected.
Definition: CNetCableElementTest.h:101
CNetCableElementTest(const CNetCableElementTest *pOld)
The copy constructor.
int m_conn[2]
The node numbers that the element is connected to.
Definition: CNetCableElementTest.h:96
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition: CNetCableElementTest.h:108
~CNetCableElementTest()
The destructor.
float * m_adDiskThickness
The thickness of the connected disks.
Definition: CNetCableElementTest.h:103
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition: CNetCableElementTest.h:107
static float m_dNormalDragCoeffDisk
The normal drag coefficient of a disk.
Definition: CNetCableElementTest.h:34