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>
109 : _A_(stackobject_to_shared_ptr(A)), communication(com)
113 : _A_(A), communication(com)
117 virtual void apply (
const X& x, Y& y)
const
121 communication.project(y);
128 _A_->usmv(alpha,x,y);
129 communication.project(y);
146 const std::shared_ptr<const matrix_type>_A_;
169 template<
class M,
class X,
class Y,
class C>
193 : _A_(A), _n(n), _w(w), communication(c)
201 virtual void pre (X& x, Y& b)
203 communication.copyOwnerToAll(x,x);
211 virtual void apply (X& v,
const Y& d)
213 for (
int i=0; i<_n; i++) {
217 communication.copyOwnerToAll(v,v);
246 template<
class T>
class ConstructionTraits;
272 template<
class X,
class Y,
class C,
class P=Preconditioner<X,Y> >
302 : _preconditioner(stackobject_to_shared_ptr(p)), _communication(c)
313 : _preconditioner(p), _communication(c)
321 virtual void pre (X& x, Y& b)
323 _communication.copyOwnerToAll(x,x);
324 _preconditioner->pre(x,b);
332 virtual void apply (X& v,
const Y& d)
334 _preconditioner->apply(v,d);
335 _communication.copyOwnerToAll(v,v);
338 template<
bool forward>
341 _preconditioner->template apply<forward>(v,d);
342 _communication.copyOwnerToAll(v,v);
352 _preconditioner->post(x);
363 std::shared_ptr<P> _preconditioner;
Implementation of the BCRSMatrix class.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Some generic functions for pretty printing vectors and matrices.
Define general, extensible interface for operators. The available implementation wraps a matrix.
Classes providing communication interfaces for overlapping Schwarz methods.
Define general preconditioner interface.
Define base class for scalar product and norm.
Implementations of the inverse operator interface.
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:640
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:628
Definition: allocator.hh:7
Traits class for generically constructing non default constructable types.
Definition: construction.hh:38
X::field_type field_type
The field type of the operator.
Definition: operators.hh:72
A linear operator exporting itself in matrix form.
Definition: operators.hh:107
An overlapping Schwarz operator.
Definition: schwarz.hh:76
virtual const matrix_type & getmat() const
get the sequential assembled linear operator.
Definition: schwarz.hh:134
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const
apply operator to x, scale and add:
Definition: schwarz.hh:126
virtual void apply(const X &x, Y &y) const
apply operator to x:
Definition: schwarz.hh:117
C communication_type
The type of the communication object.
Definition: schwarz.hh:99
X domain_type
The type of the domain.
Definition: schwarz.hh:87
M matrix_type
The type of the matrix we operate on.
Definition: schwarz.hh:82
Y range_type
The type of the range.
Definition: schwarz.hh:92
X::field_type field_type
The field type of the range.
Definition: schwarz.hh:94
OverlappingSchwarzOperator(const matrix_type &A, const communication_type &com)
constructor: just store a reference to a matrix.
Definition: schwarz.hh:108
OverlappingSchwarzOperator(const std::shared_ptr< matrix_type > A, const communication_type &com)
Definition: schwarz.hh:112
virtual SolverCategory::Category category() const
Category of the linear operator (see SolverCategory::Category)
Definition: schwarz.hh:140
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:30
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:37
A parallel SSOR preconditioner.
Definition: schwarz.hh:170
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:179
C communication_type
The type of the communication object.
Definition: schwarz.hh:181
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:228
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition: schwarz.hh:192
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:225
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:175
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:177
M matrix_type
The matrix type the preconditioner is for.
Definition: schwarz.hh:173
virtual void apply(X &v, const Y &d)
Apply the precondtioner.
Definition: schwarz.hh:211
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:201
Block parallel preconditioner.
Definition: schwarz.hh:273
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:321
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:280
BlockPreconditioner(const std::shared_ptr< P > &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:312
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: schwarz.hh:332
BlockPreconditioner(P &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:301
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: schwarz.hh:339
C communication_type
The type of the communication object..
Definition: schwarz.hh:292
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:287
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:350
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:285
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:356
Category
Definition: solvercategory.hh:21
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27