Loading...
Searching...
No Matches
FDMMGSolver3.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_FDM_MG_SOLVER3_HPP
12#define CUBBYFLOW_FDM_MG_SOLVER3_HPP
13
16#include <Core/Utils/MG.hpp>
17
18namespace CubbyFlow
19{
22{
23 public:
25 FDMMGSolver3(size_t maxNumberOfLevels,
26 unsigned int numberOfRestrictionIter = 5,
27 unsigned int numberOfCorrectionIter = 5,
28 unsigned int numberOfCoarsestIter = 20,
29 unsigned int numberOfFinalIter = 20,
30 double maxTolerance = 1e-9, double sorFactor = 1.5,
31 bool useRedBlackOrdering = false);
32
35
37 [[nodiscard]] double GetSORFactor() const;
38
41
43 bool Solve(FDMLinearSystem3* system) final;
44
46 virtual bool Solve(FDMMGLinearSystem3* system);
47
48 private:
49 MGParameters<FDMBLAS3> m_mgParams;
50 double m_sorFactor;
51 bool m_useRedBlackOrdering;
52};
53
55using FDMMGSolver3Ptr = std::shared_ptr<FDMMGSolver3>;
56} // namespace CubbyFlow
57
58#endif
Abstract base class for 3-D finite difference-type linear system solver.
Definition FDMLinearSystemSolver3.hpp:20
3-D finite difference-type linear system solver using Multigrid.
Definition FDMMGSolver3.hpp:22
const MGParameters< FDMBLAS3 > & GetParams() const
Returns the Multigrid parameters.
double GetSORFactor() const
Returns the SOR (Successive Over Relaxation) factor.
bool GetUseRedBlackOrdering() const
Returns true if red-black ordering is enabled.
virtual bool Solve(FDMMGLinearSystem3 *system)
Solves Multigrid linear system.
bool Solve(FDMLinearSystem3 *system) final
No-op. Multigrid-type solvers do not solve FDMLinearSystem3.
FDMMGSolver3(size_t maxNumberOfLevels, unsigned int numberOfRestrictionIter=5, unsigned int numberOfCorrectionIter=5, unsigned int numberOfCoarsestIter=20, unsigned int numberOfFinalIter=20, double maxTolerance=1e-9, double sorFactor=1.5, bool useRedBlackOrdering=false)
Constructs the solver with given parameters.
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
std::shared_ptr< FDMMGSolver3 > FDMMGSolver3Ptr
Shared pointer type for the FDMMGSolver3.
Definition FDMMGSolver3.hpp:55
Linear system (Ax=b) for 3-D finite differencing.
Definition FDMLinearSystem3.hpp:44
Multigrid-syle 3-D linear system.
Definition FDMMGLinearSystem3.hpp:27