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>
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_;
174 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>
347 _communication.copyOwnerToAll(v,v);
357 _preconditioner->post(x);
368 std::shared_ptr<P> _preconditioner;
Implementation of the BCRSMatrix class.
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
Classes providing communication interfaces for overlapping Schwarz methods.
Define general preconditioner interface.
Implementations of the inverse operator interface.
Some generic functions for pretty printing vectors and matrices.
Define general, extensible interface for operators. The available implementation wraps a matrix.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Define base class for scalar product and norm.
The incomplete LU factorization kernels.
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition gsetc.hh:646
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition gsetc.hh:634
Definition allocator.hh:11
Definition novlpschwarz.hh:256
Traits class for generically constructing non default constructable types.
Definition construction.hh:39
A linear operator exporting itself in matrix form.
Definition operators.hh:110
const matrix_type & getmat() const override
get the sequential assembled linear operator.
Definition schwarz.hh:133
const communication_type & getCommunication() const
Get the object responsible for communication.
Definition schwarz.hh:146
void apply(const X &x, Y &y) const override
apply operator to x:
Definition schwarz.hh:116
void applyscaleadd(field_type alpha, const X &x, Y &y) const override
apply operator to x, scale and add:
Definition schwarz.hh:125
C communication_type
The type of the communication object.
Definition schwarz.hh:98
SolverCategory::Category category() const override
Category of the linear operator (see SolverCategory::Category).
Definition schwarz.hh:139
X domain_type
The type of the domain.
Definition schwarz.hh:86
M matrix_type
The type of the matrix we operate on.
Definition schwarz.hh:81
Y range_type
The type of the range.
Definition schwarz.hh:91
X::field_type field_type
The field type of the range.
Definition schwarz.hh:93
OverlappingSchwarzOperator(const matrix_type &A, const communication_type &com)
constructor: just store a reference to a matrix.
Definition schwarz.hh:107
OverlappingSchwarzOperator(const std::shared_ptr< matrix_type > A, const communication_type &com)
Definition schwarz.hh:111
Base class for matrix free definition of preconditioners.
Definition preconditioner.hh:33
X::field_type field_type
The field type of the preconditioner.
Definition schwarz.hh:184
C communication_type
The type of the communication object.
Definition schwarz.hh:186
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition schwarz.hh:206
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition schwarz.hh:197
X domain_type
The domain type of the preconditioner.
Definition schwarz.hh:180
Y range_type
The range type of the preconditioner.
Definition schwarz.hh:182
M matrix_type
The matrix type the preconditioner is for.
Definition schwarz.hh:178
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition schwarz.hh:233
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition schwarz.hh:216
void post(X &x) override
Clean up.
Definition schwarz.hh:230
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition schwarz.hh:361
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:337
X domain_type
Definition schwarz.hh:285
BlockPreconditioner(const std::shared_ptr< P > &p, const communication_type &c)
Constructor.
Definition schwarz.hh:317
BlockPreconditioner(P &p, const communication_type &c)
Constructor.
Definition schwarz.hh:306
void apply(X &v, const Y &d)
Apply one step of the preconditioner to the system A(v)=d.
Definition schwarz.hh:344
void post(X &x) override
Clean up.
Definition schwarz.hh:355
C communication_type
Definition schwarz.hh:297
X::field_type field_type
Definition schwarz.hh:292
Y range_type
Definition schwarz.hh:290
Category
Definition solvercategory.hh:23
@ overlapping
Category for overlapping solvers.
Definition solvercategory.hh:29