3 #ifndef DUNE_ISTL_PRECONDITIONERS_HH
4 #define DUNE_ISTL_PRECONDITIONERS_HH
12 #include <dune/common/unused.hh>
66 template<
class O,
int c>
68 public Preconditioner<typename O::domain_type, typename O::range_type>
90 : inverse_operator_(inverse_operator)
93 void pre(domain_type&,range_type&)
96 void apply(domain_type& v,
const range_type& d)
100 inverse_operator_.apply(v, copy, res);
107 InverseOperator& inverse_operator_;
126 template<
class M,
class X,
class Y,
int l=1>
152 : _A_(A), _n(n), _w(w)
162 virtual void pre (X& x, Y& b)
164 DUNE_UNUSED_PARAMETER(x);
165 DUNE_UNUSED_PARAMETER(b);
174 virtual void apply (X& v,
const Y& d)
176 for (
int i=0; i<_n; i++) {
189 DUNE_UNUSED_PARAMETER(x);
214 template<
class M,
class X,
class Y,
int l=1>
240 : _A_(A), _n(n), _w(w)
250 virtual void pre (X& x, Y& b)
252 DUNE_UNUSED_PARAMETER(x);
253 DUNE_UNUSED_PARAMETER(b);
261 virtual void apply (X& v,
const Y& d)
263 this->
template apply<true>(v,d);
274 template<
bool forward>
278 for (
int i=0; i<_n; i++) {
282 for (
int i=0; i<_n; i++) {
294 DUNE_UNUSED_PARAMETER(x);
317 template<
class M,
class X,
class Y,
int l=1>
343 : _A_(A), _n(n), _w(w)
353 virtual void pre (X& x, Y& b)
355 DUNE_UNUSED_PARAMETER(x);
356 DUNE_UNUSED_PARAMETER(b);
364 virtual void apply (X& v,
const Y& d)
366 for (
int i=0; i<_n; i++) {
378 DUNE_UNUSED_PARAMETER(x);
401 template<
class M,
class X,
class Y,
int l=1>
427 : _A_(A), _n(n), _w(w)
437 virtual void pre (X& x, Y& b)
439 DUNE_UNUSED_PARAMETER(x);
440 DUNE_UNUSED_PARAMETER(b);
448 virtual void apply (X& v,
const Y& d)
450 for (
int i=0; i<_n; i++) {
462 DUNE_UNUSED_PARAMETER(x);
487 template<
class M,
class X,
class Y,
int l=1>
523 virtual void pre (X& x, Y& b)
525 DUNE_UNUSED_PARAMETER(x);
526 DUNE_UNUSED_PARAMETER(b);
534 virtual void apply (X& v,
const Y& d)
547 DUNE_UNUSED_PARAMETER(x);
571 template<
class M,
class X,
class Y,
int l=1>
597 : ILU(A.N(),A.M(),M::row_wise)
609 virtual void pre (X& x, Y& b)
611 DUNE_UNUSED_PARAMETER(x);
612 DUNE_UNUSED_PARAMETER(b);
620 virtual void apply (X& v,
const Y& d)
633 DUNE_UNUSED_PARAMETER(x);
655 template<
class X,
class Y>
686 virtual void pre (X& x, Y& b)
688 DUNE_UNUSED_PARAMETER(x);
689 DUNE_UNUSED_PARAMETER(b);
697 virtual void apply (X& v,
const Y& d)
710 DUNE_UNUSED_PARAMETER(x);
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:325
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:495
O::domain_type domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:72
The category the preconditioner is part of.
Definition: preconditioners.hh:82
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:220
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:612
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:493
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:577
The category the preconditioner is part of.
Definition: preconditioners.hh:229
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:364
O::range_type range_type
The range type of the preconditioner.
Definition: preconditioners.hh:74
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:708
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:659
compile-time parameter for block recursion depth
Definition: gsetc.hh:40
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:624
Sequential ILU0 preconditioner.
Definition: preconditioners.hh:488
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:409
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:437
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:545
void bilu0_decomposition(M &A)
compute ILU decomposition of A. A is overwritten by its decomposition
Definition: ilu.hh:35
Turns an InverseOperator into a Preconditioner.
Definition: preconditioners.hh:67
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:134
SeqJac(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:426
SeqGS(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:342
SeqILUn(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:596
void pre(domain_type &, range_type &)
Prepare the preconditioner.
Definition: preconditioners.hh:93
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:581
Dune::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:491
InverseOperator2Preconditioner(InverseOperator &inverse_operator)
Construct the preconditioner from the solver.
Definition: preconditioners.hh:89
void apply(X &v, const Y &d)
Apply the preconditioner in a special direction.
Definition: preconditioners.hh:275
Matrix & A
Definition: matrixmatrix.hh:216
Richardson(field_type w=1.0)
Constructor.
Definition: preconditioners.hh:676
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:187
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:132
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:323
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:250
Define general, extensible interface for inverse operators.
void apply(domain_type &v, const range_type &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: preconditioners.hh:96
Dune::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:575
SeqILU0(const M &A, field_type w)
Constructor.
Definition: preconditioners.hh:511
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:460
Sequential Gauss Seidel preconditioner.
Definition: preconditioners.hh:318
The category the preconditioner is part of.
Definition: preconditioners.hh:141
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:411
Category for sequential solvers.
Definition: solvercategory.hh:21
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:218
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:497
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:130
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:327
SeqSSOR(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:151
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:292
virtual void apply(X &v, const Y &d)
Apply the precondioner.
Definition: preconditioners.hh:697
Sequential SSOR preconditioner.
Definition: preconditioners.hh:127
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:661
void dbjac(const M &A, X &x, const Y &b, const K &w)
Jacobi step.
Definition: gsetc.hh:636
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:631
void post(domain_type &)
Clean up.
Definition: preconditioners.hh:103
SeqSOR(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:239
range_type::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:76
The sequential jacobian preconditioner.
Definition: preconditioners.hh:402
Richardson preconditioner.
Definition: preconditioners.hh:656
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:686
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:448
O InverseOperator
Definition: preconditioners.hh:77
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:136
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:407
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:405
virtual void apply(X &v, const Y &d)
Apply the precondioner.
Definition: preconditioners.hh:620
Some handy generic functions for ISTL matrices.
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:224
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:321
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:609
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:523
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:353
Sequential ILU(n) preconditioner.
Definition: preconditioners.hh:572
void bilu_backsolve(const M &A, X &v, const Y &d)
LU backsolve with stored inverse.
Definition: ilu.hh:96
Sequential SOR preconditioner.
Definition: preconditioners.hh:215
static void check(const Matrix &mat)
Check whether the a matrix has diagonal values on blocklevel recursion levels.
Definition: matrixutils.hh:88
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:663
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:162
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:261
Definition: basearray.hh:19
Statistics about the application of an inverse operator.
Definition: solver.hh:31
void bilu_decomposition(const M &A, int n, M &ILU)
Definition: ilu.hh:156
virtual void apply(X &v, const Y &d)
Apply the preconditoner.
Definition: preconditioners.hh:534
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:174
void dbgs(const M &A, X &x, const Y &b, const K &w)
GS step.
Definition: gsetc.hh:600
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:222
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:579
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:376