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);
149 return communication;
152 const std::shared_ptr<const matrix_type>_A_;
175 template<
class M,
class X,
class Y,
class C>
199 : _A_(A), _n(n), _w(w), communication(c)
207 virtual void pre (X& x, Y& b)
209 communication.copyOwnerToAll(x,x);
217 virtual void apply (X& v,
const Y& d)
219 for (
int i=0; i<_n; i++) {
223 communication.copyOwnerToAll(v,v);
252 template<
class T>
struct ConstructionTraits;
278 template<
class X,
class Y,
class C,
class P=Preconditioner<X,Y> >
308 : _preconditioner(stackobject_to_shared_ptr(p)), _communication(c)
319 : _preconditioner(p), _communication(c)
327 virtual void pre (X& x, Y& b)
329 _communication.copyOwnerToAll(x,x);
330 _preconditioner->pre(x,b);
338 virtual void apply (X& v,
const Y& d)
340 _preconditioner->apply(v,d);
341 _communication.copyOwnerToAll(v,v);
344 template<
bool forward>
347 _preconditioner->template apply<forward>(v,d);
348 _communication.copyOwnerToAll(v,v);
358 _preconditioner->post(x);
369 std::shared_ptr<P> _preconditioner;
Implementations of the inverse operator interface.
Define general preconditioner interface.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Classes providing communication interfaces for overlapping Schwarz methods.
Implementation of the BCRSMatrix class.
Some generic functions for pretty printing vectors and matrices.
Define base class for scalar product and norm.
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Define general, extensible interface for operators. The available implementation wraps a matrix.
The incomplete LU factorization kernels.
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:644
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:632
Definition: allocator.hh:9
Traits class for generically constructing non default constructable types.
Definition: construction.hh:37
A linear operator exporting itself in matrix form.
Definition: operators.hh:107
An overlapping Schwarz operator.
Definition: schwarz.hh:76
const communication_type & getCommunication() const
Get the object responsible for communication.
Definition: schwarz.hh:147
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
A parallel SSOR preconditioner.
Definition: schwarz.hh:176
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:185
C communication_type
The type of the communication object.
Definition: schwarz.hh:187
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:234
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition: schwarz.hh:198
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:231
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:181
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:183
M matrix_type
The matrix type the preconditioner is for.
Definition: schwarz.hh:179
virtual void apply(X &v, const Y &d)
Apply the precondtioner.
Definition: schwarz.hh:217
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:207
Block parallel preconditioner.
Definition: schwarz.hh:279
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition: schwarz.hh:327
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:286
BlockPreconditioner(const std::shared_ptr< P > &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:318
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition: schwarz.hh:338
BlockPreconditioner(P &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:307
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: schwarz.hh:345
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:293
virtual void post(X &x)
Clean up.
Definition: schwarz.hh:356
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:291
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:362
Category
Definition: solvercategory.hh:21
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27