jacobi.template
Functions
jacsolve.cpp File Reference
#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...
 

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,
vector< double > const &  f,
vector< double > &  u 
)

Definition at line 15 of file jacsolve.cpp.