GridForwardEulerDiffusionSolver3.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_FORWARD_EULER_DIFFUSION_SOLVER3_HPP
12 #define CUBBYFLOW_GRID_FORWARD_EULER_DIFFUSION_SOLVER3_HPP
13 
15 
16 namespace CubbyFlow
17 {
30 {
31  public:
34 
37  delete;
38 
41  GridForwardEulerDiffusionSolver3&&) noexcept = delete;
42 
44  ~GridForwardEulerDiffusionSolver3() override = default;
45 
48  const GridForwardEulerDiffusionSolver3&) = delete;
49 
52  GridForwardEulerDiffusionSolver3&&) noexcept = delete;
53 
64  void Solve(const ScalarGrid3& source, double diffusionCoefficient,
65  double timeIntervalInSeconds, ScalarGrid3* dest,
66  const ScalarField3& boundarySDF =
67  ConstantScalarField3{ std::numeric_limits<double>::max() },
68  const ScalarField3& fluidSDF = ConstantScalarField3{
69  -std::numeric_limits<double>::max() }) override;
70 
81  void Solve(const CollocatedVectorGrid3& source, double diffusionCoefficient,
82  double timeIntervalInSeconds, CollocatedVectorGrid3* dest,
83  const ScalarField3& boundarySDF =
84  ConstantScalarField3{ std::numeric_limits<double>::max() },
85  const ScalarField3& fluidSDF = ConstantScalarField3{
86  -std::numeric_limits<double>::max() }) override;
87 
98  void Solve(const FaceCenteredGrid3& source, double diffusionCoefficient,
99  double timeIntervalInSeconds, FaceCenteredGrid3* dest,
100  const ScalarField3& boundarySDF =
101  ConstantScalarField3{ std::numeric_limits<double>::max() },
102  const ScalarField3& fluidSDF = ConstantScalarField3{
103  -std::numeric_limits<double>::max() }) override;
104 
105  private:
106  void BuildMarkers(const Vector3UZ& size,
107  const std::function<Vector3D(const Vector3UZ&)>& pos,
108  const ScalarField3& boundarySDF,
109  const ScalarField3& fluidSDF);
110 
111  Array3<char> m_markers;
112 };
113 
116  std::shared_ptr<GridForwardEulerDiffusionSolver3>;
117 } // namespace CubbyFlow
118 
119 #endif
~GridForwardEulerDiffusionSolver3() override=default
Default virtual destructor.
Abstract base class for N-D scalar grid structure.
Definition: ScalarGrid.hpp:24
GridForwardEulerDiffusionSolver3 & operator=(const GridForwardEulerDiffusionSolver3 &)=delete
Deleted copy assignment operator.
Abstract base class for N-D scalar field.
Definition: ScalarField.hpp:24
3-D grid-based forward Euler diffusion solver.
Definition: GridForwardEulerDiffusionSolver3.hpp:29
Abstract base class for 3-D grid-based diffusion equation solver.
Definition: GridDiffusionSolver3.hpp:30
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
Definition: Array-Impl.hpp:19
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
GridForwardEulerDiffusionSolver3()=default
Default constructor.
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() }) override
Abstract base class for N-D collocated vector grid structure.
Definition: CollocatedVectorGrid.hpp:22
std::shared_ptr< GridForwardEulerDiffusionSolver3 > GridForwardEulerDiffusionSolver3Ptr
Shared pointer type for the GridForwardEulerDiffusionSolver3.
Definition: GridForwardEulerDiffusionSolver3.hpp:116
N-D constant scalar field.
Definition: ConstantScalarField.hpp:20
Vector3< double > Vector3D
Definition: Matrix.hpp:787