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