GridForwardEulerDiffusionSolver3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: GridForwardEulerDiffusionSolver3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 3-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_SOLVER3_H
10 #define CUBBYFLOW_GRID_FORWARD_EULER_DIFFUSION_SOLVER3_H
11 
13 
14 namespace CubbyFlow
15 {
28  {
29  public:
32 
43  void Solve(
44  const ScalarGrid3& source,
45  double diffusionCoefficient,
46  double timeIntervalInSeconds,
47  ScalarGrid3* dest,
48  const ScalarField3& boundarySDF = ConstantScalarField3(std::numeric_limits<double>::max()),
49  const ScalarField3& fluidSDF = ConstantScalarField3(-std::numeric_limits<double>::max())) override;
50 
61  void Solve(
62  const CollocatedVectorGrid3& source,
63  double diffusionCoefficient,
64  double timeIntervalInSeconds,
66  const ScalarField3& boundarySDF = ConstantScalarField3(std::numeric_limits<double>::max()),
67  const ScalarField3& fluidSDF = ConstantScalarField3(-std::numeric_limits<double>::max())) override;
68 
79  void Solve(
80  const FaceCenteredGrid3& source,
81  double diffusionCoefficient,
82  double timeIntervalInSeconds,
83  FaceCenteredGrid3* dest,
84  const ScalarField3& boundarySDF = ConstantScalarField3(std::numeric_limits<double>::max()),
85  const ScalarField3& fluidSDF = ConstantScalarField3(-std::numeric_limits<double>::max())) override;
86 
87  private:
88  Array3<char> m_markers;
89 
90  void BuildMarkers(
91  const Size3& size,
92  const std::function<Vector3D(size_t, size_t, size_t)>& pos,
93  const ScalarField3& boundarySDF,
94  const ScalarField3& fluidSDF);
95  };
96 
98  using GridForwardEulerDiffusionSolver3Ptr = std::shared_ptr<GridForwardEulerDiffusionSolver3>;
99 }
100 
101 #endif
Abstract base class for 3-D collocated vector grid structure.
Definition: CollocatedVectorGrid3.h:19
GridForwardEulerDiffusionSolver3()
Default constructor.
3-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid3.h:25
3-D point class.
Definition: Point3.h:26
3-D grid-based forward Euler diffusion solver.
Definition: GridForwardEulerDiffusionSolver3.h:27
Abstract base class for 3-D grid-based diffusion equation solver.
Definition: GridDiffusionSolver3.h:28
Definition: pybind11Utils.h:24
3-D constant scalar field.
Definition: ConstantScalarField3.h:17
Abstract base class for 3-D scalar field.
Definition: ScalarField3.h:21
Abstract base class for 3-D scalar grid structure.
Definition: ScalarGrid3.h:21
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
3-D array class.
Definition: Array3.h:45
std::shared_ptr< GridForwardEulerDiffusionSolver3 > GridForwardEulerDiffusionSolver3Ptr
Shared pointer type for the GridForwardEulerDiffusionSolver3.
Definition: GridForwardEulerDiffusionSolver3.h:98
Vector3< double > Vector3D
Double-type 3D vector.
Definition: Vector3.h:353