CubbyFlow::GridPressureSolver2 Class Referenceabstract

Abstract base class for 2-D grid-based pressure solver. More...

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

Inheritance diagram for CubbyFlow::GridPressureSolver2:
CubbyFlow::GridFractionalSinglePhasePressureSolver2 CubbyFlow::GridSinglePhasePressureSolver2

Public Member Functions

 GridPressureSolver2 ()
 Default constructor. More...
 
virtual ~GridPressureSolver2 ()
 Default destructor. More...
 
virtual void Solve (const FaceCenteredGrid2 &input, double timeIntervalInSeconds, FaceCenteredGrid2 *output, const ScalarField2 &boundarySDF=ConstantScalarField2(std::numeric_limits< double >::max()), const VectorField2 &boundaryVelocity=ConstantVectorField2({ 0, 0 }), const ScalarField2 &fluidSDF=ConstantScalarField2(-std::numeric_limits< double >::max()), bool useCompressed=false)=0
 Solves the pressure term and apply it to the velocity field. More...
 
virtual GridBoundaryConditionSolver2Ptr SuggestedBoundaryConditionSolver () const =0
 Returns the best boundary condition solver for this solver. More...
 

Detailed Description

Abstract base class for 2-D grid-based pressure solver.

This class represents a 2-D grid-based pressure solver interface which can be used as a sub-step of GridFluidSolver2. Inheriting classes must implement the core GridPressureSolver2::Solve function as well as the helper function GridPressureSolver2::SuggestedBoundaryConditionSolver.

Constructor & Destructor Documentation

◆ GridPressureSolver2()

CubbyFlow::GridPressureSolver2::GridPressureSolver2 ( )

Default constructor.

◆ ~GridPressureSolver2()

virtual CubbyFlow::GridPressureSolver2::~GridPressureSolver2 ( )
virtual

Default destructor.

Member Function Documentation

◆ Solve()

virtual void CubbyFlow::GridPressureSolver2::Solve ( const FaceCenteredGrid2 input,
double  timeIntervalInSeconds,
FaceCenteredGrid2 output,
const ScalarField2 boundarySDF = ConstantScalarField2(std::numeric_limits< double >::max()),
const VectorField2 boundaryVelocity = ConstantVectorField2({ 0, 0 }),
const ScalarField2 fluidSDF = ConstantScalarField2(-std::numeric_limits< double >::max()),
bool  useCompressed = false 
)
pure virtual

Solves the pressure term and apply it to the velocity field.

This function takes input velocity field and outputs pressure-applied velocity field. It also accepts extra arguments such as boundarySDF and fluidSDF that represent signed-distance representation of the boundary and fluid area. The negative region of boundarySDF means it is occupied by solid object. Also, the positive / negative area of the fluidSDF means it is occupied by fluid / atmosphere. If not specified, constant scalar field with std::numeric_limits<double>::max() will be used for boundarySDF meaning that no boundary at all. Similarly, a constant field with -std::numeric_limits<double>::max() will be used for fluidSDF which means it's fully occupied with fluid without any atmosphere.

Parameters
[in]inputThe input velocity field.
[in]timeIntervalInSecondsThe time interval for the sim.
[in,out]outputThe output velocity field.
[in]boundarySDFThe SDF of the boundary.
[in]boundaryVelocityThe velocity of the boundary.
[in]fluidSDFThe SDF of the fluid/atmosphere.
[in]useCompressedTrue if it uses compressed system.

Implemented in CubbyFlow::GridFractionalSinglePhasePressureSolver2, and CubbyFlow::GridSinglePhasePressureSolver2.

◆ SuggestedBoundaryConditionSolver()

virtual GridBoundaryConditionSolver2Ptr CubbyFlow::GridPressureSolver2::SuggestedBoundaryConditionSolver ( ) const
pure virtual

Returns the best boundary condition solver for this solver.

This function returns the best boundary condition solver that works well with this pressure solver. Depending on the pressure solver implementation, different boundary condition solver might be used.

Implemented in CubbyFlow::GridFractionalSinglePhasePressureSolver2, and CubbyFlow::GridSinglePhasePressureSolver2.


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