KASKADE 7 development version
Loading...
Searching...
No Matches
trivialpreconditioner.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2025 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef TRIVIALPRECONDITIONER_HH
14#define TRIVIALPRECONDITIONER_HH
15
17
18// #include "dune/istl/preconditioners.hh"
19// #include "dune/istl/solvercategory.hh"
20
21namespace Kaskade
22{
23
35 template <class Operator>
36 class TrivialPreconditioner: public SymmetricPreconditioner<typename Operator::domain_type,typename Operator::range_type>
37 {
38 public:
39 using field_type = typename Operator::field_type;
40 using domain_type = typename Operator::domain_type;
41 using range_type = typename Operator::range_type;
42
43 virtual void pre (domain_type&, range_type&) {}
44 virtual void apply (domain_type& x, range_type const& y) { x = y; }
45 virtual void post (domain_type&) {}
46
50 virtual field_type applyDp(domain_type& x, range_type const& y) override
51 {
52 x = y;
53 return x*y;
54 }
55
59 virtual bool requiresInitializedInput() const override
60 {
61 return false;
62 }
63
69 virtual Dune::SolverCategory::Category category() const override
70 {
71 return Dune::SolverCategory::sequential;
72 }
73 };
74
75} // namespace Kaskade
76#endif
Interface for symmetric preconditioners.
The trivial preconditioner: this is simply the identity that does exactly nothing.
virtual void post(domain_type &)
Preconditioner cleanup.
virtual field_type applyDp(domain_type &x, range_type const &y) override
Computes and returns .
virtual bool requiresInitializedInput() const override
Returns true if the target vector x has to be initialized to zero before calling apply or applyDp.
virtual void pre(domain_type &, range_type &)
Preconditioner preparation.
virtual void apply(domain_type &x, range_type const &y)
typename Operator::domain_type domain_type
virtual Dune::SolverCategory::Category category() const override
returns the category of the operator
typename Operator::field_type field_type
typename Operator::range_type range_type