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

2-D Fluid-Implicit Particle (FLIP) implementation. More...

#include <jet/flip_solver2.h>

Inheritance diagram for jet::FlipSolver2:
jet::PicSolver2 jet::GridFluidSolver2 jet::PhysicsAnimation jet::Animation

Classes

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

Public Member Functions

 FlipSolver2 ()
 Default constructor. More...
 
 FlipSolver2 (const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~FlipSolver2 ()
 Default destructor. More...
 
double picBlendingFactor () const
 Returns the PIC blending factor. More...
 
void setPicBlendingFactor (double factor)
 Sets the PIC blending factor. More...
 
- Public Member Functions inherited from jet::PicSolver2
 PicSolver2 ()
 Default constructor. More...
 
 PicSolver2 (const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~PicSolver2 ()
 Default destructor. More...
 
ScalarGrid2Ptr signedDistanceField () const
 Returns the signed-distance field of particles. More...
 
const ParticleSystemData2PtrparticleSystemData () const
 Returns the particle system data. More...
 
const ParticleEmitter2PtrparticleEmitter () const
 Returns the particle emitter. More...
 
void setParticleEmitter (const ParticleEmitter2Ptr &newEmitter)
 Sets the particle emitter. More...
 
- Public Member Functions inherited from jet::GridFluidSolver2
 GridFluidSolver2 ()
 Default constructor. More...
 
 GridFluidSolver2 (const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~GridFluidSolver2 ()
 Default destructor. More...
 
const Vector2Dgravity () const
 Returns the gravity vector of the system. More...
 
void setGravity (const Vector2D &newGravity)
 Sets the gravity of the system. More...
 
double viscosityCoefficient () const
 Returns the viscosity coefficient. More...
 
void setViscosityCoefficient (double newValue)
 Sets the viscosity coefficient. More...
 
double cfl (double timeIntervalInSeconds) const
 Returns the CFL number from the current velocity field for given time interval. More...
 
double maxCfl () const
 Returns the max allowed CFL number. More...
 
void setMaxCfl (double newCfl)
 Sets the max allowed CFL number. More...
 
bool useCompressedLinearSystem () const
 Returns true if the solver is using compressed linear system. More...
 
void setUseCompressedLinearSystem (bool onoff)
 Sets whether the solver should use compressed linear system. More...
 
const AdvectionSolver2PtradvectionSolver () const
 Returns the advection solver instance. More...
 
void setAdvectionSolver (const AdvectionSolver2Ptr &newSolver)
 Sets the advection solver. More...
 
const GridDiffusionSolver2PtrdiffusionSolver () const
 Returns the diffusion solver instance. More...
 
void setDiffusionSolver (const GridDiffusionSolver2Ptr &newSolver)
 Sets the diffusion solver. More...
 
const GridPressureSolver2PtrpressureSolver () const
 Returns the pressure solver instance. More...
 
void setPressureSolver (const GridPressureSolver2Ptr &newSolver)
 Sets the pressure solver. More...
 
int closedDomainBoundaryFlag () const
 Returns the closed domain boundary flag. More...
 
void setClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag. More...
 
const GridSystemData2PtrgridSystemData () const
 Returns the grid system data. More...
 
void resizeGrid (const Size2 &newSize, const Vector2D &newGridSpacing, const Vector2D &newGridOrigin)
 Resizes grid system data. More...
 
Size2 resolution () const
 Returns the resolution of the grid system data. More...
 
Vector2D gridSpacing () const
 Returns the grid spacing of the grid system data. More...
 
Vector2D gridOrigin () const
 Returns the origin of the grid system data. More...
 
const FaceCenteredGrid2Ptrvelocity () const
 Returns the velocity field. More...
 
const Collider2Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider2Ptr &newCollider)
 Sets the collider. More...
 
const GridEmitter2Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const GridEmitter2Ptr &newEmitter)
 Sets the emitter. 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 FlipSolver2. More...
 
- Static Public Member Functions inherited from jet::PicSolver2
static Builder builder ()
 Returns builder fox PicSolver2. More...
 
- Static Public Member Functions inherited from jet::GridFluidSolver2
static Builder builder ()
 Returns builder fox GridFluidSolver2. More...
 

Protected Member Functions

void transferFromParticlesToGrids () override
 Transfers velocity field from particles to grids. More...
 
void transferFromGridsToParticles () override
 Transfers velocity field from grids to particles. More...
 
- Protected Member Functions inherited from jet::PicSolver2
void onInitialize () override
 Initializes the simulator. More...
 
void onBeginAdvanceTimeStep (double timeIntervalInSeconds) override
 Invoked before a simulation time-step begins. More...
 
void computeAdvection (double timeIntervalInSeconds) override
 Computes the advection term of the fluid solver. More...
 
ScalarField2Ptr fluidSdf () const override
 Returns the signed-distance field of the fluid. More...
 
virtual void moveParticles (double timeIntervalInSeconds)
 Moves particles. More...
 
- Protected Member Functions inherited from jet::GridFluidSolver2
void onAdvanceTimeStep (double timeIntervalInSeconds) override
 Called when advancing a single time-step. More...
 
unsigned int numberOfSubTimeSteps (double timeIntervalInSeconds) const override
 Returns the required sub-time-steps for given time interval. More...
 
virtual void onEndAdvanceTimeStep (double timeIntervalInSeconds)
 Called at the end of a time-step. More...
 
virtual void computeExternalForces (double timeIntervalInSeconds)
 Computes the external force terms. More...
 
virtual void computeViscosity (double timeIntervalInSeconds)
 Computes the viscosity term using the diffusion solver. More...
 
virtual void computePressure (double timeIntervalInSeconds)
 Computes the pressure term using the pressure solver. More...
 
void computeGravity (double timeIntervalInSeconds)
 Computes the gravity term. More...
 
void applyBoundaryCondition ()
 Applies the boundary condition to the velocity field. More...
 
void extrapolateIntoCollider (ScalarGrid2 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void extrapolateIntoCollider (CollocatedVectorGrid2 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void extrapolateIntoCollider (FaceCenteredGrid2 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
ScalarField2Ptr colliderSdf () const
 Returns the signed-distance field representation of the collider. More...
 
VectorField2Ptr colliderVelocityField () const
 Returns the velocity field of the collider. More...
 

Additional Inherited Members

- Protected Attributes inherited from jet::PicSolver2
Array2< char > _uMarkers
 
Array2< char > _vMarkers
 

Detailed Description

2-D Fluid-Implicit Particle (FLIP) implementation.

This class implements 2-D Fluid-Implicit Particle (FLIP) solver from the SIGGRAPH paper, Zhu and Bridson 2005. By transfering delta-velocity field from grid to particles, the FLIP solver achieves less viscous fluid flow compared to the original PIC method.

See also
Zhu, Yongning, and Robert Bridson. "Animating sand as a fluid." ACM Transactions on Graphics (TOG). Vol. 24. No. 3. ACM, 2005.

Constructor & Destructor Documentation

◆ FlipSolver2() [1/2]

jet::FlipSolver2::FlipSolver2 ( )

Default constructor.

◆ FlipSolver2() [2/2]

jet::FlipSolver2::FlipSolver2 ( const Size2 resolution,
const Vector2D gridSpacing,
const Vector2D gridOrigin 
)

Constructs solver with initial grid size.

◆ ~FlipSolver2()

virtual jet::FlipSolver2::~FlipSolver2 ( )
virtual

Default destructor.

Member Function Documentation

◆ builder()

static Builder jet::FlipSolver2::builder ( )
static

Returns builder fox FlipSolver2.

◆ picBlendingFactor()

double jet::FlipSolver2::picBlendingFactor ( ) const

Returns the PIC blending factor.

◆ setPicBlendingFactor()

void jet::FlipSolver2::setPicBlendingFactor ( double  factor)

Sets the PIC blending factor.

This function sets the PIC blendinf factor which mixes FLIP and PIC results when transferring velocity from grids to particles in order to reduce the noise. The factor can be a value between 0 and 1, where 0 means no blending and 1 means full PIC. Default is 0.

Parameters
[in]factorThe blending factor.

◆ transferFromGridsToParticles()

void jet::FlipSolver2::transferFromGridsToParticles ( )
overrideprotectedvirtual

Transfers velocity field from grids to particles.

Reimplemented from jet::PicSolver2.

◆ transferFromParticlesToGrids()

void jet::FlipSolver2::transferFromParticlesToGrids ( )
overrideprotectedvirtual

Transfers velocity field from particles to grids.

Reimplemented from jet::PicSolver2.


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