Loading...
Searching...
No Matches
IterativeLevelSetSolver2.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_ITERATIVE_LEVEL_SET_SOLVER2_HPP
12#define CUBBYFLOW_ITERATIVE_LEVEL_SET_SOLVER2_HPP
13
15
16namespace CubbyFlow
17{
30{
31 public:
34
37
40
43
46 delete;
47
50 delete;
51
61
72
85
97
100
107 void SetMaxCFL(double newMaxCfl);
108
109 protected:
112 const Vector2D& gridSpacing, size_t i, size_t j,
113 std::array<double, 2>* dx,
114 std::array<double, 2>* dy) const = 0;
115
116 private:
118 const ConstArrayView2<double>& sdf,
120 ArrayView2<double> output);
121
122 [[nodiscard]] static unsigned int DistanceToNumberOfIterations(
123 double distance, double dtau);
124
125 [[nodiscard]] static double Sign(const ConstArrayView2<double>& sdf,
126 const Vector2D& gridSpacing, size_t i,
127 size_t j);
128
129 [[nodiscard]] double PseudoTimeStep(const ConstArrayView2<double>& sdf,
131
132 double m_maxCFL = 0.5;
133};
134
136} // namespace CubbyFlow
137
138#endif
Generic N-dimensional array class interface.
Definition ArrayView.hpp:26
Abstract base class for N-D collocated vector grid structure.
Definition CollocatedVectorGrid.hpp:23
N-D face-centered (a.k.a MAC or staggered) grid.
Definition FaceCenteredGrid.hpp:32
Abstract base class for 2-D PDE-based iterative level set solver.
Definition IterativeLevelSetSolver2.hpp:30
IterativeLevelSetSolver2(IterativeLevelSetSolver2 &&) noexcept=delete
Deleted move constructor.
void Reinitialize(const ScalarGrid2 &inputSDF, double maxDistance, ScalarGrid2 *outputSDF) override
IterativeLevelSetSolver2(const IterativeLevelSetSolver2 &)=delete
Deleted copy constructor.
double GetMaxCFL() const
Returns the maximum CFL limit.
IterativeLevelSetSolver2()=default
Default constructor.
void SetMaxCFL(double newMaxCfl)
Sets the maximum CFL limit.
void Extrapolate(const ScalarGrid2 &input, const ScalarField2 &sdf, double maxDistance, ScalarGrid2 *output) override
virtual void GetDerivatives(ConstArrayView2< double > grid, const Vector2D &gridSpacing, size_t i, size_t j, std::array< double, 2 > *dx, std::array< double, 2 > *dy) const =0
Computes the derivatives for given grid point.
Abstract base class for 2-D level set solver.
Definition LevelSetSolver2.hpp:24
Definition Matrix.hpp:30
Abstract base class for N-D scalar field.
Definition ScalarField.hpp:25
Abstract base class for N-D scalar grid structure.
Definition ScalarGrid.hpp:25
Definition pybind11Utils.hpp:21
std::shared_ptr< IterativeLevelSetSolver2 > IterativeLevelSetSolver2Ptr
Definition IterativeLevelSetSolver2.hpp:135