Loading...
Searching...
No Matches
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
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 FDMVector3& coarser, FDMVector3* finer);
70
72 template <typename T>
74 size_t numberOfLevels,
75 std::vector<Array3<T>>* levels);
76
88 template <typename T>
90 size_t maxNumberOfLevels,
91 std::vector<Array3<T>>* levels);
92};
93} // namespace CubbyFlow
94
96
97#endif
Multigrid utilities for 2-D FDM system.
Definition FDMMGLinearSystem3.hpp:63
static void Correct(const FDMVector3 &coarser, FDMVector3 *finer)
Corrects given coarser grid to the finer grid.
static void Restrict(const FDMVector3 &finer, FDMVector3 *coarser)
Restricts given finer grid to the coarser grid.
static void ResizeArrayWithCoarsest(const Vector3UZ &coarsestResolution, size_t numberOfLevels, std::vector< Array3< T > > *levels)
Resizes the array with the coarsest resolution and number of levels.
Definition FDMMGLinearSystem3-Impl.hpp:17
static void ResizeArrayWithFinest(const Vector3UZ &finestResolution, size_t maxNumberOfLevels, std::vector< Array3< T > > *levels)
Resizes the array with the finest resolution and max number of levels.
Definition FDMMGLinearSystem3-Impl.hpp:39
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
Multigrid-syle 3-D linear system.
Definition FDMMGLinearSystem3.hpp:27
FDMMGMatrix3 A
The system matrix.
Definition FDMMGLinearSystem3.hpp:52
FDMMGVector3 b
The RHS vector.
Definition FDMMGLinearSystem3.hpp:58
void ResizeWithCoarsest(const Vector3UZ &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.
FDMMGVector3 x
The solution vector.
Definition FDMMGLinearSystem3.hpp:55
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.
size_t GetNumberOfLevels() const
Returns the number of multigrid levels.