Level set based 3-D liquid solver. More...
#include <Core/Solver/LevelSet/LevelSetLiquidSolver3.h>
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 | GetSignedDistanceField () const |
Returns signed-distance field. More... | |
LevelSetSolver3Ptr | GetLevelSetSolver () 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 CubbyFlow::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 Vector3D & | GetGravity () 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 onoff) |
Sets whether the solver should use compressed linear system. More... | |
const AdvectionSolver3Ptr & | GetAdvectionSolver () const |
Returns the advection solver instance. More... | |
void | SetAdvectionSolver (const AdvectionSolver3Ptr &newSolver) |
Sets the advection solver. More... | |
const GridDiffusionSolver3Ptr & | GetDiffusionSolver () const |
Returns the diffusion solver instance. More... | |
void | SetDiffusionSolver (const GridDiffusionSolver3Ptr &newSolver) |
Sets the diffusion solver. More... | |
const GridPressureSolver3Ptr & | GetPressureSolver () 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 GridSystemData3Ptr & | GetGridSystemData () const |
Returns the grid system data. More... | |
void | ResizeGrid (const Size3 &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin) const |
Resizes grid system data. More... | |
Size3 | 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 FaceCenteredGrid3Ptr & | GetVelocity () const |
Returns the velocity field. More... | |
const Collider3Ptr & | GetCollider () const |
Returns the collider. More... | |
void | SetCollider (const Collider3Ptr &newCollider) |
Sets the collider. More... | |
const GridEmitter3Ptr & | GetEmitter () 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... | |
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 LevelSetLiquidSolver3. More... | |
Static Public Member Functions inherited from CubbyFlow::GridFluidSolver3 | |
static Builder | GetBuilder () |
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 | GetFluidSDF () const override |
Returns fluid region as a signed-distance field. More... | |
Protected Member Functions inherited from CubbyFlow::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 | 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 (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... | |
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]
CubbyFlow::LevelSetLiquidSolver3::LevelSetLiquidSolver3 | ( | ) |
Default constructor.
◆ LevelSetLiquidSolver3() [2/2]
CubbyFlow::LevelSetLiquidSolver3::LevelSetLiquidSolver3 | ( | const Size3 & | resolution, |
const Vector3D & | gridSpacing, | ||
const Vector3D & | gridOrigin | ||
) |
Constructs solver with initial grid size.
◆ ~LevelSetLiquidSolver3()
|
virtual |
Destructor.
Member Function Documentation
◆ ComputeAdvection()
|
overrideprotectedvirtual |
Customizes advection step.
Reimplemented from CubbyFlow::GridFluidSolver3.
◆ ComputeVolume()
double CubbyFlow::LevelSetLiquidSolver3::ComputeVolume | ( | ) | const |
Returns liquid volume measured by smeared Heaviside function.
This function measures the liquid volume (area in 3-D) using smeared Heaviside function. Thus, the estimated volume is an approximated quantity.
◆ GetBuilder()
|
static |
Returns builder fox LevelSetLiquidSolver3.
◆ 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 LevelSetLiquidSolver3::signedDistanceField().
Reimplemented from CubbyFlow::GridFluidSolver3.
◆ GetLevelSetSolver()
LevelSetSolver3Ptr CubbyFlow::LevelSetLiquidSolver3::GetLevelSetSolver | ( | ) | const |
Returns the level set solver.
◆ GetSignedDistanceField()
ScalarGrid3Ptr CubbyFlow::LevelSetLiquidSolver3::GetSignedDistanceField | ( | ) | const |
Returns signed-distance field.
◆ OnBeginAdvanceTimeStep()
|
overrideprotectedvirtual |
Called at the beginning of the time-step.
Reimplemented from CubbyFlow::GridFluidSolver3.
◆ OnEndAdvanceTimeStep()
|
overrideprotectedvirtual |
Called at the end of the time-step.
Reimplemented from CubbyFlow::GridFluidSolver3.
◆ SetIsGlobalCompensationEnabled()
void CubbyFlow::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 non-dissipative water." ACM Transactions on Graphics (TOG) 34, no. 1 (3005): 81-97.
◆ SetLevelSetSolver()
void CubbyFlow::LevelSetLiquidSolver3::SetLevelSetSolver | ( | const LevelSetSolver3Ptr & | newSolver | ) |
Sets the level set solver.
◆ SetMinReinitializeDistance()
void CubbyFlow::LevelSetLiquidSolver3::SetMinReinitializeDistance | ( | double | distance | ) |
Sets minimum reinitialization distance.
The documentation for this class was generated from the following file:
- Core/Solver/LevelSet/LevelSetLiquidSolver3.h