3 #ifndef DUNE_SCHWARZ_HH
4 #define DUNE_SCHWARZ_HH
13 #include <dune/common/timer.hh>
58 template<
class M,
class X,
class Y,
class C>
59 class OverlappingSchwarzOperator :
public AssembledLinearOperator<M,X,Y>
86 : _A_(A), communication(com)
90 virtual void apply (
const X& x, Y& y)
const
94 communication.project(y);
102 communication.project(y);
128 template<
class X,
class C>
157 communication.dot(x,y,result);
164 virtual double norm (
const X& x)
166 return communication.norm(x);
173 template<
class X,
class C>
198 template<
class M,
class X,
class Y,
class C>
229 : _A_(A), _n(n), _w(w), communication(c)
237 virtual void pre (X& x, Y& b)
239 communication.copyOwnerToAll(x,x);
247 virtual void apply (X& v,
const Y& d)
249 for (
int i=0; i<_n; i++) {
253 communication.copyOwnerToAll(v,v);
276 template<
class T>
class ConstructionTraits;
287 template<
class X,
class Y,
class C,
class T=Preconditioner<X,Y> >
314 : preconditioner(p), communication(c)
322 virtual void pre (X& x, Y& b)
324 communication.copyOwnerToAll(x,x);
325 preconditioner.pre(x,b);
333 virtual void apply (X& v,
const Y& d)
335 preconditioner.apply(v,d);
336 communication.copyOwnerToAll(v,v);
339 template<
bool forward>
342 preconditioner.template apply<forward>(v,d);
343 communication.copyOwnerToAll(v,v);
353 preconditioner.post(x);
X::field_type field_type
Definition: scalarproducts.hh:47
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:612
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: schwarz.hh:340
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:351
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition: schwarz.hh:228
virtual void apply(const X &x, Y &y) const
apply operator to x:
Definition: schwarz.hh:90
Category for ovelapping solvers.
Definition: solvercategory.hh:26
Classes providing communication interfaces for overlapping Schwarz methods.
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:624
Base class for scalar product and norm computation.
Definition: scalarproducts.hh:43
The category the precondtioner is part of.
Definition: schwarz.hh:303
This file implements a vector space as a tensor product of a given vector space. The number of compon...
C communication_type
The type of the communication object to use.
Definition: schwarz.hh:179
OverlappingSchwarzScalarProduct(const communication_type &com)
Constructor needs to know the grid.
Definition: schwarz.hh:146
virtual field_type dot(const X &x, const X &y)
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
Definition: schwarz.hh:154
static ScalarProduct * construct(const communication_type &comm)
Definition: schwarz.hh:186
virtual const matrix_type & getmat() const
get matrix via *
Definition: schwarz.hh:107
Y range_type
The type of the range.
Definition: schwarz.hh:67
Categories for the solvers.
Definition: solvercategory.hh:18
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:294
BlockPreconditioner(T &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:313
The solver category.
Definition: schwarz.hh:75
X::field_type field_type
The field type of the range.
Definition: schwarz.hh:69
Definition: schwarz.hh:140
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:261
OverlappingSchwarzScalarProduct< X, C > ScalarProduct
The type of the scalar product for the overlapping case.
Definition: schwarz.hh:177
virtual double norm(const X &x)
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition...
Definition: schwarz.hh:164
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:237
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const
apply operator to x, scale and add:
Definition: schwarz.hh:99
M matrix_type
The type of the matrix we operate on.
Definition: schwarz.hh:63
Traits class for generically constructing non default constructable types.
Definition: novlpschwarz.hh:326
Implementations of the inverse operator interface.
C communication_type
The type of the communication object.
Definition: schwarz.hh:71
X::field_type field_type
The type of the range.
Definition: schwarz.hh:135
X::field_type field_type
The field type of the operator.
Definition: operators.hh:69
Matrix & A
Definition: matrixmatrix.hh:216
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:292
Implementation of the BCRSMatrix class.
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:209
A parallel SSOR preconditioner.
Definition: schwarz.hh:200
Block parallel preconditioner.
Definition: schwarz.hh:288
Define general, extensible interface for operators. The available implementation wraps a matrix...
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:33
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:205
Scalar product for overlapping schwarz methods.
Definition: schwarz.hh:129
OverlappingSchwarzOperator(const matrix_type &A, const communication_type &com)
constructor: just store a reference to a matrix.
Definition: schwarz.hh:85
X domain_type
The type of the domain.
Definition: schwarz.hh:133
C communication_type
The type of the communication object.
Definition: schwarz.hh:211
Choose the approriate scalar product for a solver category.
Definition: scalarproducts.hh:75
virtual void apply(X &v, const Y &d)
Apply the precondtioner.
Definition: schwarz.hh:247
C communication_type
The type of the communication object.
Definition: schwarz.hh:298
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:296
Define base class for scalar product and norm.
Some generic functions for pretty printing vectors and matrices.
The solver category.
Definition: scalarproducts.hh:82
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:207
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:322
The category the precondtioner is part of.
Definition: schwarz.hh:216
X domain_type
The type of the domain.
Definition: schwarz.hh:65
Define general preconditioner interface.
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
M matrix_type
The matrix type the preconditioner is for.
Definition: schwarz.hh:203
C communication_type
The type of the communication object.
Definition: schwarz.hh:137
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: schwarz.hh:333