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 virtual void apply (
const X& x, Y& y)
const
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 virtual void pre (X& x, [[maybe_unused]] Y& b)
208 communication.copyOwnerToAll(x,x);
216 virtual void apply (X& v,
const Y& d)
218 for (
int i=0; i<_n; i++) {
222 communication.copyOwnerToAll(v,v);
230 virtual void post ([[maybe_unused]] X& x) {}
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 virtual void pre (X& x, Y& b)
328 _communication.copyOwnerToAll(x,x);
329 _preconditioner->pre(x,b);
337 virtual void apply (X& v,
const Y& d)
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;
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.
The incomplete LU factorization kernels.
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:646
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition gsetc.hh:634
Definition allocator.hh:11
A linear operator exporting itself in matrix form.
Definition operators.hh:109
An overlapping Schwarz operator.
Definition schwarz.hh:75
const communication_type & getCommunication() const
Get the object responsible for communication.
Definition schwarz.hh:146
virtual const matrix_type & getmat() const
get the sequential assembled linear operator.
Definition schwarz.hh:133
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const
apply operator to x, scale and add:
Definition schwarz.hh:125
virtual void apply(const X &x, Y &y) const
apply operator to x:
Definition schwarz.hh:116
C communication_type
The type of the communication object.
Definition schwarz.hh:98
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
virtual SolverCategory::Category category() const
Category of the linear operator (see SolverCategory::Category)
Definition schwarz.hh:139
Base class for matrix free definition of preconditioners.
Definition preconditioner.hh:32
A parallel SSOR preconditioner.
Definition schwarz.hh:175
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
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition schwarz.hh:233
ParSSOR(const matrix_type &A, int n, field_type w, const communication_type &c)
Constructor.
Definition schwarz.hh:197
virtual void post(X &x)
Clean up.
Definition schwarz.hh:230
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
virtual void apply(X &v, const Y &d)
Apply the precondtioner.
Definition schwarz.hh:216
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition schwarz.hh:206
Block parallel preconditioner.
Definition schwarz.hh:278
virtual void pre(X &x, Y &b)
Prepare the preconditioner.
Definition schwarz.hh:326
X domain_type
The domain type of the preconditioner.
Definition schwarz.hh:285
BlockPreconditioner(const std::shared_ptr< P > &p, const communication_type &c)
Constructor.
Definition schwarz.hh:317
virtual void apply(X &v, const Y &d)
Apply the preconditioner.
Definition schwarz.hh:337
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
C communication_type
The type of the communication object..
Definition schwarz.hh:297
X::field_type field_type
The field type of the preconditioner.
Definition schwarz.hh:292
virtual void post(X &x)
Clean up.
Definition schwarz.hh:355
Y range_type
The range type of the preconditioner.
Definition schwarz.hh:290
virtual SolverCategory::Category category() const
Category of the preconditioner (see SolverCategory::Category)
Definition schwarz.hh:361
Category
Definition solvercategory.hh:23
@ overlapping
Category for overlapping solvers.
Definition solvercategory.hh:29