jacobi.template
|
#include "vdop.h"
#include "geom.h"
#include "getmatrix.h"
#include "jacsolve.h"
#include "userset.h"
#include <cassert>
#include <cmath>
#include <iostream>
#include <vector>
Go to the source code of this file.
Functions | |
void | JacobiSolve (CRS_Matrix const &SK, vector< double > const &f, vector< double > &u) |
void | JacobiSmoother (Matrix const &SK, std::vector< double > const &f, std::vector< double > &u, std::vector< double > &r, int nsmooth, double const omega, bool zero) |
void | DiagPrecond (Matrix const &SK, std::vector< double > const &r, std::vector< double > &w, double const omega) |
Simple diagonale preconditioning. More... | |
void DiagPrecond | ( | Matrix const & | SK, |
std::vector< double > const & | r, | ||
std::vector< double > & | w, | ||
double const | omega = 1.0 |
||
) |
Simple diagonale preconditioning.
The residuum r
scaled by the inverse diagonal of matrĂx SK
results in the correction w
.
\( w := \omega D^{-1}*r \)
[in] | SK | matrix |
[in] | r | distributed local vector storing the residuum |
[out] | w | accumulated local vector storing the correction. |
[in] | omega | relaxation parameter. |
Definition at line 89 of file jacsolve.cpp.
void JacobiSmoother | ( | Matrix const & | SK, |
std::vector< double > const & | f, | ||
std::vector< double > & | u, | ||
std::vector< double > & | r, | ||
int | nsmooth = 1 , |
||
double const | omega = 1.0 , |
||
bool | zero = false |
||
) |
Solves linear system of equations K u
= f
via the Jacobi iteration. We use a distributed symmetric CSR matrix SK
and initial guess of the solution is set to 0.
In each smoothing step: \( \widehat{u} := u + \omega D^{-1}\left({f-K*u}\right) \)
[in] | SK | CSR matrix |
[in] | f | distributed local vector storing the right hand side |
[out] | u | accumulated local vector storing the solution. |
[in,out] | r | auxiliary local vector. |
[in] | nsmooth | number of smoothing steps. |
[in] | omega | relaxation parameter. |
[in] | zero | initial solution u is assumed to be zero. |
Definition at line 65 of file jacsolve.cpp.
void JacobiSolve | ( | CRS_Matrix const & | SK, |
vector< double > const & | f, | ||
vector< double > & | u | ||
) |
Definition at line 15 of file jacsolve.cpp.