1#ifndef DUNE_FEM_SOLVER_PRECONDITIONEDINVERSEOPERATOR_HH
2#define DUNE_FEM_SOLVER_PRECONDITIONEDINVERSEOPERATOR_HH
7#include <dune/fem/operator/common/operator.hh>
18 template<
class Preconditioner,
class InverseOperator >
19 class PreconditionedInverseOperator
20 :
public Operator< typename Preconditioner::RangeFunctionType >
22 typedef PreconditionedInverseOperator< Preconditioner, InverseOperator > ThisType;
23 typedef Operator< typename Preconditioner::RangeFunctionType > BaseType;
29 typedef typename InverseOperator::OperatorType OperatorType;
31 PreconditionedInverseOperator (
double redEps,
double absLimit,
unsigned int maxIterations,
bool verbose )
32 : inverseOperator_( redEps, absLimit, maxIterations, verbose )
35 PreconditionedInverseOperator (
double redEps,
double absLimit,
37 : inverseOperator_( redEps, absLimit, maxIterations )
40 PreconditionedInverseOperator (
const OperatorType &op,
double redEps,
double absLimit,
41 unsigned int maxIterations,
bool verbose )
42 : inverseOperator_( redEps, absLimit, maxIterations, verbose )
47 PreconditionedInverseOperator (
const OperatorType &op,
double redEps,
double absLimit,
49 : inverseOperator_( redEps, absLimit, maxIterations )
54 void bind (
const OperatorType &op )
56 preconditioner_.reset(
new Preconditioner( op ) );
57 asssert( preconditioner_ );
58 inverseOperator_.bind( op, *preconditioner_ );
60 void unbind() { inverseOperator_.unbind(); preconditioner_.reset(); }
62 void operator() (
const DomainFunctionType &u, RangeFunctionType &w )
const
64 assert( preconditioner_ );
65 inverseOperator_( u, w );
68 unsigned int iterations ()
const {
return inverseOperator_.iterations(); }
69 void setMaxIterations (
unsigned int maxIterations )
const { inverseOperator_.setMaxIterations( maxIterations ); }
72 InverseOperator inverseOperator_;
73 std::unique_ptr< Preconditioner > preconditioner_;
constexpr auto max
Function object that returns the greater of the given values.
Definition: hybridutilities.hh:484
Dune namespace.
Definition: alignedallocator.hh:13
DomainFunction DomainFunctionType
type of discrete function in the operator's domain
Definition: operator.hh:36