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

Level set based 3-D liquid solver. More...

#include <jet/level_set_liquid_solver3.h>

Inheritance diagram for jet::LevelSetLiquidSolver3:
jet::GridFluidSolver3 jet::PhysicsAnimation jet::Animation

Classes

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

Public Member Functions

 LevelSetLiquidSolver3 ()
 Default constructor. More...
 
 LevelSetLiquidSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~LevelSetLiquidSolver3 ()
 Destructor. More...
 
ScalarGrid3Ptr signedDistanceField () const
 Returns signed-distance field. More...
 
LevelSetSolver3Ptr levelSetSolver () const
 Returns the level set solver. More...
 
void setLevelSetSolver (const LevelSetSolver3Ptr &newSolver)
 Sets the level set solver. More...
 
void setMinReinitializeDistance (double distance)
 Sets minimum reinitialization distance. More...
 
void setIsGlobalCompensationEnabled (bool isEnabled)
 Enables (or disables) global compensation feature flag. More...
 
double computeVolume () const
 Returns liquid volume measured by smeared Heaviside function. More...
 
- Public Member Functions inherited from jet::GridFluidSolver3
 GridFluidSolver3 ()
 Default constructor. More...
 
 GridFluidSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~GridFluidSolver3 ()
 Default destructor. More...
 
const Vector3Dgravity () const
 Returns the gravity vector of the system. More...
 
void setGravity (const Vector3D &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 AdvectionSolver3PtradvectionSolver () const
 Returns the advection solver instance. More...
 
void setAdvectionSolver (const AdvectionSolver3Ptr &newSolver)
 Sets the advection solver. More...
 
const GridDiffusionSolver3PtrdiffusionSolver () const
 Returns the diffusion solver instance. More...
 
void setDiffusionSolver (const GridDiffusionSolver3Ptr &newSolver)
 Sets the diffusion solver. More...
 
const GridPressureSolver3PtrpressureSolver () const
 Returns the pressure solver instance. More...
 
void setPressureSolver (const GridPressureSolver3Ptr &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 GridSystemData3PtrgridSystemData () const
 Returns the grid system data. More...
 
void resizeGrid (const Size3 &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin)
 Resizes grid system data. More...
 
Size3 resolution () const
 Returns the resolution of the grid system data. More...
 
Vector3D gridSpacing () const
 Returns the grid spacing of the grid system data. More...
 
Vector3D gridOrigin () const
 Returns the origin of the grid system data. More...
 
const FaceCenteredGrid3Ptrvelocity () const
 Returns the velocity field. More...
 
const Collider3Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider3Ptr &newCollider)
 Sets the collider. More...
 
const GridEmitter3Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const GridEmitter3Ptr &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 LevelSetLiquidSolver3. More...
 
- Static Public Member Functions inherited from jet::GridFluidSolver3
static Builder builder ()
 Returns builder fox GridFluidSolver3. More...
 

Protected Member Functions

void onBeginAdvanceTimeStep (double timeIntervalInSeconds) override
 Called at the beginning of the time-step. More...
 
void onEndAdvanceTimeStep (double timeIntervalInSeconds) override
 Called at the end of the time-step. More...
 
void computeAdvection (double timeIntervalInSeconds) override
 Customizes advection step. More...
 
ScalarField3Ptr fluidSdf () const override
 Returns fluid region as a signed-distance field. More...
 
- Protected Member Functions inherited from jet::GridFluidSolver3
void onInitialize () override
 Called when it needs to setup initial condition. More...
 
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 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 (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 colliderSdf () const
 Returns the signed-distance field representation of the collider. More...
 
VectorField3Ptr colliderVelocityField () const
 Returns the velocity field of the collider. More...
 

Detailed Description

Level set based 3-D liquid solver.

This class implements level set-based 3-D liquid solver. It defines the surface of the liquid using signed-distance field and use stable fluids framework to compute the forces.

See also
Enright, Douglas, Stephen Marschner, and Ronald Fedkiw. "Animation and rendering of complex water surfaces." ACM Transactions on Graphics (TOG). Vol. 21. No. 3. ACM, 2002.

Constructor & Destructor Documentation

◆ LevelSetLiquidSolver3() [1/2]

jet::LevelSetLiquidSolver3::LevelSetLiquidSolver3 ( )

Default constructor.

◆ LevelSetLiquidSolver3() [2/2]

jet::LevelSetLiquidSolver3::LevelSetLiquidSolver3 ( const Size3 resolution,
const Vector3D gridSpacing,
const Vector3D gridOrigin 
)

Constructs solver with initial grid size.

◆ ~LevelSetLiquidSolver3()

virtual jet::LevelSetLiquidSolver3::~LevelSetLiquidSolver3 ( )
virtual

Destructor.

Member Function Documentation

◆ builder()

static Builder jet::LevelSetLiquidSolver3::builder ( )
static

Returns builder fox LevelSetLiquidSolver3.

◆ computeAdvection()

void jet::LevelSetLiquidSolver3::computeAdvection ( double  timeIntervalInSeconds)
overrideprotectedvirtual

Customizes advection step.

Reimplemented from jet::GridFluidSolver3.

◆ computeVolume()

double jet::LevelSetLiquidSolver3::computeVolume ( ) const

Returns liquid volume measured by smeared Heaviside function.

This function measures the liquid volume using smeared Heaviside function. Thus, the estimated volume is an approximated quantity.

◆ fluidSdf()

ScalarField3Ptr jet::LevelSetLiquidSolver3::fluidSdf ( ) const
overrideprotectedvirtual

Returns fluid region as a signed-distance field.

This function returns fluid region as a signed-distance field. For this particular class, it returns the same field as the function LevelSetLiquidSolver2::signedDistanceField().

Reimplemented from jet::GridFluidSolver3.

◆ levelSetSolver()

LevelSetSolver3Ptr jet::LevelSetLiquidSolver3::levelSetSolver ( ) const

Returns the level set solver.

◆ onBeginAdvanceTimeStep()

void jet::LevelSetLiquidSolver3::onBeginAdvanceTimeStep ( double  timeIntervalInSeconds)
overrideprotectedvirtual

Called at the beginning of the time-step.

Reimplemented from jet::GridFluidSolver3.

◆ onEndAdvanceTimeStep()

void jet::LevelSetLiquidSolver3::onEndAdvanceTimeStep ( double  timeIntervalInSeconds)
overrideprotectedvirtual

Called at the end of the time-step.

Reimplemented from jet::GridFluidSolver3.

◆ setIsGlobalCompensationEnabled()

void jet::LevelSetLiquidSolver3::setIsGlobalCompensationEnabled ( bool  isEnabled)

Enables (or disables) global compensation feature flag.

When isEnabled is true, the global compensation feature is enabled. The global compensation measures the volume at the beginning and the end of the time-step and adds the volume change back to the level-set field by globally shifting the front.

See also
Song, Oh-Young, Hyuncheol Shin, and Hyeong-Seok Ko. "Stable but nondissipative water." ACM Transactions on Graphics (TOG) 24, no. 1 (2005): 81-97.

◆ setLevelSetSolver()

void jet::LevelSetLiquidSolver3::setLevelSetSolver ( const LevelSetSolver3Ptr newSolver)

Sets the level set solver.

◆ setMinReinitializeDistance()

void jet::LevelSetLiquidSolver3::setMinReinitializeDistance ( double  distance)

Sets minimum reinitialization distance.

◆ signedDistanceField()

ScalarGrid3Ptr jet::LevelSetLiquidSolver3::signedDistanceField ( ) const

Returns signed-distance field.


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