1 #ifndef DUNE_FEM_OPERATOR_LINEAR_ISTLADAPTER_HH 2 #define DUNE_FEM_OPERATOR_LINEAR_ISTLADAPTER_HH 6 #include <dune/istl/operators.hh> 17 template<
class Operator >
18 class ISTLLinearOperatorAdapter
19 :
public Dune::LinearOperator< typename Operator::DomainFunctionType::DofStorageType, typename Operator::RangeFunctionType::DofStorageType >
21 typedef ISTLLinearOperatorAdapter< Operator > ThisType;
22 typedef Dune::LinearOperator< typename Operator::DomainFunctionType::DofStorageType, typename Operator::RangeFunctionType::DofStorageType > BaseType;
28 enum {category=SolverCategory::sequential};
30 typedef Operator OperatorType;
32 typedef typename DomainFunctionType::DiscreteFunctionSpaceType DomainFunctionSpaceType;
33 typedef typename RangeFunctionType::DiscreteFunctionSpaceType RangeFunctionSpaceType;
35 typedef typename BaseType::domain_type domain_type;
36 typedef typename BaseType::range_type range_type;
37 typedef typename BaseType::field_type field_type;
39 ISTLLinearOperatorAdapter (
const OperatorType &op,
40 const DomainFunctionSpaceType &domainSpace,
41 const RangeFunctionSpaceType &rangeSpace )
43 domainSpace_( domainSpace ),
44 rangeSpace_( rangeSpace )
47 virtual void apply (
const domain_type &x, range_type &y )
const 49 const DomainFunctionType fx(
"ISTLLinearOperatorAdapter::apply::x", domainSpace_, x );
50 RangeFunctionType fy(
"ISTLLinearOperatorAdapter::apply::y", rangeSpace_, y );
54 virtual void applyscaleadd ( field_type alpha,
const domain_type &x, range_type &y )
const 56 const DomainFunctionType fx(
"ISTLLinearOperatorAdapter::applyscaleadd::x", domainSpace_, x );
57 RangeFunctionType fy(
"ISTLLinearOperatorAdapter::applyscaleadd::y", rangeSpace_ );
59 y.axpy( alpha, fy.blockVector() );
63 const OperatorType &op_;
64 const DomainFunctionSpaceType &domainSpace_;
65 const RangeFunctionSpaceType &rangeSpace_;
72 #endif // #if HAVE_DUNE_ISTL 74 #endif // #ifndef DUNE_FEM_OPERATOR_LINEAR_ISTLADAPTER_HH RangeFunction RangeFunctionType
type of discrete function in the operator's range
Definition: operator.hh:30
Definition: coordinate.hh:4
DomainFunction DomainFunctionType
type of discrete function in the operator's domain
Definition: operator.hh:28