Dune Core Modules (2.6.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
54 virtual void pre (X& x, Y& b) = 0;
55
66 virtual void apply (X& v, const Y& d) = 0;
67
76 virtual void post (X& x) = 0;
77
80#if DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
81 {
82 DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
83 }
84#else
85 = 0;
86#endif
87
89 virtual ~Preconditioner () {}
90
91 };
92
96}
97#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:89
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:10
Category
Definition: solvercategory.hh:21
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)