Jet  v1.3.3
fdm_mg_linear_system2.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_FDM_MG_LINEAR_SYSTEM2_H_
8 #define INCLUDE_JET_FDM_MG_LINEAR_SYSTEM2_H_
9 
11 #include <jet/fdm_linear_system2.h>
12 #include <jet/mg.h>
13 
14 namespace jet {
15 
18 
21 
26 
29 
32 
34  void clear();
35 
37  size_t numberOfLevels() const;
38 
40  void resizeWithCoarsest(const Size2 &coarsestResolution,
41  size_t numberOfLevels);
42 
53  void resizeWithFinest(const Size2 &finestResolution,
54  size_t maxNumberOfLevels);
55 };
56 
58 class FdmMgUtils2 {
59  public:
61  static void restrict(const FdmVector2 &finer, FdmVector2 *coarser);
62 
64  static void correct(const FdmVector2 &coarser, FdmVector2 *finer);
65 
67  template <typename T>
68  static void resizeArrayWithCoarsest(const Size2 &coarsestResolution,
69  size_t numberOfLevels,
70  std::vector<Array2<T>> *levels);
71 
82  template <typename T>
83  static void resizeArrayWithFinest(const Size2 &finestResolution,
84  size_t maxNumberOfLevels,
85  std::vector<Array2<T>> *levels);
86 };
87 
88 } // namespace jet
89 
90 #include "detail/fdm_mg_linear_system2-inl.h"
91 
92 #endif // INCLUDE_JET_FDM_MG_LINEAR_SYSTEM2_H_
jet::FdmMgLinearSystem2
Multigrid-syle 2-D linear system.
Definition: fdm_mg_linear_system2.h:23
jet::FdmMgLinearSystem2::resizeWithCoarsest
void resizeWithCoarsest(const Size2 &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.
jet::FdmMgUtils2::restrict
static void restrict(const FdmVector2 &finer, FdmVector2 *coarser)
Restricts given finer grid to the coarser grid.
jet::FdmMgLinearSystem2::resizeWithFinest
void resizeWithFinest(const Size2 &finestResolution, size_t maxNumberOfLevels)
Resizes the system with the finest resolution and max number of levels.
jet::FdmMgLinearSystem2::numberOfLevels
size_t numberOfLevels() const
Returns the number of multigrid levels.
jet::FdmMgUtils2::correct
static void correct(const FdmVector2 &coarser, FdmVector2 *finer)
Corrects given coarser grid to the finer grid.
mg.h
jet::Array< T, 2 >
2-D array class.
Definition: array2.h:42
jet
Definition: advection_solver2.h:18
jet::FdmMgMatrix2
MgMatrix< FdmBlas2 > FdmMgMatrix2
Multigrid-style 2-D FDM matrix.
Definition: fdm_mg_linear_system2.h:17
jet::FdmMgUtils2::resizeArrayWithCoarsest
static void resizeArrayWithCoarsest(const Size2 &coarsestResolution, size_t numberOfLevels, std::vector< Array2< T >> *levels)
Resizes the array with the coarsest resolution and number of levels.
jet::FdmMgLinearSystem2::A
FdmMgMatrix2 A
The system matrix.
Definition: fdm_mg_linear_system2.h:25
jet::FdmMgUtils2
Multigrid utilities for 2-D FDM system.
Definition: fdm_mg_linear_system2.h:58
jet::MgMatrix< FdmBlas2 >
face_centered_grid2.h
jet::Size2
2-D size class.
Definition: size2.h:19
jet::FdmMgLinearSystem2::b
FdmMgVector2 b
The RHS vector.
Definition: fdm_mg_linear_system2.h:31
jet::MgVector< FdmBlas2 >
fdm_linear_system2.h
jet::FdmMgUtils2::resizeArrayWithFinest
static void resizeArrayWithFinest(const Size2 &finestResolution, size_t maxNumberOfLevels, std::vector< Array2< T >> *levels)
Resizes the array with the finest resolution and max number of levels.
jet::FdmMgLinearSystem2::clear
void clear()
Clears the linear system.
jet::FdmMgVector2
MgVector< FdmBlas2 > FdmMgVector2
Multigrid-style 2-D FDM vector.
Definition: fdm_mg_linear_system2.h:20
jet::FdmMgLinearSystem2::x
FdmMgVector2 x
The solution vector.
Definition: fdm_mg_linear_system2.h:28