22 #ifndef __ND_BODY_SPH_FLUID_CPU_H__
23 #define __ND_BODY_SPH_FLUID_CPU_H__
25 #include "ndNewtonStdafx.h"
26 #include "ndBodyParticleSet.h"
36 ndFloat32 GetViscosity()
const;
37 void SetViscosity(ndFloat32 viscosity);
39 ndFloat32 GetParticleMass()
const;
40 void SetParticleMass(ndFloat32 mass);
42 ndFloat32 GetRestDensity()
const;
43 void SetRestDensity(ndFloat32 resDensity);
45 ndFloat32 GetGasConstant()
const;
46 void SetGasConstant(ndFloat32 gasConst);
48 ndFloat32 GetSphGridSize()
const;
53 D_NEWTON_API
void Execute(
ndThreadPool*
const threadPool);
56 D_NEWTON_API
virtual void Update(
const ndWorld*
const world, ndFloat32 timestep);
79 void CalculateAccelerations(
ndThreadPool*
const threadPool);
80 void CalculateParticlesDensity(
ndThreadPool*
const threadPool);
84 ndFloat32 m_viscosity;
85 ndFloat32 m_restDensity;
86 ndFloat32 m_gasConstant;
88 } D_GCC_NEWTON_ALIGN_32 ;
100 inline ndFloat32 ndBodySphFluid::GetViscosity()
const
105 inline void ndBodySphFluid::SetViscosity(ndFloat32 viscosity)
107 m_viscosity = viscosity;
110 inline ndFloat32 ndBodySphFluid::GetParticleMass()
const
115 inline void ndBodySphFluid::SetParticleMass(ndFloat32 mass)
120 inline ndFloat32 ndBodySphFluid::GetRestDensity()
const
122 return m_restDensity;
125 inline void ndBodySphFluid::SetRestDensity(ndFloat32 restDensity)
127 m_restDensity = restDensity;
130 inline ndFloat32 ndBodySphFluid::GetGasConstant()
const
132 return m_gasConstant;
135 inline void ndBodySphFluid::SetGasConstant(ndFloat32 gasConst)
137 m_gasConstant = gasConst;
140 inline ndFloat32 ndBodySphFluid::GetSphGridSize()
const
142 return GetParticleRadius() * ndFloat32(2.0f) * ndFloat32(1.5f);