Jet  v1.3.3
Public Member Functions | Protected Member Functions | List of all members
jet::GridBoundaryConditionSolver2 Class Referenceabstract

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

#include <jet/grid_boundary_condition_solver2.h>

Inheritance diagram for jet::GridBoundaryConditionSolver2:
jet::GridFractionalBoundaryConditionSolver2 jet::GridBlockedBoundaryConditionSolver2

Public Member Functions

 GridBoundaryConditionSolver2 ()
 Default constructor. More...
 
virtual ~GridBoundaryConditionSolver2 ()
 Default destructor. More...
 
const Collider2Ptrcollider () 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 closedDomainBoundaryFlag () 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 colliderSdf () const =0
 Returns the signed distance field of the collider. More...
 
virtual VectorField2Ptr colliderVelocityField () 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 Size2gridSize () const
 Returns the size of the velocity grid to be constrained. More...
 
const Vector2DgridSpacing () const
 Returns the spacing of the velocity grid to be constrained. More...
 
const Vector2DgridOrigin () 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()

jet::GridBoundaryConditionSolver2::GridBoundaryConditionSolver2 ( )

Default constructor.

◆ ~GridBoundaryConditionSolver2()

virtual jet::GridBoundaryConditionSolver2::~GridBoundaryConditionSolver2 ( )
virtual

Default destructor.

Member Function Documentation

◆ closedDomainBoundaryFlag()

int jet::GridBoundaryConditionSolver2::closedDomainBoundaryFlag ( ) const

Returns the closed domain boundary flag.

◆ collider()

const Collider2Ptr& jet::GridBoundaryConditionSolver2::collider ( ) const

Returns associated collider.

◆ colliderSdf()

virtual ScalarField2Ptr jet::GridBoundaryConditionSolver2::colliderSdf ( ) const
pure virtual

Returns the signed distance field of the collider.

Implemented in jet::GridFractionalBoundaryConditionSolver2.

◆ colliderVelocityField()

virtual VectorField2Ptr jet::GridBoundaryConditionSolver2::colliderVelocityField ( ) const
pure virtual

Returns the velocity field of the collider.

Implemented in jet::GridFractionalBoundaryConditionSolver2.

◆ constrainVelocity()

virtual void jet::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 jet::GridFractionalBoundaryConditionSolver2, and jet::GridBlockedBoundaryConditionSolver2.

◆ gridOrigin()

const Vector2D& jet::GridBoundaryConditionSolver2::gridOrigin ( ) const
protected

Returns the origin of the velocity grid to be constrained.

◆ gridSize()

const Size2& jet::GridBoundaryConditionSolver2::gridSize ( ) const
protected

Returns the size of the velocity grid to be constrained.

◆ gridSpacing()

const Vector2D& jet::GridBoundaryConditionSolver2::gridSpacing ( ) const
protected

Returns the spacing of the velocity grid to be constrained.

◆ onColliderUpdated()

virtual void jet::GridBoundaryConditionSolver2::onColliderUpdated ( const Size2 gridSize,
const Vector2D gridSpacing,
const Vector2D gridOrigin 
)
protectedpure virtual

Invoked when a new collider is set.

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

◆ setClosedDomainBoundaryFlag()

void jet::GridBoundaryConditionSolver2::setClosedDomainBoundaryFlag ( int  flag)

Sets the closed domain boundary flag.

◆ updateCollider()

void jet::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: