Loading...
Searching...
No Matches
IterativeLevelSetSolver3.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_SOLVER3_HPP
12#define CUBBYFLOW_ITERATIVE_LEVEL_SET_SOLVER3_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 Vector3D& gridSpacing, size_t i, size_t j,
113 size_t k, std::array<double, 2>* dx,
114 std::array<double, 2>* dy,
115 std::array<double, 2>* dz) const = 0;
116
117 private:
119 const ConstArrayView3<double>& sdf,
121 ArrayView3<double> output);
122
123 [[nodiscard]] static unsigned int DistanceToNumberOfIterations(
124 double distance, double dtau);
125
126 [[nodiscard]] static double Sign(const ConstArrayView3<double>& sdf,
127 const Vector3D& gridSpacing, size_t i,
128 size_t j, size_t k);
129
130 [[nodiscard]] double PseudoTimeStep(const ConstArrayView3<double>& sdf,
132
133 double m_maxCFL = 0.5;
134};
135
137} // namespace CubbyFlow
138
139#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 3-D PDE-based iterative level set solver.
Definition IterativeLevelSetSolver3.hpp:30
IterativeLevelSetSolver3()=default
Default constructor.
double GetMaxCFL() const
Returns the maximum CFL limit.
IterativeLevelSetSolver3(IterativeLevelSetSolver3 &&) noexcept=delete
Deleted move constructor.
void Extrapolate(const ScalarGrid3 &input, const ScalarField3 &sdf, double maxDistance, ScalarGrid3 *output) override
virtual void GetDerivatives(ConstArrayView3< double > grid, const Vector3D &gridSpacing, size_t i, size_t j, size_t k, std::array< double, 2 > *dx, std::array< double, 2 > *dy, std::array< double, 2 > *dz) const =0
Computes the derivatives for given grid point.
IterativeLevelSetSolver3(const IterativeLevelSetSolver3 &)=delete
Deleted copy constructor.
void Reinitialize(const ScalarGrid3 &inputSDF, double maxDistance, ScalarGrid3 *outputSDF) override
void SetMaxCFL(double newMaxCFL)
Sets the maximum CFL limit.
Abstract base class for 3-D level set solver.
Definition LevelSetSolver3.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< IterativeLevelSetSolver3 > IterativeLevelSetSolver3Ptr
Definition IterativeLevelSetSolver3.hpp:136