GridPressureSolver2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: GridPressureSolver2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Abstract base class for 2-D grid-based pressure solver.
6 > Created Time: 2017/08/10
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_GRID_PRESSURE_SOLVER2_H
10 #define CUBBYFLOW_GRID_PRESSURE_SOLVER2_H
11 
16 
17 namespace CubbyFlow
18 {
28  {
29  public:
32 
34  virtual ~GridPressureSolver2();
35 
58  virtual void Solve(
59  const FaceCenteredGrid2& input,
60  double timeIntervalInSeconds,
61  FaceCenteredGrid2* output,
62  const ScalarField2& boundarySDF = ConstantScalarField2(std::numeric_limits<double>::max()),
63  const VectorField2& boundaryVelocity = ConstantVectorField2({ 0, 0 }),
64  const ScalarField2& fluidSDF = ConstantScalarField2(-std::numeric_limits<double>::max()),
65  bool useCompressed = false) = 0;
66 
75  };
76 
78  using GridPressureSolver2Ptr = std::shared_ptr<GridPressureSolver2>;
79 }
80 
81 #endif
Abstract base class for 2-D scalar field.
Definition: ScalarField2.h:21
Abstract base class for 2-D grid-based pressure solver.
Definition: GridPressureSolver2.h:27
virtual ~GridPressureSolver2()
Default destructor.
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.
std::shared_ptr< GridBoundaryConditionSolver2 > GridBoundaryConditionSolver2Ptr
Shared pointer type for the GridBoundaryConditionSolver2.
Definition: GridBoundaryConditionSolver2.h:104
GridPressureSolver2()
Default constructor.
2-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid2.h:25
Definition: pybind11Utils.h:24
2-D constant vector field.
Definition: ConstantVectorField2.h:17
std::shared_ptr< GridPressureSolver2 > GridPressureSolver2Ptr
Shared pointer type for the GridPressureSolver2.
Definition: GridPressureSolver2.h:78
2-D constant scalar field.
Definition: ConstantScalarField2.h:17
Abstract base class for 2-D vector field.
Definition: VectorField2.h:21
virtual GridBoundaryConditionSolver2Ptr SuggestedBoundaryConditionSolver() const =0
Returns the best boundary condition solver for this solver.