FDMMGLinearSystem3.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_LINEAR_SYSTEM3_HPP
12 #define CUBBYFLOW_FDM_MG_LINEAR_SYSTEM3_HPP
13 
15 #include <Core/Utils/MG.hpp>
16 
17 namespace CubbyFlow
18 {
21 
24 
27 {
29  void Clear();
30 
32  [[nodiscard]] size_t GetNumberOfLevels() const;
33 
35  void ResizeWithCoarsest(const Vector3UZ& coarsestResolution,
36  size_t numberOfLevels);
37 
48  void ResizeWithFinest(const Vector3UZ& finestResolution,
49  size_t maxNumberOfLevels);
50 
53 
56 
59 };
60 
63 {
64  public:
66  static void Restrict(const FDMVector3& finer, FDMVector3* coarser);
67 
69  static void Correct(const FDMVector3& coarser, FDMVector3* finer);
70 
72  template <typename T>
73  static void ResizeArrayWithCoarsest(const Vector3UZ& coarsestResolution,
74  size_t numberOfLevels,
75  std::vector<Array3<T>>* levels);
76 
88  template <typename T>
89  static void ResizeArrayWithFinest(const Vector3UZ& finestResolution,
90  size_t maxNumberOfLevels,
91  std::vector<Array3<T>>* levels);
92 };
93 } // namespace CubbyFlow
94 
96 
97 #endif
void ResizeWithCoarsest(const Vector3UZ &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.
FDMMGMatrix3 A
The system matrix.
Definition: FDMMGLinearSystem3.hpp:52
size_t GetNumberOfLevels() const
Returns the number of multigrid levels.
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
Definition: Array-Impl.hpp:19
FDMMGVector3 b
The RHS vector.
Definition: FDMMGLinearSystem3.hpp:58
void ResizeWithFinest(const Vector3UZ &finestResolution, size_t maxNumberOfLevels)
Resizes the system with the finest resolution and max number of levels.
void Clear()
Clears the linear system.
Multigrid-syle 3-D linear system.
Definition: FDMMGLinearSystem3.hpp:26
FDMMGVector3 x
The solution vector.
Definition: FDMMGLinearSystem3.hpp:55
Multigrid utilities for 2-D FDM system.
Definition: FDMMGLinearSystem3.hpp:62