11#ifndef CNetCableElementTest_H
12#define CNetCableElementTest_H
16#include "sfh/linalg.h"
18#include "NetCableElementTestSpec.h"
19#ifdef FH_VISUALIZATION
21#pragma warning( disable : 4251)
24#include "sfh/ogre/CDynamicLines.h"
32 static float m_rhoWater;
36 static float m_tangentialDragCoeffDisk;
37 static float m_tangentialFrictionCoeff;
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 rhoWater,
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 num);
87 void AddDisks(
float* adD,
float* adThickness,
float* adMass,
float* adPos, std::vector<std::string> VsDiskMaterial,
int num);
89#ifdef FH_VISUALIZATION
91 void RenderInit(Ogre::Root* ogreRoot);
94 void RenderUpdate(
const double adPosA[3],
const double adPosB[3]);
117#ifdef FH_VISUALIZATION
118 Ogre::Entity** m_renderSpheres;
119 Ogre::SceneNode** m_renderNodeSpheres;
120 Ogre::Entity** m_renderDisks;
121 Ogre::SceneNode** m_renderNodeDisks;
122 std::string m_materialName;
127 std::string m_cableName;
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_normalDragCoeff;
153 float m_dampingRatio;
158 float m_massInWater[2];
159 float m_weightInWater[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 NetCableElementTestSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementTest.h:30
void AddEndForces(const double rhoWater, 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.
int m_numSpheres
The number of spheres connected.
Definition NetCableElementTest.h:97
float * m_diskD
The diameter of the connected disks.
Definition NetCableElementTest.h:102
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:99
static float m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElementTest.h:34
void SetConstants()
Calculates parameters and sets physical constants.
float * m_diskMass
The mass of the connected disks.
Definition NetCableElementTest.h:104
static float m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElementTest.h:33
float * m_sphereD
The diameter of the connected spheres.
Definition NetCableElementTest.h:98
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElementTest.h:96
~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:105
bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementTest **sNewCable)
Divides the element in two.
int m_numDisks
The number of disks connected.
Definition NetCableElementTest.h:101
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition NetCableElementTest.h:107
NetCableElementTest(const NetCableElementTest *old)
The copy constructor.
float * m_diskThickness
The thickness of the connected disks.
Definition NetCableElementTest.h:103
static float m_tangentialFrictionCoeffDisk
The normal friction coefficient of a disk.
Definition NetCableElementTest.h:35
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:100
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElementTest.h:108