GridPressureSolver3.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_GRID_PRESSURE_SOLVER3_HPP
12 #define CUBBYFLOW_GRID_PRESSURE_SOLVER3_HPP
13 
18 
19 namespace CubbyFlow
20 {
30 {
31  public:
33  GridPressureSolver3() = default;
34 
37 
39  GridPressureSolver3(GridPressureSolver3&&) noexcept = delete;
40 
42  virtual ~GridPressureSolver3() = default;
43 
46 
49 
73  virtual void Solve(
74  const FaceCenteredGrid3& input, double timeIntervalInSeconds,
75  FaceCenteredGrid3* output,
76  const ScalarField3& boundarySDF =
77  ConstantScalarField3{ std::numeric_limits<double>::max() },
78  const VectorField3& boundaryVelocity = ConstantVectorField3{ { 0, 0,
79  0 } },
80  const ScalarField3& fluidSDF =
81  ConstantScalarField3{ -std::numeric_limits<double>::max() },
82  bool useCompressed = false) = 0;
83 
91  [[nodiscard]] virtual GridBoundaryConditionSolver3Ptr
93 };
94 
96 using GridPressureSolver3Ptr = std::shared_ptr<GridPressureSolver3>;
97 } // namespace CubbyFlow
98 
99 #endif
N-D constant vector field.
Definition: ConstantVectorField.hpp:20
virtual ~GridPressureSolver3()=default
Default virtual destructor.
GridPressureSolver3()=default
Default constructor.
virtual void Solve(const FaceCenteredGrid3 &input, double timeIntervalInSeconds, FaceCenteredGrid3 *output, const ScalarField3 &boundarySDF=ConstantScalarField3{ std::numeric_limits< double >::max() }, const VectorField3 &boundaryVelocity=ConstantVectorField3{ { 0, 0, 0 } }, const ScalarField3 &fluidSDF=ConstantScalarField3{ -std::numeric_limits< double >::max() }, bool useCompressed=false)=0
Solves the pressure term and apply it to the velocity field.
std::shared_ptr< GridPressureSolver3 > GridPressureSolver3Ptr
Shared pointer type for the GridPressureSolver3.
Definition: GridPressureSolver3.hpp:96
std::shared_ptr< GridBoundaryConditionSolver3 > GridBoundaryConditionSolver3Ptr
Shared pointer type for the GridBoundaryConditionSolver3.
Definition: GridBoundaryConditionSolver3.hpp:117
Abstract base class for N-D scalar field.
Definition: ScalarField.hpp:24
Definition: pybind11Utils.hpp:20
GridPressureSolver3 & operator=(const GridPressureSolver3 &)=delete
Deleted copy assignment operator.
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
Abstract base class for N-D vector field.
Definition: VectorField.hpp:42
Abstract base class for 2-D grid-based pressure solver.
Definition: GridPressureSolver3.hpp:29
N-D constant scalar field.
Definition: ConstantScalarField.hpp:20
virtual GridBoundaryConditionSolver3Ptr SuggestedBoundaryConditionSolver() const =0
Returns the best boundary condition solver for this solver.