Loading...
Searching...
No Matches
FDMMGLinearSystem2.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_SYSTEM2_HPP
12#define CUBBYFLOW_FDM_MG_LINEAR_SYSTEM2_HPP
13
15#include <Core/Utils/MG.hpp>
16
17namespace CubbyFlow
18{
21
24
27{
29 void Clear();
30
32 [[nodiscard]] size_t GetNumberOfLevels() const;
33
36 size_t numberOfLevels);
37
49 size_t maxNumberOfLevels);
50
53
56
59};
60
63{
64 public:
67
69 static void Correct(const FDMVector2& coarser, FDMVector2* finer);
70
72 template <typename T>
74 size_t numberOfLevels,
75 std::vector<Array2<T>>* levels);
76
88 template <typename T>
90 size_t maxNumberOfLevels,
91 std::vector<Array2<T>>* levels);
92};
93} // namespace CubbyFlow
94
96
97#endif
Multigrid utilities for 2-D FDM system.
Definition FDMMGLinearSystem2.hpp:63
static void ResizeArrayWithCoarsest(const Vector2UZ &coarsestResolution, size_t numberOfLevels, std::vector< Array2< T > > *levels)
Resizes the array with the coarsest resolution and number of levels.
Definition FDMMGLinearSystem2-Impl.hpp:17
static void Correct(const FDMVector2 &coarser, FDMVector2 *finer)
Corrects given coarser grid to the finer grid.
static void Restrict(const FDMVector2 &finer, FDMVector2 *coarser)
Restricts given finer grid to the coarser grid.
static void ResizeArrayWithFinest(const Vector2UZ &finestResolution, size_t maxNumberOfLevels, std::vector< Array2< T > > *levels)
Resizes the array with the finest resolution and max number of levels.
Definition FDMMGLinearSystem2-Impl.hpp:38
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
Multigrid-syle 2-D linear system.
Definition FDMMGLinearSystem2.hpp:27
FDMMGVector2 x
The solution vector.
Definition FDMMGLinearSystem2.hpp:55
void Clear()
Clears the linear system.
FDMMGVector2 b
The RHS vector.
Definition FDMMGLinearSystem2.hpp:58
FDMMGMatrix2 A
The system matrix.
Definition FDMMGLinearSystem2.hpp:52
size_t GetNumberOfLevels() const
Returns the number of multigrid levels.
void ResizeWithFinest(const Vector2UZ &finestResolution, size_t maxNumberOfLevels)
Resizes the system with the finest resolution and max number of levels.
void ResizeWithCoarsest(const Vector2UZ &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.