AdvectionSolver2.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_ADVECTION_SOLVER2_HPP
12 #define CUBBYFLOW_ADVECTION_SOLVER2_HPP
13 
18 #include <Core/Grid/ScalarGrid.hpp>
19 
20 namespace CubbyFlow
21 {
29 {
30  public:
32  AdvectionSolver2() = default;
33 
35  AdvectionSolver2(const AdvectionSolver2&) = default;
36 
38  AdvectionSolver2(AdvectionSolver2&&) noexcept = default;
39 
41  virtual ~AdvectionSolver2() = default;
42 
44  AdvectionSolver2& operator=(const AdvectionSolver2&) = default;
45 
47  AdvectionSolver2& operator=(AdvectionSolver2&&) noexcept = default;
48 
68  virtual void Advect(const ScalarGrid2& input, const VectorField2& flow,
69  double dt, ScalarGrid2* output,
70  const ScalarField2& boundarySDF = ConstantScalarField2(
71  std::numeric_limits<double>::max())) = 0;
72 
92  virtual void Advect(const CollocatedVectorGrid2& input,
93  const VectorField2& flow, double dt,
94  CollocatedVectorGrid2* output,
95  const ScalarField2& boundarySDF = ConstantScalarField2(
96  std::numeric_limits<double>::max()));
97 
117  virtual void Advect(const FaceCenteredGrid2& input,
118  const VectorField2& flow, double dt,
119  FaceCenteredGrid2* output,
120  const ScalarField2& boundarySDF = ConstantScalarField2(
121  std::numeric_limits<double>::max()));
122 };
123 
125 using AdvectionSolver2Ptr = std::shared_ptr<AdvectionSolver2>;
126 } // namespace CubbyFlow
127 
128 #endif
AdvectionSolver2()=default
Default constructor.
Abstract base class for N-D scalar grid structure.
Definition: ScalarGrid.hpp:24
Abstract base class for N-D scalar field.
Definition: ScalarField.hpp:24
AdvectionSolver2 & operator=(const AdvectionSolver2 &)=default
Default copy assignment operator.
Definition: pybind11Utils.hpp:20
std::shared_ptr< AdvectionSolver2 > AdvectionSolver2Ptr
Shared pointer type for the 2-D advection solver.
Definition: AdvectionSolver2.hpp:125
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
virtual ~AdvectionSolver2()=default
Default virtual destructor.
Abstract based class for 2-D grid-based advection solver.
Definition: AdvectionSolver2.hpp:28
Abstract base class for N-D vector field.
Definition: VectorField.hpp:42
virtual void Advect(const ScalarGrid2 &input, const VectorField2 &flow, double dt, ScalarGrid2 *output, const ScalarField2 &boundarySDF=ConstantScalarField2(std::numeric_limits< double >::max()))=0
Solves advection equation for given scalar grid.
Abstract base class for N-D collocated vector grid structure.
Definition: CollocatedVectorGrid.hpp:22
ConstantScalarField< 2 > ConstantScalarField2
2-D ConstantScalarField type.
Definition: ConstantScalarField.hpp:43