3 #ifndef DUNE_PRECONDITIONERS_HH
4 #define DUNE_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)
100 inverse_operator_.apply(v, copy, res);
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:495
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:579
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:612
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:581
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:460
SeqSOR(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:239
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:162
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:132
SeqILUn(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:596
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:624
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:409
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:448
void bilu_backsolve(const M &A, X &v, const Y &d)
LU backsolve with stored inverse.
Definition: ilu.hh:96
The category the preconditioner is part of.
Definition: preconditioners.hh:229
void bilu0_decomposition(M &A)
compute ILU decomposition of A. A is overwritten by its decomposition
Definition: ilu.hh:35
compile-time parameter for block recursion depth
Definition: gsetc.hh:40
Abstract base class for all solvers.
Definition: solver.hh:79
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:523
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:407
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:663
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:405
Some handy generic functions for ISTL matrices.
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:130
SeqSSOR(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:151
Sequential Gauss Seidel preconditioner.
Definition: preconditioners.hh:318
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:686
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:577
Dune::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:491
The category the preconditioner is part of.
Definition: preconditioners.hh:82
Sequential SSOR preconditioner.
Definition: preconditioners.hh:127
void dbjac(const M &A, X &x, const Y &b, const K &w)
Jacobi step.
Definition: gsetc.hh:636
Richardson preconditioner.
Definition: preconditioners.hh:656
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:187
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:321
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:661
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
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:659
M matrix_type
The matrix type the preconditioner is for.
Definition: preconditioners.hh:218
Matrix & A
Definition: matrixmatrix.hh:216
Define general, extensible interface for inverse operators.
Category for sequential solvers.
Definition: solvercategory.hh:22
O InverseOperator
Definition: preconditioners.hh:77
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:708
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:364
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:493
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:353
Statistics about the application of an inverse operator.
Definition: solver.hh:31
MM_TYPE type
Definition: matrixmarket.hh:267
void apply(X &v, const Y &d)
Apply the preconditioner in a special direction.
Definition: preconditioners.hh:275
virtual void apply(X &v, const Y &d)
Apply the precondioner.
Definition: preconditioners.hh:697
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:224
O::range_type range_type
The range type of the preconditioner.
Definition: preconditioners.hh:74
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:33
void post(domain_type &)
Clean up.
Definition: preconditioners.hh:103
SeqGS(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:342
O::domain_type domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:72
Richardson(field_type w=1.0)
Constructor.
Definition: preconditioners.hh:676
Sequential ILU(n) preconditioner.
Definition: preconditioners.hh:572
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:437
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:327
virtual void apply(X &v, const Y &d)
Apply the preconditoner.
Definition: preconditioners.hh:534
range_type::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:76
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:497
Sequential SOR preconditioner.
Definition: preconditioners.hh:215
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:136
virtual void apply(X &v, const Y &d)
Apply the precondioner.
Definition: preconditioners.hh:620
SeqJac(const M &A, int n, field_type w)
Constructor.
Definition: preconditioners.hh:426
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:220
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:325
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 pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:609
InverseOperator2Preconditioner(InverseOperator &inverse_operator)
Construct the preconditioner from the solver.
Definition: preconditioners.hh:89
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:376
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:134
static void check(const Matrix &mat)
Check whether the a matrix has diagonal values on blocklevel recursion levels.
Definition: matrixutils.hh:88
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: preconditioners.hh:250
Y range_type
The range type of the preconditioner.
Definition: preconditioners.hh:222
The category the preconditioner is part of.
Definition: preconditioners.hh:141
The sequential jacobian preconditioner.
Definition: preconditioners.hh:402
void bilu_decomposition(const M &A, int n, M &ILU)
Definition: ilu.hh:156
Sequential ILU0 preconditioner.
Definition: preconditioners.hh:488
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:174
X domain_type
The domain type of the preconditioner.
Definition: preconditioners.hh:323
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: preconditioners.hh:261
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioners.hh:411
void pre(domain_type &, range_type &)
Prepare the preconditioner.
Definition: preconditioners.hh:93
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Turns an InverseOperator into a Preconditioner.
Definition: preconditioners.hh:67
void dbgs(const M &A, X &x, const Y &b, const K &w)
GS step.
Definition: gsetc.hh:600
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:631
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:292
virtual void post(X &x)
Clean up.
Definition: preconditioners.hh:545