Dune Core Modules (2.9.0)

preconditioner.hh
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_ISTL_PRECONDITIONER_HH
6#define DUNE_ISTL_PRECONDITIONER_HH
7
9
10#include "solvercategory.hh"
11
12namespace Dune {
17 //=====================================================================
30 //=====================================================================
31 template<class X, class Y>
33 public:
35 typedef X domain_type;
37 typedef Y range_type;
39 typedef typename X::field_type field_type;
40
69 virtual void pre (X& x, Y& b) = 0;
70
81 virtual void apply (X& v, const Y& d) = 0;
82
91 virtual void post (X& x) = 0;
92
95#if DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
96 {
97 DUNE_THROW(Dune::Exception,"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
98 }
99#else
100 = 0;
101#endif
102
104 virtual ~Preconditioner () {}
105
106 };
107
111}
112#endif
Base class for Dune-Exceptions.
Definition: exceptions.hh:96
Base class for matrix free definition of preconditioners.
Definition: preconditioner.hh:32
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:104
Y range_type
The range type of the preconditioner.
Definition: preconditioner.hh:37
X domain_type
The domain type of the preconditioner.
Definition: preconditioner.hh:35
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:39
virtual void pre(X &x, Y &b)=0
Prepare the preconditioner.
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13
Category
Definition: solvercategory.hh:23
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 20, 23:31, 2024)