jacobi.template
Classes | Functions
jacsolve.h File Reference
#include "geom.h"
#include "getmatrix.h"
#include <vector>

Go to the source code of this file.

Classes

class  Multigrid
 The Multigrid hierarchy including meshes, vectors and matrices, prolongations is stored. More...
 

Functions

void JacobiSolve (CRS_Matrix const &SK, std::vector< double > const &f, std::vector< double > &u)
 
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)
 
void DiagPrecond (Matrix const &SK, std::vector< double > const &r, std::vector< double > &w, double const omega=1.0)
 Simple diagonale preconditioning. More...
 

Function Documentation

◆ DiagPrecond()

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 \)

Parameters
[in]SKmatrix
[in]rdistributed local vector storing the residuum
[out]waccumulated local vector storing the correction.
[in]omegarelaxation parameter.

Definition at line 89 of file jacsolve.cpp.

◆ JacobiSmoother()

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) \)

Parameters
[in]SKCSR matrix
[in]fdistributed local vector storing the right hand side
[out]uaccumulated local vector storing the solution.
[in,out]rauxiliary local vector.
[in]nsmoothnumber of smoothing steps.
[in]omegarelaxation parameter.
[in]zeroinitial solution u is assumed to be zero.

Definition at line 65 of file jacsolve.cpp.

◆ JacobiSolve()

void JacobiSolve ( CRS_Matrix const &  SK,
std::vector< double > const &  f,
std::vector< double > &  u 
)

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.

Parameters
[in]SKCSR matrix
[in]fdistributed local vector storing the right hand side
[out]uaccumulated local vector storing the solution.