AdvectionSolver3.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_SOLVER3_HPP
12 #define CUBBYFLOW_ADVECTION_SOLVER3_HPP
13 
18 #include <Core/Grid/ScalarGrid.hpp>
19 
20 namespace CubbyFlow
21 {
29 {
30  public:
32  AdvectionSolver3() = default;
33 
35  AdvectionSolver3(const AdvectionSolver3&) = default;
36 
38  AdvectionSolver3(AdvectionSolver3&&) noexcept = default;
39 
41  virtual ~AdvectionSolver3() = default;
42 
44  AdvectionSolver3& operator=(const AdvectionSolver3&) = default;
45 
47  AdvectionSolver3& operator=(AdvectionSolver3&&) noexcept = default;
48 
68  virtual void Advect(const ScalarGrid3& input, const VectorField3& flow,
69  double dt, ScalarGrid3* output,
70  const ScalarField3& boundarySDF = ConstantScalarField3(
71  std::numeric_limits<double>::max())) = 0;
72 
92  virtual void Advect(const CollocatedVectorGrid3& input,
93  const VectorField3& flow, double dt,
94  CollocatedVectorGrid3* output,
95  const ScalarField3& boundarySDF = ConstantScalarField3(
96  std::numeric_limits<double>::max()));
97 
117  virtual void Advect(const FaceCenteredGrid3& input,
118  const VectorField3& flow, double dt,
119  FaceCenteredGrid3* output,
120  const ScalarField3& boundarySDF = ConstantScalarField3(
121  std::numeric_limits<double>::max()));
122 };
123 
125 using AdvectionSolver3Ptr = std::shared_ptr<AdvectionSolver3>;
126 } // namespace CubbyFlow
127 
128 #endif
std::shared_ptr< AdvectionSolver3 > AdvectionSolver3Ptr
Shared pointer type for the 3-D advection solver.
Definition: AdvectionSolver3.hpp:125
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
virtual void Advect(const ScalarGrid3 &input, const VectorField3 &flow, double dt, ScalarGrid3 *output, const ScalarField3 &boundarySDF=ConstantScalarField3(std::numeric_limits< double >::max()))=0
Solves advection equation for given scalar grid.
Definition: pybind11Utils.hpp:20
Abstract based class for 3-D grid-based advection solver.
Definition: AdvectionSolver3.hpp:28
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 N-D collocated vector grid structure.
Definition: CollocatedVectorGrid.hpp:22
AdvectionSolver3 & operator=(const AdvectionSolver3 &)=default
Default copy assignment operator.
ConstantScalarField< 3 > ConstantScalarField3
3-D ConstantScalarField type.
Definition: ConstantScalarField.hpp:46
AdvectionSolver3()=default
Default constructor.
virtual ~AdvectionSolver3()=default
Default virtual destructor.