1# ifndef _RHEOLEF_UZAWA_H
2# define _RHEOLEF_UZAWA_H
23#include "rheolef/solver_option.h"
84template<
class Matrix,
class Vector,
class Preconditioner,
class Real2>
89 typedef typename Vector::float_type Real;
90 std::string label = (sopt.label !=
"" ? sopt.label :
"uzawa");
92 Real norm2_b =
dot(Mb,
b);
93 Real norm2_r = norm2_b;
94 if (sopt.absolute_stopping || norm2_b == Real(0)) norm2_b = 1;
95 if (sopt.p_err) (*sopt.p_err) <<
"[" << label <<
"] #iteration residue" << std::endl;
96 for (sopt.n_iter = 0; sopt.n_iter <= sopt.max_iter; sopt.n_iter++) {
100 sopt.residue = sqrt(norm2_r/norm2_b);
101 if (sopt.p_err) (*sopt.p_err) <<
"[" << label <<
"] " << sopt.n_iter <<
" " << sopt.residue << std::endl;
102 if (sopt.residue <= sopt.tol)
return 0;
see the solver_option page for the full documentation
This file is part of Rheolef.
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
int uzawa(const Matrix &A, Vector &x, const Vector &Mb, const Preconditioner &M, const Real2 &rho, const solver_option &sopt=solver_option())
DATA::size_type size_type