Jet  v1.3.3
fdm_mg_linear_system3.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_SYSTEM3_H_
8 #define INCLUDE_JET_FDM_MG_LINEAR_SYSTEM3_H_
9 
11 #include <jet/fdm_linear_system3.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 Size3 &coarsestResolution,
41  size_t numberOfLevels);
42 
53  void resizeWithFinest(const Size3 &finestResolution,
54  size_t maxNumberOfLevels);
55 };
56 
58 class FdmMgUtils3 {
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,
70  std::vector<Array3<T>> *levels);
71 
82  template <typename T>
83  static void resizeArrayWithFinest(const Size3 &finestResolution,
84  size_t maxNumberOfLevels,
85  std::vector<Array3<T>> *levels);
86 };
87 
88 } // namespace jet
89 
90 #include "detail/fdm_mg_linear_system3-inl.h"
91 
92 #endif // INCLUDE_JET_FDM_MG_LINEAR_SYSTEM3_H_
jet::FdmMgLinearSystem3
Multigrid-syle 3-D linear system.
Definition: fdm_mg_linear_system3.h:23
jet::FdmMgVector3
MgVector< FdmBlas3 > FdmMgVector3
Multigrid-style 3-D FDM vector.
Definition: fdm_mg_linear_system3.h:20
jet::FdmMgLinearSystem3::resizeWithFinest
void resizeWithFinest(const Size3 &finestResolution, size_t maxNumberOfLevels)
Resizes the system with the finest resolution and max number of levels.
mg.h
jet
Definition: advection_solver2.h:18
jet::FdmMgUtils3::restrict
static void restrict(const FdmVector3 &finer, FdmVector3 *coarser)
Restricts given finer grid to the coarser grid.
jet::FdmMgLinearSystem3::x
FdmMgVector3 x
The solution vector.
Definition: fdm_mg_linear_system3.h:28
jet::FdmMgLinearSystem3::clear
void clear()
Clears the linear system.
jet::FdmMgUtils3::resizeArrayWithCoarsest
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.
jet::FdmMgUtils3::correct
static void correct(const FdmVector3 &coarser, FdmVector3 *finer)
Corrects given coarser grid to the finer grid.
jet::FdmMgMatrix3
MgMatrix< FdmBlas3 > FdmMgMatrix3
Multigrid-style 3-D FDM matrix.
Definition: fdm_mg_linear_system3.h:17
jet::FdmMgUtils3::resizeArrayWithFinest
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.
jet::Size3
3-D size class.
Definition: size3.h:19
jet::MgMatrix< FdmBlas3 >
jet::FdmMgLinearSystem3::resizeWithCoarsest
void resizeWithCoarsest(const Size3 &coarsestResolution, size_t numberOfLevels)
Resizes the system with the coarsest resolution and number of levels.
face_centered_grid3.h
jet::FdmMgLinearSystem3::numberOfLevels
size_t numberOfLevels() const
Returns the number of multigrid levels.
jet::FdmMgLinearSystem3::b
FdmMgVector3 b
The RHS vector.
Definition: fdm_mg_linear_system3.h:31
fdm_linear_system3.h
jet::FdmMgUtils3
Multigrid utilities for 2-D FDM system.
Definition: fdm_mg_linear_system3.h:58
jet::FdmMgLinearSystem3::A
FdmMgMatrix3 A
The system matrix.
Definition: fdm_mg_linear_system3.h:25
jet::MgVector< FdmBlas3 >
jet::Array< T, 3 >
3-D array class.
Definition: array3.h:43