Dune Core Modules (2.8.0)

preconditioner.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_ISTL_PRECONDITIONER_HH
4#define DUNE_ISTL_PRECONDITIONER_HH
5
7
8#include "solvercategory.hh"
9
10namespace Dune {
15 //=====================================================================
28 //=====================================================================
29 template<class X, class Y>
31 public:
33 typedef X domain_type;
35 typedef Y range_type;
37 typedef typename X::field_type field_type;
38
67 virtual void pre (X& x, Y& b) = 0;
68
79 virtual void apply (X& v, const Y& d) = 0;
80
89 virtual void post (X& x) = 0;
90
93#if DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
94 {
95 DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
96 }
97#else
98 = 0;
99#endif
100
102 virtual ~Preconditioner () {}
103
104 };
105
109}
110#endif
Base class for Dune-Exceptions.
Definition: exceptions.hh:94
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:30
virtual void post(X &x)=0
Clean up.
virtual void apply(X &v, const Y &d)=0
Apply one step of the preconditioner to the system A(v)=d.
virtual ~Preconditioner()
every abstract base class has a virtual destructor
Definition: preconditioner.hh:102
Y range_type
The range type of the preconditioner.
Definition: preconditioner.hh:35
X domain_type
The domain type of the preconditioner.
Definition: preconditioner.hh:33
virtual SolverCategory::Category category() const =0
Category of the preconditioner (see SolverCategory::Category)
X::field_type field_type
The field type of the preconditioner.
Definition: preconditioner.hh:37
virtual void pre(X &x, Y &b)=0
Prepare the preconditioner.
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Dune namespace.
Definition: alignedallocator.hh:11
Category
Definition: solvercategory.hh:21
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)