Go to the documentation of this file.
16 #ifndef SURGSIM_PARTICLES_SPHREPRESENTATION_H
17 #define SURGSIM_PARTICLES_SPHREPRESENTATION_H
29 namespace DataStructures
31 template <
class T,
size_t N>
38 SURGSIM_STATIC_REGISTRATION(SphRepresentation);
161 Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>
m_normal;
185 std::shared_ptr<SurgSim::DataStructures::Grid<size_t, 3>>
m_grid;
205 #endif // SURGSIM_PARTICLES_SPHREPRESENTATION_H
void setViscosity(double viscosity)
Set the viscosity coefficient.
Definition: SphRepresentation.cpp:121
double getFriction() const
Get the sliding coefficient of friction for the particles during collisions.
Definition: SphRepresentation.cpp:177
void computeNeighbors()
Compute the neighbors.
Definition: SphRepresentation.cpp:239
double m_hSquared
Definition: SphRepresentation.h:177
Definitions of small fixed-size vector types.
double m_damping
Collision damping.
Definition: SphRepresentation.h:170
std::unordered_map< std::shared_ptr< SurgSim::Collision::Representation >, std::list< std::shared_ptr< SurgSim::Collision::Contact > > > ContactMapType
Definition: Representation.h:47
void computeDensityAndPressureField()
Compute the density and pressure field.
Definition: SphRepresentation.cpp:250
double m_kernelPoly6Gradient
Definition: SphRepresentation.h:179
double m_friction
Collision sliding friction coefficient.
Definition: SphRepresentation.h:171
double m_kernelViscosityLaplacian
Definition: SphRepresentation.h:181
double m_kernelPoly6
Definition: SphRepresentation.h:178
void setStiffness(double stiffness)
Set the particles stiffness when colliding.
Definition: SphRepresentation.cpp:152
double m_surfaceTension
Surface tension.
Definition: SphRepresentation.h:168
double m_mass
Mass per particle (determine the density of particle per m3)
Definition: SphRepresentation.h:165
double getDamping() const
Get the particles damping when colliding.
Definition: SphRepresentation.cpp:167
double m_gasStiffness
Stiffness of the gas considered.
Definition: SphRepresentation.h:167
SurgSim::Math::Vector3d getGravity() const
Get the gravity vector (default is (0 -9.81 0))
Definition: SphRepresentation.cpp:116
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
bool doUpdate(double dt) override
Implementation of the specific behavior of the particle system.
Definition: SphRepresentation.cpp:215
Definition: CompoundShapeToGraphics.cpp:30
double getDensity() const
Get the density of the fluid.
Definition: SphRepresentation.cpp:81
Math::Vector m_density
Particles' density.
Definition: SphRepresentation.h:163
void setDensity(double density)
Set the density of the fluid.
Definition: SphRepresentation.cpp:74
void setDamping(double damping)
Set the particles damping when colliding.
Definition: SphRepresentation.cpp:162
Eigen::Matrix< double, Eigen::Dynamic, 3, Eigen::RowMajor > m_normal
Particles' normal.
Definition: SphRepresentation.h:161
double getStiffness() const
Get the particles stiffness when colliding.
Definition: SphRepresentation.cpp:157
double m_h
Kernels parameter (support length and its powers)
Definition: SphRepresentation.h:176
void computeNormalField()
Compute the normal field.
Definition: SphRepresentation.cpp:270
SphRepresentation is a Representation dedicated to Smoothed-Particles Hydrodynamics (SPH).
Definition: SphRepresentation.h:47
double m_kernelPoly6Laplacian
Definition: SphRepresentation.h:182
double getGasStiffness() const
Get the gas stiffness coefficient.
Definition: SphRepresentation.cpp:93
void setSurfaceTension(double surfaceTension)
Set the surface tension.
Definition: SphRepresentation.cpp:98
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: SphRepresentation.cpp:182
SphRepresentation(const std::string &name)
Constructor.
Definition: SphRepresentation.cpp:32
void setMassPerParticle(double particleMass)
Set the mass for each particle.
Definition: SphRepresentation.cpp:62
double getKernelSupport() const
Get the kernel function support.
Definition: SphRepresentation.cpp:147
void setGasStiffness(double stiffness)
Set the gas stiffness coefficient.
Definition: SphRepresentation.cpp:86
void setKernelSupport(double support)
Set the kernel function support.
Definition: SphRepresentation.cpp:133
double m_viscosity
Viscosity coefficient.
Definition: SphRepresentation.h:173
bool doHandleCollisions(double dt, const SurgSim::Collision::ContactMapType &collisions) override
Implementation of the specific collision handling of the particle system.
Definition: SphRepresentation.cpp:339
std::shared_ptr< SurgSim::DataStructures::Grid< size_t, 3 > > m_grid
Grid acceleration to evaluate the kernels locally (storing the particles' index)
Definition: SphRepresentation.h:185
SURGSIM_CLASSNAME(SurgSim::Particles::SphRepresentation)
Math::Vector m_pressure
Particles' pressure.
Definition: SphRepresentation.h:164
void setGravity(const SurgSim::Math::Vector3d &gravity)
Set the gravity vector.
Definition: SphRepresentation.cpp:111
double m_stiffness
Collision stiffness.
Definition: SphRepresentation.h:169
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:68
SurgSim::Math::Vector3d m_gravity
3D Gravity vector
Definition: SphRepresentation.h:172
double getMassPerParticle() const
Get the mass for each particle.
Definition: SphRepresentation.cpp:69
void computeVelocityAndPosition(double dt)
Compute the particles' velocity and position given a time step dt.
Definition: SphRepresentation.cpp:229
virtual ~SphRepresentation()
Destructor.
Definition: SphRepresentation.cpp:58
The Representation class defines the base class for all Particle System.
Definition: Representation.h:41
void computeAccelerations()
Compute the Sph accelerations.
Definition: SphRepresentation.cpp:289
void setFriction(double friction)
Set the sliding coefficient of friction for the particles during collisions.
Definition: SphRepresentation.cpp:172
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
double getSurfaceTension() const
Get the surface tension.
Definition: SphRepresentation.cpp:106
double m_densityReference
Density of the reference gas.
Definition: SphRepresentation.h:166
Eigen::Matrix< double, Eigen::Dynamic, 3, Eigen::RowMajor > m_acceleration
Particles' acceleration.
Definition: SphRepresentation.h:162
double getViscosity() const
Get the viscosity coefficient (default is 0.0)
Definition: SphRepresentation.cpp:128
double m_kernelSpikyGradient
Definition: SphRepresentation.h:180