3 #ifndef DUNE_ISTL_SCHWARZ_HH
4 #define DUNE_ISTL_SCHWARZ_HH
13 #include <dune/common/timer.hh>
74 template<
class M,
class X,
class Y,
class C>
75 class OverlappingSchwarzOperator :
public AssembledLinearOperator<M,X,Y>
114 : _A_(A), communication(com)
118 virtual void apply (
const X& x, Y& y)
const
122 communication.project(y);
130 communication.project(y);
162 template<
class X,
class C>
197 communication.dot(x,y,result);
204 virtual double norm (
const X& x)
206 return communication.norm(x);
213 template<
class X,
class C>
238 template<
class M,
class X,
class Y,
class C>
281 : _A_(A), _n(n), _w(w), communication(c)
289 virtual void pre (X& x, Y& b)
291 communication.copyOwnerToAll(x,x);
299 virtual void apply (X& v,
const Y& d)
301 for (
int i=0; i<_n; i++) {
305 communication.copyOwnerToAll(v,v);
328 template<
class T>
class ConstructionTraits;
354 template<
class X,
class Y,
class C,
class T=Preconditioner<X,Y> >
390 : preconditioner(p), communication(c)
398 virtual void pre (X& x, Y& b)
400 communication.copyOwnerToAll(x,x);
401 preconditioner.pre(x,b);
409 virtual void apply (X& v,
const Y& d)
411 preconditioner.apply(v,d);
412 communication.copyOwnerToAll(v,v);
415 template<
bool forward>
418 preconditioner.template apply<forward>(v,d);
419 communication.copyOwnerToAll(v,v);
429 preconditioner.post(x);
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: schwarz.hh:416
X::field_type field_type
Definition: scalarproducts.hh:48
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:427
Classes providing communication interfaces for overlapping Schwarz methods.
Define general, extensible interface for operators. The available implementation wraps a matrix...
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:612
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:261
A parallel SSOR preconditioner.
Definition: schwarz.hh:252
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:313
C communication_type
The type of the communication object.
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:204
C communication_type
The type of the communication object to use.
Definition: schwarz.hh:219
The category the precondtioner is part of.
Definition: schwarz.hh:379
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:624
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:26
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:33
Definition: schwarz.hh:180
Matrix & A
Definition: matrixmatrix.hh:216
virtual void apply(X &v, const Y &d)
Apply the precondtioner.
Definition: schwarz.hh:299
Choose the approriate scalar product for a solver category.
Definition: scalarproducts.hh:76
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:367
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:257
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:289
BlockPreconditioner(T &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:389
OverlappingSchwarzScalarProduct< X, C > ScalarProduct
The type of the scalar product for the overlapping case.
Definition: schwarz.hh:217
X domain_type
The type of the vector to compute the scalar product on.
Definition: schwarz.hh:170
virtual void apply(const X &x, Y &y) const
apply operator to x:
Definition: schwarz.hh:118
OverlappingSchwarzScalarProduct(const communication_type &com)
Constructor needs to know the grid.
Definition: schwarz.hh:186
Traits class for generically constructing non default constructable types.
Definition: novlpschwarz.hh:326
C communication_type
The type of the communication object.
Definition: schwarz.hh:263
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:194
The solver category.
Definition: schwarz.hh:103
M matrix_type
The type of the matrix we operate on.
Definition: schwarz.hh:82
M matrix_type
The matrix type the preconditioner is for.
Definition: schwarz.hh:255
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:362
Block parallel preconditioner.
Definition: schwarz.hh:355
Scalar product for overlapping schwarz methods.
Definition: schwarz.hh:163
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition: schwarz.hh:280
Y range_type
The type of the range.
Definition: schwarz.hh:92
The category the precondtioner is part of.
Definition: schwarz.hh:268
Define general preconditioner interface.
Base class for scalar product and norm computation.
Definition: scalarproducts.hh:44
The solver category.
Definition: scalarproducts.hh:83
Implementation of the BCRSMatrix class.
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Implementations of the inverse operator interface.
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:259
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..
Definition: schwarz.hh:374
X::field_type field_type
The field type of the range.
Definition: schwarz.hh:94
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:369
Some generic functions for pretty printing vectors and matrices.
OverlappingSchwarzOperator(const matrix_type &A, const communication_type &com)
constructor: just store a reference to a matrix.
Definition: schwarz.hh:113
C communication_type
The type of the communication object.
Definition: schwarz.hh:99
static ScalarProduct * construct(const communication_type &comm)
Definition: schwarz.hh:226
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const
apply operator to x, scale and add:
Definition: schwarz.hh:127
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:398
Category for ovelapping solvers.
Definition: solvercategory.hh:25
virtual const matrix_type & getmat() const
get the sequential assembled linear operator.
Definition: schwarz.hh:135
Define base class for scalar product and norm.
X domain_type
The type of the domain.
Definition: schwarz.hh:87
X::field_type field_type
The field type used by the vector type domain_type.
Definition: schwarz.hh:172
X::field_type field_type
The field type of the operator.
Definition: operators.hh:69
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: schwarz.hh:409
Categories for the solvers.
Definition: solvercategory.hh:17