FDMMGLinearSystem3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: FDMMGLinearSystem3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Multigrid-syle 3-D linear system.
6 > Created Time: 2017/11/03
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_FDM_MG_LINEAR_SYSTEM3_H
10 #define CUBBYFLOW_FDM_MG_LINEAR_SYSTEM3_H
11 
13 #include <Core/Utils/MG.h>
14 
15 namespace CubbyFlow
16 {
19 
22 
25  {
28 
31 
34 
36  void Clear();
37 
39  size_t GetNumberOfLevels() const;
40 
42  void ResizeWithCoarsest(const Size3& coarsestResolution, size_t numberOfLevels);
43 
53  void ResizeWithFinest(const Size3& finestResolution, size_t maxNumberOfLevels);
54  };
55 
58  {
59  public:
61  static void Restrict(const FDMVector3& finer, FDMVector3* coarser);
62 
64  static void Correct(const FDMVector3& coarser, FDMVector3* finer);
65 
67  template <typename T>
68  static void ResizeArrayWithCoarsest(const Size3& coarsestResolution,
69  size_t numberOfLevels, std::vector<Array3<T>>* levels);
70 
80  template <typename T>
81  static void ResizeArrayWithFinest(const Size3& finestResolution,
82  size_t maxNumberOfLevels, std::vector<Array3<T>>* levels);
83  };
84 }
85 
87 
88 #endif
FDMMGMatrix3 A
The system matrix.
Definition: FDMMGLinearSystem3.h:27
size_t GetNumberOfLevels() const
Returns the number of multigrid levels.
static void ResizeArrayWithCoarsest(const Size3 &coarsestResolution, size_t numberOfLevels, std::vector< Array3< T >> *levels)
Resizes the array with the coarsest resolution and number of levels.
Definition: FDMMGLinearSystem3-Impl.h:15
void ResizeWithFinest(const Size3 &finestResolution, size_t maxNumberOfLevels)
Resizes the system with the finest resolution and max number of levels.
3-D point class.
Definition: Point3.h:26
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.
Definition: pybind11Utils.h:24
FDMMGVector3 b
The RHS vector.
Definition: FDMMGLinearSystem3.h:33
void ResizeWithCoarsest(const Size3 &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.
static void ResizeArrayWithFinest(const Size3 &finestResolution, size_t maxNumberOfLevels, std::vector< Array3< T >> *levels)
Resizes the array with the finest resolution and max number of levels.
Definition: FDMMGLinearSystem3-Impl.h:35
3-D array class.
Definition: Array3.h:45
void Clear()
Clears the linear system.
Multigrid-syle 3-D linear system.
Definition: FDMMGLinearSystem3.h:24
FDMMGVector3 x
The solution vector.
Definition: FDMMGLinearSystem3.h:30
Multigrid utilities for 2-D FDM system.
Definition: FDMMGLinearSystem3.h:57