Jet  v1.3.3
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
jet::SphSolver3 Class Reference

3-D SPH solver. More...

#include <jet/sph_solver3.h>

Inheritance diagram for jet::SphSolver3:
jet::ParticleSystemSolver3 jet::PhysicsAnimation jet::Animation jet::PciSphSolver3

Classes

class  Builder
 Front-end to create SphSolver3 objects step by step. More...
 

Public Member Functions

 SphSolver3 ()
 Constructs a solver with empty particle set. More...
 
 SphSolver3 (double targetDensity, double targetSpacing, double relativeKernelRadius)
 
virtual ~SphSolver3 ()
 
double eosExponent () const
 Returns the exponent part of the equation-of-state. More...
 
void setEosExponent (double newEosExponent)
 Sets the exponent part of the equation-of-state. More...
 
double negativePressureScale () const
 Returns the negative pressure scale. More...
 
void setNegativePressureScale (double newNegativePressureScale)
 Sets the negative pressure scale. More...
 
double viscosityCoefficient () const
 Returns the viscosity coefficient. More...
 
void setViscosityCoefficient (double newViscosityCoefficient)
 Sets the viscosity coefficient. More...
 
double pseudoViscosityCoefficient () const
 Returns the pseudo viscosity coefficient. More...
 
void setPseudoViscosityCoefficient (double newPseudoViscosityCoefficient)
 Sets the pseudo viscosity coefficient. More...
 
double speedOfSound () const
 Returns the speed of sound. More...
 
void setSpeedOfSound (double newSpeedOfSound)
 Sets the speed of sound. More...
 
double timeStepLimitScale () const
 Multiplier that scales the max allowed time-step. More...
 
void setTimeStepLimitScale (double newScale)
 Sets the multiplier that scales the max allowed time-step. More...
 
SphSystemData3Ptr sphSystemData () const
 Returns the SPH system data. More...
 
- Public Member Functions inherited from jet::ParticleSystemSolver3
 ParticleSystemSolver3 ()
 Constructs an empty solver. More...
 
 ParticleSystemSolver3 (double radius, double mass)
 Constructs a solver with particle parameters. More...
 
virtual ~ParticleSystemSolver3 ()
 Destructor. More...
 
double dragCoefficient () const
 Returns the drag coefficient. More...
 
void setDragCoefficient (double newDragCoefficient)
 Sets the drag coefficient. More...
 
double restitutionCoefficient () const
 Sets the restitution coefficient. More...
 
void setRestitutionCoefficient (double newRestitutionCoefficient)
 Sets the restitution coefficient. More...
 
const Vector3Dgravity () const
 Returns the gravity. More...
 
void setGravity (const Vector3D &newGravity)
 Sets the gravity. More...
 
const ParticleSystemData3PtrparticleSystemData () const
 Returns the particle system data. More...
 
const Collider3Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider3Ptr &newCollider)
 Sets the collider. More...
 
const ParticleEmitter3Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const ParticleEmitter3Ptr &newEmitter)
 Sets the emitter. More...
 
const VectorField3Ptrwind () const
 Returns the wind field. More...
 
void setWind (const VectorField3Ptr &newWind)
 Sets the wind. More...
 
- Public Member Functions inherited from jet::PhysicsAnimation
 PhysicsAnimation ()
 Default constructor. More...
 
virtual ~PhysicsAnimation ()
 Destructor. More...
 
bool isUsingFixedSubTimeSteps () const
 Returns true if fixed sub-timestepping is used. More...
 
void setIsUsingFixedSubTimeSteps (bool isUsing)
 Sets true if fixed sub-timestepping is used. More...
 
unsigned int numberOfFixedSubTimeSteps () const
 Returns the number of fixed sub-timesteps. More...
 
void setNumberOfFixedSubTimeSteps (unsigned int numberOfSteps)
 Sets the number of fixed sub-timesteps. More...
 
void advanceSingleFrame ()
 Advances a single frame. More...
 
Frame currentFrame () const
 Returns current frame. More...
 
void setCurrentFrame (const Frame &frame)
 Sets current frame cursor (but do not invoke update()). More...
 
double currentTimeInSeconds () const
 Returns current time in seconds. More...
 
- Public Member Functions inherited from jet::Animation
 Animation ()
 
virtual ~Animation ()
 
void update (const Frame &frame)
 Updates animation state for given frame. More...
 

Static Public Member Functions

static Builder builder ()
 Returns builder fox SphSolver3. More...
 
- Static Public Member Functions inherited from jet::ParticleSystemSolver3
static Builder builder ()
 Returns builder fox ParticleSystemSolver3. More...
 

Protected Member Functions

unsigned int numberOfSubTimeSteps (double timeIntervalInSeconds) const override
 Returns the number of sub-time-steps. More...
 
void accumulateForces (double timeStepInSeconds) override
 Accumulates the force to the forces array in the particle system. More...
 
void onBeginAdvanceTimeStep (double timeStepInSeconds) override
 Performs pre-processing step before the simulation. More...
 
void onEndAdvanceTimeStep (double timeStepInSeconds) override
 Performs post-processing step before the simulation. More...
 
virtual void accumulateNonPressureForces (double timeStepInSeconds)
 
virtual void accumulatePressureForce (double timeStepInSeconds)
 
void computePressure ()
 Computes the pressure. More...
 
void accumulatePressureForce (const ConstArrayAccessor1< Vector3D > &positions, const ConstArrayAccessor1< double > &densities, const ConstArrayAccessor1< double > &pressures, ArrayAccessor1< Vector3D > pressureForces)
 Accumulates the pressure force to the given pressureForces array. More...
 
void accumulateViscosityForce ()
 
void computePseudoViscosity (double timeStepInSeconds)
 Computes pseudo viscosity. More...
 
- Protected Member Functions inherited from jet::ParticleSystemSolver3
void onInitialize () override
 Initializes the simulator. More...
 
void onAdvanceTimeStep (double timeStepInSeconds) override
 Called to advane a single time-step. More...
 
void resolveCollision ()
 Resolves any collisions occured by the particles. More...
 
void resolveCollision (ArrayAccessor1< Vector3D > newPositions, ArrayAccessor1< Vector3D > newVelocities)
 
void setParticleSystemData (const ParticleSystemData3Ptr &newParticles)
 Assign a new particle system data. More...
 

Detailed Description

3-D SPH solver.

This class implements 3-D SPH solver. The main pressure solver is based on equation-of-state (EOS).

See also
M{"u}ller et al., Particle-based fluid simulation for interactive applications, SCA 2003.
M. Becker and M. Teschner, Weakly compressible SPH for free surface flows, SCA 2007.
Adams and Wicke, Meshless approximation methods and applications in physics based modeling and animation, Eurographics tutorials 2009.

Constructor & Destructor Documentation

◆ SphSolver3() [1/2]

jet::SphSolver3::SphSolver3 ( )

Constructs a solver with empty particle set.

◆ SphSolver3() [2/2]

jet::SphSolver3::SphSolver3 ( double  targetDensity,
double  targetSpacing,
double  relativeKernelRadius 
)

Constructs a solver with target density, spacing, and relative kernel radius.

◆ ~SphSolver3()

virtual jet::SphSolver3::~SphSolver3 ( )
virtual

Member Function Documentation

◆ accumulateForces()

void jet::SphSolver3::accumulateForces ( double  timeStepInSeconds)
overrideprotectedvirtual

Accumulates the force to the forces array in the particle system.

Reimplemented from jet::ParticleSystemSolver3.

◆ accumulateNonPressureForces()

virtual void jet::SphSolver3::accumulateNonPressureForces ( double  timeStepInSeconds)
protectedvirtual

Accumulates the non-pressure forces to the forces array in the particle system.

◆ accumulatePressureForce() [1/2]

void jet::SphSolver3::accumulatePressureForce ( const ConstArrayAccessor1< Vector3D > &  positions,
const ConstArrayAccessor1< double > &  densities,
const ConstArrayAccessor1< double > &  pressures,
ArrayAccessor1< Vector3D pressureForces 
)
protected

Accumulates the pressure force to the given pressureForces array.

◆ accumulatePressureForce() [2/2]

virtual void jet::SphSolver3::accumulatePressureForce ( double  timeStepInSeconds)
protectedvirtual

Accumulates the pressure force to the forces array in the particle system.

Reimplemented in jet::PciSphSolver3.

◆ accumulateViscosityForce()

void jet::SphSolver3::accumulateViscosityForce ( )
protected

Accumulates the viscosity force to the forces array in the particle system.

◆ builder()

static Builder jet::SphSolver3::builder ( )
static

Returns builder fox SphSolver3.

◆ computePressure()

void jet::SphSolver3::computePressure ( )
protected

Computes the pressure.

◆ computePseudoViscosity()

void jet::SphSolver3::computePseudoViscosity ( double  timeStepInSeconds)
protected

Computes pseudo viscosity.

◆ eosExponent()

double jet::SphSolver3::eosExponent ( ) const

Returns the exponent part of the equation-of-state.

◆ negativePressureScale()

double jet::SphSolver3::negativePressureScale ( ) const

Returns the negative pressure scale.

◆ numberOfSubTimeSteps()

unsigned int jet::SphSolver3::numberOfSubTimeSteps ( double  timeIntervalInSeconds) const
overrideprotectedvirtual

Returns the number of sub-time-steps.

Reimplemented from jet::PhysicsAnimation.

◆ onBeginAdvanceTimeStep()

void jet::SphSolver3::onBeginAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotectedvirtual

Performs pre-processing step before the simulation.

Reimplemented from jet::ParticleSystemSolver3.

◆ onEndAdvanceTimeStep()

void jet::SphSolver3::onEndAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotectedvirtual

Performs post-processing step before the simulation.

Reimplemented from jet::ParticleSystemSolver3.

◆ pseudoViscosityCoefficient()

double jet::SphSolver3::pseudoViscosityCoefficient ( ) const

Returns the pseudo viscosity coefficient.

◆ setEosExponent()

void jet::SphSolver3::setEosExponent ( double  newEosExponent)

Sets the exponent part of the equation-of-state.

This function sets the exponent part of the equation-of-state. The value must be greater than 1.0, and smaller inputs will be clamped. Default is 7.

◆ setNegativePressureScale()

void jet::SphSolver3::setNegativePressureScale ( double  newNegativePressureScale)

Sets the negative pressure scale.

This function sets the negative pressure scale. By setting the number between 0 and 1, the solver will scale the effect of negative pressure which can prevent the clumping of the particles near the surface. Input value outside 0 and 1 will be clamped within the range. Default is 0.

◆ setPseudoViscosityCoefficient()

void jet::SphSolver3::setPseudoViscosityCoefficient ( double  newPseudoViscosityCoefficient)

Sets the pseudo viscosity coefficient.

This function sets the pseudo viscosity coefficient which applies additional pseudo-physical damping to the system. Default is 10.

◆ setSpeedOfSound()

void jet::SphSolver3::setSpeedOfSound ( double  newSpeedOfSound)

Sets the speed of sound.

This function sets the speed of sound which affects the stiffness of the EOS and the time-step size. Higher value will make EOS stiffer and the time-step smaller. The input value must be higher than 0.0.

◆ setTimeStepLimitScale()

void jet::SphSolver3::setTimeStepLimitScale ( double  newScale)

Sets the multiplier that scales the max allowed time-step.

This function sets the multiplier that scales the max allowed time-step. When the scale is 1.0, the time-step is bounded by the speed of sound and max acceleration.

◆ setViscosityCoefficient()

void jet::SphSolver3::setViscosityCoefficient ( double  newViscosityCoefficient)

Sets the viscosity coefficient.

◆ speedOfSound()

double jet::SphSolver3::speedOfSound ( ) const

Returns the speed of sound.

◆ sphSystemData()

SphSystemData3Ptr jet::SphSolver3::sphSystemData ( ) const

Returns the SPH system data.

◆ timeStepLimitScale()

double jet::SphSolver3::timeStepLimitScale ( ) const

Multiplier that scales the max allowed time-step.

This function returns the multiplier that scales the max allowed time-step. When the scale is 1.0, the time-step is bounded by the speed of sound and max acceleration.

◆ viscosityCoefficient()

double jet::SphSolver3::viscosityCoefficient ( ) const

Returns the viscosity coefficient.


The documentation for this class was generated from the following file: