Level set based 2-D liquid solver. More...
#include <Core/Solver/LevelSet/LevelSetLiquidSolver2.h>
Classes | |
class | Builder |
Front-end to create LevelSetLiquidSolver2 objects step by step. More... | |
Public Member Functions | |
LevelSetLiquidSolver2 () | |
Default constructor. More... | |
LevelSetLiquidSolver2 (const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin) | |
Constructs solver with initial grid size. More... | |
virtual | ~LevelSetLiquidSolver2 () |
Destructor. More... | |
ScalarGrid2Ptr | GetSignedDistanceField () const |
Returns signed-distance field. More... | |
LevelSetSolver2Ptr | GetLevelSetSolver () const |
Returns the level set solver. More... | |
void | SetLevelSetSolver (const LevelSetSolver2Ptr &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 CubbyFlow::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 Vector2D & | GetGravity () const |
Returns the gravity vector of the system. More... | |
void | SetGravity (const Vector2D &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 onoff) |
Sets whether the solver should use compressed linear system. More... | |
const AdvectionSolver2Ptr & | GetAdvectionSolver () const |
Returns the advection solver instance. More... | |
void | SetAdvectionSolver (const AdvectionSolver2Ptr &newSolver) |
Sets the advection solver. More... | |
const GridDiffusionSolver2Ptr & | GetDiffusionSolver () const |
Returns the diffusion solver instance. More... | |
void | SetDiffusionSolver (const GridDiffusionSolver2Ptr &newSolver) |
Sets the diffusion solver. More... | |
const GridPressureSolver2Ptr & | GetPressureSolver () const |
Returns the pressure solver instance. More... | |
void | SetPressureSolver (const GridPressureSolver2Ptr &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 GridSystemData2Ptr & | GetGridSystemData () const |
Returns the grid system data. More... | |
void | ResizeGrid (const Size2 &newSize, const Vector2D &newGridSpacing, const Vector2D &newGridOrigin) const |
Resizes grid system data. More... | |
Size2 | GetResolution () const |
Returns the resolution of the grid system data. More... | |
Vector2D | GetGridSpacing () const |
Returns the grid spacing of the grid system data. More... | |
Vector2D | GetGridOrigin () const |
Returns the origin of the grid system data. More... | |
const FaceCenteredGrid2Ptr & | GetVelocity () const |
Returns the velocity field. More... | |
const Collider2Ptr & | GetCollider () const |
Returns the collider. More... | |
void | SetCollider (const Collider2Ptr &newCollider) |
Sets the collider. More... | |
const GridEmitter2Ptr & | GetEmitter () const |
Returns the emitter. More... | |
void | SetEmitter (const GridEmitter2Ptr &newEmitter) |
Sets the emitter. More... | |
Public Member Functions inherited from CubbyFlow::PhysicsAnimation | |
PhysicsAnimation () | |
Default constructor. More... | |
virtual | ~PhysicsAnimation () |
Destructor. 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 () | |
virtual | ~Animation () |
void | Update (const Frame &frame) |
Updates animation state for given frame . More... | |
Static Public Member Functions | |
static Builder | GetBuilder () |
Returns builder fox LevelSetLiquidSolver2. More... | |
Static Public Member Functions inherited from CubbyFlow::GridFluidSolver2 | |
static Builder | GetBuilder () |
Returns builder fox GridFluidSolver2. 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... | |
ScalarField2Ptr | GetFluidSDF () const override |
Returns fluid region as a signed-distance field. More... | |
Protected Member Functions inherited from CubbyFlow::GridFluidSolver2 | |
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 | GetNumberOfSubTimeSteps (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 () const |
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 | GetColliderSDF () const |
Returns the signed-distance field representation of the collider. More... | |
VectorField2Ptr | GetColliderVelocityField () const |
Returns the velocity field of the collider. More... | |
Detailed Description
Level set based 2-D liquid solver.
This class implements level set-based 2-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
◆ LevelSetLiquidSolver2() [1/2]
CubbyFlow::LevelSetLiquidSolver2::LevelSetLiquidSolver2 | ( | ) |
Default constructor.
◆ LevelSetLiquidSolver2() [2/2]
CubbyFlow::LevelSetLiquidSolver2::LevelSetLiquidSolver2 | ( | const Size2 & | resolution, |
const Vector2D & | gridSpacing, | ||
const Vector2D & | gridOrigin | ||
) |
Constructs solver with initial grid size.
◆ ~LevelSetLiquidSolver2()
|
virtual |
Destructor.
Member Function Documentation
◆ ComputeAdvection()
|
overrideprotectedvirtual |
Customizes advection step.
Reimplemented from CubbyFlow::GridFluidSolver2.
◆ ComputeVolume()
double CubbyFlow::LevelSetLiquidSolver2::ComputeVolume | ( | ) | const |
Returns liquid volume measured by smeared Heaviside function.
This function measures the liquid volume (area in 2-D) using smeared Heaviside function. Thus, the estimated volume is an approximated quantity.
◆ GetBuilder()
|
static |
Returns builder fox LevelSetLiquidSolver2.
◆ GetFluidSDF()
|
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 CubbyFlow::GridFluidSolver2.
◆ GetLevelSetSolver()
LevelSetSolver2Ptr CubbyFlow::LevelSetLiquidSolver2::GetLevelSetSolver | ( | ) | const |
Returns the level set solver.
◆ GetSignedDistanceField()
ScalarGrid2Ptr CubbyFlow::LevelSetLiquidSolver2::GetSignedDistanceField | ( | ) | const |
Returns signed-distance field.
◆ OnBeginAdvanceTimeStep()
|
overrideprotectedvirtual |
Called at the beginning of the time-step.
Reimplemented from CubbyFlow::GridFluidSolver2.
◆ OnEndAdvanceTimeStep()
|
overrideprotectedvirtual |
Called at the end of the time-step.
Reimplemented from CubbyFlow::GridFluidSolver2.
◆ SetIsGlobalCompensationEnabled()
void CubbyFlow::LevelSetLiquidSolver2::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 non-dissipative water." ACM Transactions on Graphics (TOG) 24, no. 1 (2005): 81-97.
◆ SetLevelSetSolver()
void CubbyFlow::LevelSetLiquidSolver2::SetLevelSetSolver | ( | const LevelSetSolver2Ptr & | newSolver | ) |
Sets the level set solver.
◆ SetMinReinitializeDistance()
void CubbyFlow::LevelSetLiquidSolver2::SetMinReinitializeDistance | ( | double | distance | ) |
Sets minimum reinitialization distance.
The documentation for this class was generated from the following file:
- Core/Solver/LevelSet/LevelSetLiquidSolver2.h