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

#include <Core/Solver/Hybrid/FLIP/FLIPSolver3.hpp>

Inheritance diagram for CubbyFlow::FLIPSolver3:
CubbyFlow::PICSolver3 CubbyFlow::GridFluidSolver3 CubbyFlow::PhysicsAnimation CubbyFlow::Animation

Classes

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

Public Member Functions

 FLIPSolver3 ()
 Default constructor. More...
 
 FLIPSolver3 (const Vector3UZ &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
 FLIPSolver3 (const FLIPSolver3 &)=delete
 Deleted copy constructor. More...
 
 FLIPSolver3 (FLIPSolver3 &&) noexcept=delete
 Deleted move constructor. More...
 
 ~FLIPSolver3 () override=default
 Default virtual destructor. More...
 
FLIPSolver3operator= (const FLIPSolver3 &)=delete
 Deleted copy assignment operator. More...
 
FLIPSolver3operator= (FLIPSolver3 &&) noexcept=delete
 Deleted move assignment operator. More...
 
double GetPICBlendingFactor () const
 Returns the PIC blending factor. More...
 
void SetPICBlendingFactor (double factor)
 Sets the PIC blending factor. More...
 
- Public Member Functions inherited from CubbyFlow::PICSolver3
 PICSolver3 ()
 Default constructor. More...
 
 PICSolver3 (const Vector3UZ &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
 PICSolver3 (const PICSolver3 &)=delete
 Deleted copy constructor. More...
 
 PICSolver3 (PICSolver3 &&) noexcept=delete
 Deleted move constructor. More...
 
 ~PICSolver3 () override=default
 Default virtual destructor. More...
 
PICSolver3operator= (const PICSolver3 &)=delete
 Deleted copy assignment operator. More...
 
PICSolver3operator= (PICSolver3 &&) noexcept=delete
 Deleted move assignment operator. More...
 
ScalarGrid3Ptr GetSignedDistanceField () const
 Returns the signed-distance field of particles. More...
 
const ParticleSystemData3PtrGetParticleSystemData () const
 Returns the particle system data. More...
 
const ParticleEmitter3PtrGetParticleEmitter () const
 Returns the particle emitter. More...
 
void SetParticleEmitter (const ParticleEmitter3Ptr &newEmitter)
 Sets the particle emitter. More...
 
- Public Member Functions inherited from CubbyFlow::GridFluidSolver3
 GridFluidSolver3 ()
 Default constructor. More...
 
 GridFluidSolver3 (const Vector3UZ &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
 GridFluidSolver3 (const GridFluidSolver3 &)=delete
 Deleted copy constructor. More...
 
 GridFluidSolver3 (GridFluidSolver3 &&) noexcept=delete
 Deleted move constructor. More...
 
 ~GridFluidSolver3 () override=default
 Default virtual destructor. More...
 
GridFluidSolver3operator= (const GridFluidSolver3 &)=delete
 Deleted copy assignment operator. More...
 
GridFluidSolver3operator= (GridFluidSolver3 &&) noexcept=delete
 Deleted move assignment operator. More...
 
const Vector3DGetGravity () const
 Returns the gravity vector of the system. More...
 
void SetGravity (const Vector3D &newGravity)
 Sets the gravity of the system. More...
 
double GetViscosityCoefficient () const
 Returns the viscosity coefficient. More...
 
void SetViscosityCoefficient (double newValue)
 Sets the viscosity coefficient. More...
 
double GetCFL (double timeIntervalInSeconds) const
 Returns the CFL number from the current velocity field for given time interval. More...
 
double GetMaxCFL () const
 Returns the max allowed CFL number. More...
 
void SetMaxCFL (double newCFL)
 Sets the max allowed CFL number. More...
 
bool GetUseCompressedLinearSystem () const
 Returns true if the solver is using compressed linear system. More...
 
void SetUseCompressedLinearSystem (bool isOn)
 Sets whether the solver should use compressed linear system. More...
 
const AdvectionSolver3PtrGetAdvectionSolver () const
 Returns the advection solver instance. More...
 
void SetAdvectionSolver (const AdvectionSolver3Ptr &newSolver)
 Sets the advection solver. More...
 
const GridDiffusionSolver3PtrGetDiffusionSolver () const
 Returns the diffusion solver instance. More...
 
void SetDiffusionSolver (const GridDiffusionSolver3Ptr &newSolver)
 Sets the diffusion solver. More...
 
const GridPressureSolver3PtrGetPressureSolver () const
 Returns the pressure solver instance. More...
 
void SetPressureSolver (const GridPressureSolver3Ptr &newSolver)
 Sets the pressure solver. More...
 
int GetClosedDomainBoundaryFlag () const
 Returns the closed domain boundary flag. More...
 
void SetClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag. More...
 
const GridSystemData3PtrGetGridSystemData () const
 Returns the grid system data. More...
 
void ResizeGrid (const Vector3UZ &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin) const
 Resizes grid system data. More...
 
Vector3UZ GetResolution () const
 Returns the resolution of the grid system data. More...
 
Vector3D GetGridSpacing () const
 Returns the grid spacing of the grid system data. More...
 
Vector3D GetGridOrigin () const
 Returns the origin of the grid system data. More...
 
const FaceCenteredGrid3PtrGetVelocity () const
 Returns the velocity field. More...
 
const Collider3PtrGetCollider () const
 Returns the collider. More...
 
void SetCollider (const Collider3Ptr &newCollider)
 Sets the collider. More...
 
const GridEmitter3PtrGetEmitter () const
 Returns the emitter. More...
 
void SetEmitter (const GridEmitter3Ptr &newEmitter)
 Sets the emitter. More...
 
- Public Member Functions inherited from CubbyFlow::PhysicsAnimation
 PhysicsAnimation ()
 Default constructor. More...
 
 PhysicsAnimation (const PhysicsAnimation &)=default
 Default copy constructor. More...
 
 PhysicsAnimation (PhysicsAnimation &&) noexcept=default
 Default move constructor. More...
 
virtual ~PhysicsAnimation ()=default
 Default virtual destructor. More...
 
PhysicsAnimationoperator= (const PhysicsAnimation &)=default
 Default copy assignment operator. More...
 
PhysicsAnimationoperator= (PhysicsAnimation &&) noexcept=default
 Default move assignment operator. More...
 
bool GetIsUsingFixedSubTimeSteps () 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 GetNumberOfFixedSubTimeSteps () 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 GetCurrentFrame () const
 Returns current frame. More...
 
void SetCurrentFrame (const Frame &frame)
 Sets current frame cursor (but do not invoke update()). More...
 
double GetCurrentTimeInSeconds () const
 Returns current time in seconds. More...
 
- Public Member Functions inherited from CubbyFlow::Animation
 Animation ()=default
 Default constructor. More...
 
 Animation (const Animation &)=default
 Default copy constructor. More...
 
 Animation (Animation &&) noexcept=default
 Default move constructor. More...
 
virtual ~Animation ()=default
 Default virtual destructor. More...
 
Animationoperator= (const Animation &)=default
 Default copy assignment operator. More...
 
Animationoperator= (Animation &&) noexcept=default
 Default move assignment operator. More...
 
void Update (const Frame &frame)
 Updates animation state for given frame. More...
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox FLIPSolver3. More...
 
- Static Public Member Functions inherited from CubbyFlow::PICSolver3
static Builder GetBuilder ()
 Returns builder fox PICSolver3. More...
 
- Static Public Member Functions inherited from CubbyFlow::GridFluidSolver3
static Builder GetBuilder ()
 Returns builder fox GridFluidSolver3. 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 CubbyFlow::PICSolver3
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...
 
ScalarField3Ptr GetFluidSDF () const override
 Returns the signed-distance field of the fluid. More...
 
virtual void MoveParticles (double timeIntervalInSeconds)
 Moves particles. More...
 
- Protected Member Functions inherited from CubbyFlow::GridFluidSolver3
void OnAdvanceTimeStep (double timeIntervalInSeconds) override
 Called when advancing a single time-step. More...
 
unsigned int GetNumberOfSubTimeSteps (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 () const
 Applies the boundary condition to the velocity field. More...
 
void ExtrapolateIntoCollider (ScalarGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void ExtrapolateIntoCollider (CollocatedVectorGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void ExtrapolateIntoCollider (FaceCenteredGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
ScalarField3Ptr GetColliderSDF () const
 Returns the signed-distance field representation of the collider. More...
 
VectorField3Ptr GetColliderVelocityField () const
 Returns the velocity field of the collider. More...
 

Additional Inherited Members

- Protected Attributes inherited from CubbyFlow::PICSolver3
Array3< char > m_uMarkers
 
Array3< char > m_vMarkers
 
Array3< char > m_wMarkers
 

Detailed Description

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

This class implements 3-D Fluid-Implicit Particle (FLIP) solver from the SIGGRAPH paper, Zhu and Bridson 2005. By transferring 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

◆ FLIPSolver3() [1/4]

CubbyFlow::FLIPSolver3::FLIPSolver3 ( )

Default constructor.

◆ FLIPSolver3() [2/4]

CubbyFlow::FLIPSolver3::FLIPSolver3 ( const Vector3UZ resolution,
const Vector3D gridSpacing,
const Vector3D gridOrigin 
)

Constructs solver with initial grid size.

◆ FLIPSolver3() [3/4]

CubbyFlow::FLIPSolver3::FLIPSolver3 ( const FLIPSolver3 )
delete

Deleted copy constructor.

◆ FLIPSolver3() [4/4]

CubbyFlow::FLIPSolver3::FLIPSolver3 ( FLIPSolver3 &&  )
deletenoexcept

Deleted move constructor.

◆ ~FLIPSolver3()

CubbyFlow::FLIPSolver3::~FLIPSolver3 ( )
overridedefault

Default virtual destructor.

Member Function Documentation

◆ GetBuilder()

static Builder CubbyFlow::FLIPSolver3::GetBuilder ( )
static

Returns builder fox FLIPSolver3.

◆ GetPICBlendingFactor()

double CubbyFlow::FLIPSolver3::GetPICBlendingFactor ( ) const

Returns the PIC blending factor.

◆ operator=() [1/2]

FLIPSolver3& CubbyFlow::FLIPSolver3::operator= ( const FLIPSolver3 )
delete

Deleted copy assignment operator.

◆ operator=() [2/2]

FLIPSolver3& CubbyFlow::FLIPSolver3::operator= ( FLIPSolver3 &&  )
deletenoexcept

Deleted move assignment operator.

◆ SetPICBlendingFactor()

void CubbyFlow::FLIPSolver3::SetPICBlendingFactor ( double  factor)

Sets the PIC blending factor.

This function sets the PIC blending 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 CubbyFlow::FLIPSolver3::TransferFromGridsToParticles ( )
overrideprotectedvirtual

Transfers velocity field from grids to particles.

Reimplemented from CubbyFlow::PICSolver3.

◆ TransferFromParticlesToGrids()

void CubbyFlow::FLIPSolver3::TransferFromParticlesToGrids ( )
overrideprotectedvirtual

Transfers velocity field from particles to grids.

Reimplemented from CubbyFlow::PICSolver3.


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