5 #ifndef DUNE_ISTL_SCHWARZ_HH 6 #define DUNE_ISTL_SCHWARZ_HH 15 #include <dune/common/timer.hh> 73 template<
class M,
class X,
class Y,
class C>
74 class OverlappingSchwarzOperator :
public AssembledLinearOperator<M,X,Y>
108 : _A_(stackobject_to_shared_ptr(A)), communication(com)
112 : _A_(A), communication(com)
116 void apply (
const X& x, Y& y)
const override 120 communication.project(y);
127 _A_->usmv(alpha,x,y);
128 communication.project(y);
148 return communication;
151 const std::shared_ptr<const matrix_type>_A_;
161 template<
class M,
class X,
class Y,
class C>
198 : _A_(A), _n(n), _w(w), communication(c)
206 void pre (X& x, [[maybe_unused]] Y& b)
override 208 communication.copyOwnerToAll(x,x);
216 void apply (X& v,
const Y& d)
override 218 for (
int i=0; i<_n; i++) {
222 communication.copyOwnerToAll(v,v);
230 void post ([[maybe_unused]] X& x)
override {}
251 template<
class T>
struct ConstructionTraits;
277 template<
class X,
class Y,
class C,
class P=Preconditioner<X,Y> >
307 : _preconditioner(stackobject_to_shared_ptr(p)), _communication(c)
318 : _preconditioner(p), _communication(c)
326 void pre (X& x, Y& b)
override 328 _communication.copyOwnerToAll(x,x);
329 _preconditioner->pre(x,b);
337 void apply (X& v,
const Y& d)
override 339 _preconditioner->apply(v,d);
340 _communication.copyOwnerToAll(v,v);
343 template<
bool forward>
346 _preconditioner->template apply<forward>(v,d);
347 _communication.copyOwnerToAll(v,v);
357 _preconditioner->post(x);
368 std::shared_ptr<P> _preconditioner;
Y range_type
The type of the range.
Definition: schwarz.hh:91
OverlappingSchwarzOperator(const std::shared_ptr< matrix_type > A, const communication_type &com)
Definition: schwarz.hh:111
Classes providing communication interfaces for overlapping Schwarz methods.
Some generic functions for pretty printing vectors and matrices.
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:184
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:361
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category)
Definition: schwarz.hh:233
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:290
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:40
Define base class for scalar product and norm.
void post(X &x) override
Clean up.
Definition: schwarz.hh:355
C communication_type
The type of the communication object.
Definition: schwarz.hh:186
void apply(const X &x, Y &y) const override
apply operator to x:
Definition: schwarz.hh:116
The incomplete LU factorization kernels.
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:33
BlockPreconditioner(P &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:306
SolverCategory::Category category() const override
Category of the linear operator (see SolverCategory::Category)
Definition: schwarz.hh:139
Define general preconditioner interface.
C communication_type
The type of the communication object..
Definition: schwarz.hh:297
void pre(X &x, [[maybe_unused]] Y &b) override
Prepare the preconditioner.
Definition: schwarz.hh:206
Block parallel preconditioner.
Definition: schwarz.hh:278
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition: schwarz.hh:337
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition: schwarz.hh:197
C communication_type
The type of the communication object.
Definition: schwarz.hh:98
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:180
BlockPreconditioner(const std::shared_ptr< P > &p, const communication_type &c)
Constructor.
Definition: schwarz.hh:317
Traits class for generically constructing non default constructable types.
Definition: novlpschwarz.hh:257
Implementations of the inverse operator interface.
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition: gsetc.hh:646
X::field_type field_type
The field type of the operator.
Definition: operators.hh:75
OverlappingSchwarzOperator(const matrix_type &A, const communication_type &com)
constructor: just store a reference to a matrix.
Definition: schwarz.hh:107
This file implements a vector space as a tensor product of a given vector space. The number of compon...
const matrix_type & getmat() const override
get the sequential assembled linear operator.
Definition: schwarz.hh:133
Implementation of the BCRSMatrix class.
void post([[maybe_unused]] X &x) override
Clean up.
Definition: schwarz.hh:230
Y range_type
The range type of the preconditioner.
Definition: schwarz.hh:182
X domain_type
The type of the domain.
Definition: schwarz.hh:86
X::field_type field_type
The field type of the range.
Definition: schwarz.hh:93
X::field_type field_type
The field type of the preconditioner.
Definition: schwarz.hh:292
M matrix_type
The type of the matrix we operate on.
Definition: schwarz.hh:81
Category for overlapping solvers.
Definition: solvercategory.hh:29
void applyscaleadd(field_type alpha, const X &x, Y &y) const override
apply operator to x, scale and add:
Definition: schwarz.hh:125
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition: schwarz.hh:326
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition: schwarz.hh:216
M matrix_type
The matrix type the preconditioner is for.
Definition: schwarz.hh:178
Category
Definition: solvercategory.hh:23
X domain_type
The domain type of the preconditioner.
Definition: schwarz.hh:285
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition: schwarz.hh:344
Definition: allocator.hh:11
const communication_type & getCommunication() const
Get the object responsible for communication.
Definition: schwarz.hh:146
Define general, extensible interface for operators. The available implementation wraps a matrix...
A parallel SSOR preconditioner.
Definition: schwarz.hh:175
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition: gsetc.hh:634