CubbyFlow::GridBoundaryConditionSolver2 Class Referenceabstract

Abstract base class for 2-D boundary condition solver for grids. More...

#include <Core/Solver/Grid/GridBoundaryConditionSolver2.h>

Inheritance diagram for CubbyFlow::GridBoundaryConditionSolver2:
CubbyFlow::GridFractionalBoundaryConditionSolver2 CubbyFlow::GridBlockedBoundaryConditionSolver2

Public Member Functions

 GridBoundaryConditionSolver2 ()
 Default constructor. More...
 
virtual ~GridBoundaryConditionSolver2 ()
 Default destructor. More...
 
const Collider2PtrGetCollider () const
 Returns associated collider. More...
 
void UpdateCollider (const Collider2Ptr &newCollider, const Size2 &gridSize, const Vector2D &gridSpacing, const Vector2D &gridOrigin)
 Applies new collider and build the internals. More...
 
int GetClosedDomainBoundaryFlag () const
 Returns the closed domain boundary flag. More...
 
void SetClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag. More...
 
virtual void ConstrainVelocity (FaceCenteredGrid2 *velocity, unsigned int extrapolationDepth=5)=0
 
virtual ScalarField2Ptr GetColliderSDF () const =0
 Returns the signed distance field of the collider. More...
 
virtual VectorField2Ptr GetColliderVelocityField () const =0
 Returns the velocity field of the collider. More...
 

Protected Member Functions

virtual void OnColliderUpdated (const Size2 &gridSize, const Vector2D &gridSpacing, const Vector2D &gridOrigin)=0
 Invoked when a new collider is set. More...
 
const Size2GetGridSize () const
 Returns the size of the velocity grid to be constrained. More...
 
const Vector2DGetGridSpacing () const
 Returns the spacing of the velocity grid to be constrained. More...
 
const Vector2DGetGridOrigin () const
 Returns the origin of the velocity grid to be constrained. More...
 

Detailed Description

Abstract base class for 2-D boundary condition solver for grids.

This is a helper class to constrain the 2-D velocity field with given collider object. It also determines whether to open any domain boundaries. To control the friction level, tune the collider parameter.

Constructor & Destructor Documentation

◆ GridBoundaryConditionSolver2()

CubbyFlow::GridBoundaryConditionSolver2::GridBoundaryConditionSolver2 ( )

Default constructor.

◆ ~GridBoundaryConditionSolver2()

virtual CubbyFlow::GridBoundaryConditionSolver2::~GridBoundaryConditionSolver2 ( )
virtual

Default destructor.

Member Function Documentation

◆ ConstrainVelocity()

virtual void CubbyFlow::GridBoundaryConditionSolver2::ConstrainVelocity ( FaceCenteredGrid2 velocity,
unsigned int  extrapolationDepth = 5 
)
pure virtual

Constrains the velocity field to conform the collider boundary.

Parameters
velocityInput and output velocity grid.
extrapolationDepthNumber of inner-collider grid cells that velocity will get extrapolated.

Implemented in CubbyFlow::GridFractionalBoundaryConditionSolver2, and CubbyFlow::GridBlockedBoundaryConditionSolver2.

◆ GetClosedDomainBoundaryFlag()

int CubbyFlow::GridBoundaryConditionSolver2::GetClosedDomainBoundaryFlag ( ) const

Returns the closed domain boundary flag.

◆ GetCollider()

const Collider2Ptr& CubbyFlow::GridBoundaryConditionSolver2::GetCollider ( ) const

Returns associated collider.

◆ GetColliderSDF()

virtual ScalarField2Ptr CubbyFlow::GridBoundaryConditionSolver2::GetColliderSDF ( ) const
pure virtual

Returns the signed distance field of the collider.

Implemented in CubbyFlow::GridFractionalBoundaryConditionSolver2.

◆ GetColliderVelocityField()

virtual VectorField2Ptr CubbyFlow::GridBoundaryConditionSolver2::GetColliderVelocityField ( ) const
pure virtual

Returns the velocity field of the collider.

Implemented in CubbyFlow::GridFractionalBoundaryConditionSolver2.

◆ GetGridOrigin()

const Vector2D& CubbyFlow::GridBoundaryConditionSolver2::GetGridOrigin ( ) const
protected

Returns the origin of the velocity grid to be constrained.

◆ GetGridSize()

const Size2& CubbyFlow::GridBoundaryConditionSolver2::GetGridSize ( ) const
protected

Returns the size of the velocity grid to be constrained.

◆ GetGridSpacing()

const Vector2D& CubbyFlow::GridBoundaryConditionSolver2::GetGridSpacing ( ) const
protected

Returns the spacing of the velocity grid to be constrained.

◆ OnColliderUpdated()

virtual void CubbyFlow::GridBoundaryConditionSolver2::OnColliderUpdated ( const Size2 gridSize,
const Vector2D gridSpacing,
const Vector2D gridOrigin 
)
protectedpure virtual

◆ SetClosedDomainBoundaryFlag()

void CubbyFlow::GridBoundaryConditionSolver2::SetClosedDomainBoundaryFlag ( int  flag)

Sets the closed domain boundary flag.

◆ UpdateCollider()

void CubbyFlow::GridBoundaryConditionSolver2::UpdateCollider ( const Collider2Ptr newCollider,
const Size2 gridSize,
const Vector2D gridSpacing,
const Vector2D gridOrigin 
)

Applies new collider and build the internals.

This function is called to apply new collider and build the internal cache. To provide a hint to the cache, info for the expected velocity grid that will be constrained is provided.

Parameters
newColliderNew collider to apply.
gridSizeSize of the velocity grid to be constrained.
gridSpacingGrid spacing of the velocity grid to be constrained.
gridOriginOrigin of the velocity grid to be constrained.

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