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

2-D PCISPH solver. More...

#include <jet/pci_sph_solver2.h>

Inheritance diagram for jet::PciSphSolver2:
jet::SphSolver2 jet::ParticleSystemSolver2 jet::PhysicsAnimation jet::Animation

Classes

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

Public Member Functions

 PciSphSolver2 ()
 Constructs a solver with empty particle set. More...
 
 PciSphSolver2 (double targetDensity, double targetSpacing, double relativeKernelRadius)
 
virtual ~PciSphSolver2 ()
 
double maxDensityErrorRatio () const
 Returns max allowed density error ratio. More...
 
void setMaxDensityErrorRatio (double ratio)
 Sets max allowed density error ratio. More...
 
unsigned int maxNumberOfIterations () const
 Returns max number of iterations. More...
 
void setMaxNumberOfIterations (unsigned int n)
 Sets max number of PCISPH iterations. More...
 
- Public Member Functions inherited from jet::SphSolver2
 SphSolver2 ()
 Constructs a solver with empty particle set. More...
 
virtual ~SphSolver2 ()
 
 SphSolver2 (double targetDensity, double targetSpacing, double relativeKernelRadius)
 
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...
 
SphSystemData2Ptr sphSystemData () const
 Returns the SPH system data. More...
 
- Public Member Functions inherited from jet::ParticleSystemSolver2
 ParticleSystemSolver2 ()
 Constructs an empty solver. More...
 
 ParticleSystemSolver2 (double radius, double mass)
 Constructs a solver with particle parameters. More...
 
virtual ~ParticleSystemSolver2 ()
 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 Vector2Dgravity () const
 Returns the gravity. More...
 
void setGravity (const Vector2D &newGravity)
 Sets the gravity. More...
 
const ParticleSystemData2PtrparticleSystemData () const
 Returns the particle system data. More...
 
const Collider2Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider2Ptr &newCollider)
 Sets the collider. More...
 
const ParticleEmitter2Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const ParticleEmitter2Ptr &newEmitter)
 Sets the emitter. More...
 
const VectorField2Ptrwind () const
 Returns the wind field. More...
 
void setWind (const VectorField2Ptr &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 PciSphSolver2. More...
 
- Static Public Member Functions inherited from jet::SphSolver2
static Builder builder ()
 Returns builder fox SphSolver2. More...
 
- Static Public Member Functions inherited from jet::ParticleSystemSolver2
static Builder builder ()
 Returns builder fox ParticleSystemSolver2. More...
 

Protected Member Functions

void accumulatePressureForce (double timeIntervalInSeconds) override
 
void onBeginAdvanceTimeStep (double timeStepInSeconds) override
 Performs pre-processing step before the simulation. More...
 
- Protected Member Functions inherited from jet::SphSolver2
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)
 
void computePressure ()
 Computes the pressure. More...
 
void accumulatePressureForce (const ConstArrayAccessor1< Vector2D > &positions, const ConstArrayAccessor1< double > &densities, const ConstArrayAccessor1< double > &pressures, ArrayAccessor1< Vector2D > 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::ParticleSystemSolver2
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< Vector2D > newPositions, ArrayAccessor1< Vector2D > newVelocities)
 
void setParticleSystemData (const ParticleSystemData2Ptr &newParticles)
 Assign a new particle system data. More...
 

Detailed Description

2-D PCISPH solver.

This class implements 2-D predictive-corrective SPH solver. The main pressure solver is based on Solenthaler and Pajarola's 2009 SIGGRAPH paper.

See also
Solenthaler and Pajarola, Predictive-corrective incompressible SPH, ACM transactions on graphics (TOG). Vol. 28. No. 3. ACM, 2009.

Constructor & Destructor Documentation

◆ PciSphSolver2() [1/2]

jet::PciSphSolver2::PciSphSolver2 ( )

Constructs a solver with empty particle set.

◆ PciSphSolver2() [2/2]

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

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

◆ ~PciSphSolver2()

virtual jet::PciSphSolver2::~PciSphSolver2 ( )
virtual

Member Function Documentation

◆ accumulatePressureForce()

void jet::PciSphSolver2::accumulatePressureForce ( double  timeIntervalInSeconds)
overrideprotectedvirtual

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

Reimplemented from jet::SphSolver2.

◆ builder()

static Builder jet::PciSphSolver2::builder ( )
static

Returns builder fox PciSphSolver2.

◆ maxDensityErrorRatio()

double jet::PciSphSolver2::maxDensityErrorRatio ( ) const

Returns max allowed density error ratio.

◆ maxNumberOfIterations()

unsigned int jet::PciSphSolver2::maxNumberOfIterations ( ) const

Returns max number of iterations.

◆ onBeginAdvanceTimeStep()

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

Performs pre-processing step before the simulation.

Reimplemented from jet::ParticleSystemSolver2.

◆ setMaxDensityErrorRatio()

void jet::PciSphSolver2::setMaxDensityErrorRatio ( double  ratio)

Sets max allowed density error ratio.

This function sets the max allowed density error ratio during the PCISPH iteration. Default is 0.01 (1%). The input value should be positive.

◆ setMaxNumberOfIterations()

void jet::PciSphSolver2::setMaxNumberOfIterations ( unsigned int  n)

Sets max number of PCISPH iterations.

This function sets the max number of PCISPH iterations. Default is 5.


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