GridForwardEulerDiffusionSolver2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: GridForwardEulerDiffusionSolver2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 2-D grid-based forward Euler diffusion solver.
6 > Created Time: 2017/08/11
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_GRID_FORWARD_EULER_DIFFUSION_SOLVER2_H
10 #define CUBBYFLOW_GRID_FORWARD_EULER_DIFFUSION_SOLVER2_H
11 
13 
14 namespace CubbyFlow
15 {
28  {
29  public:
32 
43  void Solve(
44  const ScalarGrid2& source,
45  double diffusionCoefficient,
46  double timeIntervalInSeconds,
47  ScalarGrid2* dest,
48  const ScalarField2& boundarySDF = ConstantScalarField2(std::numeric_limits<double>::max()),
49  const ScalarField2& fluidSDF = ConstantScalarField2(-std::numeric_limits<double>::max())) override;
50 
61  void Solve(
62  const CollocatedVectorGrid2& source,
63  double diffusionCoefficient,
64  double timeIntervalInSeconds,
66  const ScalarField2& boundarySDF = ConstantScalarField2(std::numeric_limits<double>::max()),
67  const ScalarField2& fluidSDF = ConstantScalarField2(-std::numeric_limits<double>::max())) override;
68 
79  void Solve(
80  const FaceCenteredGrid2& source,
81  double diffusionCoefficient,
82  double timeIntervalInSeconds,
83  FaceCenteredGrid2* dest,
84  const ScalarField2& boundarySDF = ConstantScalarField2(std::numeric_limits<double>::max()),
85  const ScalarField2& fluidSDF = ConstantScalarField2(-std::numeric_limits<double>::max())) override;
86 
87  private:
88  Array2<char> m_markers;
89 
90  void BuildMarkers(
91  const Size2& size,
92  const std::function<Vector2D(size_t, size_t)>& pos,
93  const ScalarField2& boundarySDF,
94  const ScalarField2& fluidSDF);
95  };
96 
98  using GridForwardEulerDiffusionSolver2Ptr = std::shared_ptr<GridForwardEulerDiffusionSolver2>;
99 }
100 
101 #endif
Abstract base class for 2-D scalar field.
Definition: ScalarField2.h:21
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())) override
std::shared_ptr< GridForwardEulerDiffusionSolver2 > GridForwardEulerDiffusionSolver2Ptr
Shared pointer type for the GridForwardEulerDiffusionSolver2.
Definition: GridForwardEulerDiffusionSolver2.h:98
Abstract base class for 2-D collocated vector grid structure.
Definition: CollocatedVectorGrid2.h:19
2-D point class.
Definition: Point2.h:25
2-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid2.h:25
Definition: pybind11Utils.h:24
Vector2< double > Vector2D
Double-type 2D vector.
Definition: Vector2.h:341
2-D constant scalar field.
Definition: ConstantScalarField2.h:17
2-D grid-based forward Euler diffusion solver.
Definition: GridForwardEulerDiffusionSolver2.h:27
GridForwardEulerDiffusionSolver2()
Default constructor.
2-D array class.
Definition: Array2.h:42
Abstract base class for 2-D scalar grid structure.
Definition: ScalarGrid2.h:21
Abstract base class for 2-D grid-based diffusion equation solver.
Definition: GridDiffusionSolver2.h:28