Go to the documentation of this file.
7 #ifndef INCLUDE_JET_MG_H_
8 #define INCLUDE_JET_MG_H_
18 template <
typename BlasType>
20 std::vector<typename BlasType::MatrixType>
levels;
21 const typename BlasType::MatrixType&
operator[](
size_t i)
const;
23 const typename BlasType::MatrixType&
finest()
const;
24 typename BlasType::MatrixType&
finest();
28 template <
typename BlasType>
30 std::vector<typename BlasType::VectorType>
levels;
31 const typename BlasType::VectorType&
operator[](
size_t i)
const;
33 const typename BlasType::VectorType&
finest()
const;
34 typename BlasType::VectorType&
finest();
38 template <
typename BlasType>
40 const typename BlasType::MatrixType& A,
41 const typename BlasType::VectorType& b,
unsigned int numberOfIterations,
42 double maxTolerance,
typename BlasType::VectorType* x,
43 typename BlasType::VectorType* buffer)>;
46 template <
typename BlasType>
48 std::function<void(
const typename BlasType::VectorType& finer,
49 typename BlasType::VectorType* coarser)>;
52 template <
typename BlasType>
54 std::function<void(
const typename BlasType::VectorType& coarser,
55 typename BlasType::VectorType* finer)>;
58 template <
typename BlasType>
100 template <
typename BlasType>
106 #include "detail/mg-inl.h"
108 #endif // INCLUDE_JET_MG_H_
MgRelaxFunc< BlasType > relaxFunc
Relaxation function such as Jacobi or Gauss-Seidel.
Definition: mg.h:76
Multigrid result type.
Definition: mg.h:89
const BlasType::MatrixType & finest() const
double maxTolerance
Max error tolerance.
Definition: mg.h:85
std::function< void(const typename BlasType::MatrixType &A, const typename BlasType::VectorType &b, unsigned int numberOfIterations, double maxTolerance, typename BlasType::VectorType *x, typename BlasType::VectorType *buffer)> MgRelaxFunc
Multigrid relax function type.
Definition: mg.h:43
double lastResidualNorm
Lastly measured norm of residual.
Definition: mg.h:91
std::vector< typename BlasType::MatrixType > levels
Definition: mg.h:20
const BlasType::MatrixType & operator[](size_t i) const
MgCorrectFunc< BlasType > correctFunc
Correction function that maps coarser to finer grid.
Definition: mg.h:82
MgResult mgVCycle(const MgMatrix< BlasType > &A, MgParameters< BlasType > params, MgVector< BlasType > *x, MgVector< BlasType > *b, MgVector< BlasType > *buffer)
Performs Multigrid with V-cycle.
BlasType::MatrixType & finest()
BlasType::VectorType & operator[](size_t i)
Definition: advection_solver2.h:18
BlasType::VectorType & finest()
unsigned int numberOfFinalIter
Number of iteration at final step.
Definition: mg.h:73
size_t maxNumberOfLevels
Max number of multigrid levels.
Definition: mg.h:61
unsigned int numberOfRestrictionIter
Number of iteration at restriction step.
Definition: mg.h:64
unsigned int numberOfCoarsestIter
Number of iteration at coarsest step.
Definition: mg.h:70
Multigrid matrix wrapper.
Definition: mg.h:19
MgRestrictFunc< BlasType > restrictFunc
Restrict function that maps finer to coarser grid.
Definition: mg.h:79
BlasType::MatrixType & operator[](size_t i)
std::vector< typename BlasType::VectorType > levels
Definition: mg.h:30
Multigrid input parameter set.
Definition: mg.h:59
Multigrid vector wrapper.
Definition: mg.h:29
unsigned int numberOfCorrectionIter
Number of iteration at correction step.
Definition: mg.h:67
std::function< void(const typename BlasType::VectorType &finer, typename BlasType::VectorType *coarser)> MgRestrictFunc
Multigrid restriction function type.
Definition: mg.h:49
const BlasType::VectorType & operator[](size_t i) const
const BlasType::VectorType & finest() const
std::function< void(const typename BlasType::VectorType &coarser, typename BlasType::VectorType *finer)> MgCorrectFunc
Multigrid correction function type.
Definition: mg.h:55