GridDiffusionSolver2.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_DIFFUSION_SOLVER2_HPP
12 #define CUBBYFLOW_GRID_DIFFUSION_SOLVER2_HPP
13 
17 #include <Core/Grid/ScalarGrid.hpp>
18 
19 namespace CubbyFlow
20 {
31 {
32  public:
34  GridDiffusionSolver2() = default;
35 
38 
40  GridDiffusionSolver2(GridDiffusionSolver2&&) noexcept = delete;
41 
43  virtual ~GridDiffusionSolver2() = default;
44 
47 
50 
61  virtual void Solve(const ScalarGrid2& source, double diffusionCoefficient,
62  double timeIntervalInSeconds, ScalarGrid2* dest,
63  const ScalarField2& boundarySDF =
65  std::numeric_limits<double>::max() },
66  const ScalarField2& fluidSDF = ConstantScalarField2{
67  -std::numeric_limits<double>::max() }) = 0;
68 
79  virtual void Solve(
80  const CollocatedVectorGrid2& source, double diffusionCoefficient,
81  double timeIntervalInSeconds, CollocatedVectorGrid2* dest,
82  const ScalarField2& boundarySDF =
83  ConstantScalarField2{ std::numeric_limits<double>::max() },
84  const ScalarField2& fluidSDF = ConstantScalarField2{
85  -std::numeric_limits<double>::max() }) = 0;
86 
97  virtual void Solve(const FaceCenteredGrid2& source,
98  double diffusionCoefficient,
99  double timeIntervalInSeconds, FaceCenteredGrid2* dest,
100  const ScalarField2& boundarySDF =
102  std::numeric_limits<double>::max() },
103  const ScalarField2& fluidSDF = ConstantScalarField2{
104  -std::numeric_limits<double>::max() }) = 0;
105 };
106 
108 using GridDiffusionSolver2Ptr = std::shared_ptr<GridDiffusionSolver2>;
109 } // namespace CubbyFlow
110 
111 #endif
virtual ~GridDiffusionSolver2()=default
Default virtual destructor.
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
GridDiffusionSolver2 & operator=(const GridDiffusionSolver2 &)=delete
Deleted copy assignment operator.
Definition: pybind11Utils.hpp:20
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
virtual void Solve(const ScalarGrid2 &source, double diffusionCoefficient, double timeIntervalInSeconds, ScalarGrid2 *dest, const ScalarField2 &boundarySDF=ConstantScalarField2{ std::numeric_limits< double >::max() }, const ScalarField2 &fluidSDF=ConstantScalarField2{ -std::numeric_limits< double >::max() })=0
GridDiffusionSolver2()=default
Default constructor.
Abstract base class for N-D collocated vector grid structure.
Definition: CollocatedVectorGrid.hpp:22
N-D constant scalar field.
Definition: ConstantScalarField.hpp:20
Abstract base class for 2-D grid-based diffusion equation solver.
Definition: GridDiffusionSolver2.hpp:30
std::shared_ptr< GridDiffusionSolver2 > GridDiffusionSolver2Ptr
Shared pointer type for the GridDiffusionSolver2.
Definition: GridDiffusionSolver2.hpp:108