DUNE-FEM (unstable)

istloperator.hh
1#ifndef DUNE_FEM_ISTLLINEAROPERATOR_HH
2#define DUNE_FEM_ISTLLINEAROPERATOR_HH
3
4#if HAVE_DUNE_ISTL
5
6// system includes
7#include <string>
8
9// local includes
10#include <dune/fem/operator/matrix/istlmatrix.hh>
11
12namespace Dune
13{
14
15 namespace Fem
16 {
17 template< class DomainFunction, class RangeFunction >
18 struct ISTLLinearOperator;
19
21 template< class DomainFunction, class RangeFunction >
22 struct ISTLLinearOperator
23 : public ISTLMatrixObject< typename DomainFunction::DiscreteFunctionSpaceType, typename RangeFunction::DiscreteFunctionSpaceType >,
24 public AssembledOperator< DomainFunction, RangeFunction >
25 {
26 typedef typename DomainFunction::DiscreteFunctionSpaceType DomainSpaceType;
27 typedef typename RangeFunction::DiscreteFunctionSpaceType RangeSpaceType;
28 typedef ISTLLinearOperator< DomainFunction, RangeFunction > ThisType;
29 typedef ISTLMatrixObject< DomainSpaceType, RangeSpaceType > BaseType;
30
31 static constexpr bool assembled = true;
32
33 using BaseType::apply;
34
42 ISTLLinearOperator( const std::string & ,
43 const DomainSpaceType &domainSpace,
44 const RangeSpaceType &rangeSpace,
45 const ISTLSolverParameter& param = ISTLSolverParameter() )
46 : BaseType( domainSpace, rangeSpace, param )
47 {}
48
49 virtual void clear() { BaseType::clear(); }
50
51 virtual void operator()( const DomainFunction &arg, RangeFunction &dest ) const
52 {
53 apply( arg, dest );
54 }
55
56 virtual void finalize() { BaseType::compress(); }
57
58 };
59
61 template< class DomainFunctionSpace, class RangeFunctionSpace,
62 class DomainBlock, class RangeBlock >
63 struct ISTLLinearOperator< ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock >,
64 ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > >
65 : public ISTLMatrixObject< DomainFunctionSpace, RangeFunctionSpace, DomainBlock, RangeBlock >,
66 public AssembledOperator< ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock >,
67 ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > >
68 {
69 typedef DomainFunctionSpace DomainSpaceType;
70 typedef RangeFunctionSpace RangeSpaceType;
71
72 typedef ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock > DomainFunction;
73 typedef ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > RangeFunction;
74
75 typedef ISTLLinearOperator< DomainFunction, RangeFunction > ThisType;
76 typedef ISTLMatrixObject< DomainSpaceType, RangeSpaceType, DomainBlock, RangeBlock > BaseType;
77
78 static constexpr bool assembled = true;
79
80 using BaseType::apply;
81
89 ISTLLinearOperator( const std::string & ,
90 const DomainSpaceType &domainSpace,
91 const RangeSpaceType &rangeSpace,
92 const ISTLSolverParameter& param = ISTLSolverParameter() )
93 : BaseType( domainSpace, rangeSpace, param )
94 {}
95
96 virtual void clear() { BaseType::clear(); }
97
98 virtual void operator()( const DomainFunction &arg, RangeFunction &dest ) const
99 {
100 apply( arg, dest );
101 }
102
103 virtual void finalize() { BaseType::compress(); }
104
105 };
106
107 } // namespace Fem
108
109} // namespace Dune
110
111#endif // #if HAVE_DUNE_ISTL
112
113#endif // #ifndef DUNE_FEM_ISTLLINEAROPERATOR_HH
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)