FMMLevelSetSolver2.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_FMM_LEVEL_SET_SOLVER2_HPP
12 #define CUBBYFLOW_FMM_LEVEL_SET_SOLVER2_HPP
13 
15 
16 namespace CubbyFlow
17 {
30 class FMMLevelSetSolver2 final : public LevelSetSolver2
31 {
32  public:
34  FMMLevelSetSolver2() = default;
35 
43  void Reinitialize(const ScalarGrid2& inputSDF, double maxDistance,
44  ScalarGrid2* outputSDF) override;
45 
54  void Extrapolate(const ScalarGrid2& input, const ScalarField2& sdf,
55  double maxDistance, ScalarGrid2* output) override;
56 
66  void Extrapolate(const CollocatedVectorGrid2& input,
67  const ScalarField2& sdf, double maxDistance,
68  CollocatedVectorGrid2* output) override;
69 
79  void Extrapolate(const FaceCenteredGrid2& input, const ScalarField2& sdf,
80  double maxDistance, FaceCenteredGrid2* output) override;
81 
82  private:
83  void Extrapolate(const ConstArrayView2<double>& input,
84  const ConstArrayView2<double>& sdf,
85  const Vector2D& gridSpacing, double maxDistance,
86  ArrayView2<double> output);
87 };
88 
90 using FMMLevelSetSolver2Ptr = std::shared_ptr<FMMLevelSetSolver2>;
91 } // namespace CubbyFlow
92 
93 #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
void Reinitialize(const ScalarGrid2 &inputSDF, double maxDistance, ScalarGrid2 *outputSDF) override
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
void Extrapolate(const ScalarGrid2 &input, const ScalarField2 &sdf, double maxDistance, ScalarGrid2 *output) override
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
Abstract base class for 2-D level set solver.
Definition: LevelSetSolver2.hpp:23
Generic N-dimensional array class interface.
Definition: Array.hpp:32
std::shared_ptr< FMMLevelSetSolver2 > FMMLevelSetSolver2Ptr
Shared pointer type for the FMMLevelSetSolver2.
Definition: FMMLevelSetSolver2.hpp:90
Abstract base class for N-D collocated vector grid structure.
Definition: CollocatedVectorGrid.hpp:22
Two-dimensional fast marching method (FMM) implementation.
Definition: FMMLevelSetSolver2.hpp:30
FMMLevelSetSolver2()=default
Default constructor.