dune-fem  2.8-git
istloperator.hh
Go to the documentation of this file.
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
11 
12 namespace 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 operator()( const DomainFunction &arg, RangeFunction &dest ) const
50  {
51  apply( arg, dest );
52  }
53 
54  virtual void finalize() { BaseType::compress(); }
55 
56  };
57 
59  template< class DomainFunctionSpace, class RangeFunctionSpace,
60  class DomainBlock, class RangeBlock >
61  struct ISTLLinearOperator< ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock >,
62  ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > >
63  : public ISTLMatrixObject< DomainFunctionSpace, RangeFunctionSpace, DomainBlock, RangeBlock >,
64  public AssembledOperator< ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock >,
65  ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > >
66  {
67  typedef DomainFunctionSpace DomainSpaceType;
68  typedef RangeFunctionSpace RangeSpaceType;
69 
70  typedef ISTLBlockVectorDiscreteFunction< DomainFunctionSpace, DomainBlock > DomainFunction;
71  typedef ISTLBlockVectorDiscreteFunction< RangeFunctionSpace, RangeBlock > RangeFunction;
72 
73  typedef ISTLLinearOperator< DomainFunction, RangeFunction > ThisType;
74  typedef ISTLMatrixObject< DomainSpaceType, RangeSpaceType, DomainBlock, RangeBlock > BaseType;
75 
76  static constexpr bool assembled = true;
77 
78  using BaseType::apply;
79 
87  ISTLLinearOperator( const std::string & ,
88  const DomainSpaceType &domainSpace,
89  const RangeSpaceType &rangeSpace,
90  const ISTLSolverParameter& param = ISTLSolverParameter() )
91  : BaseType( domainSpace, rangeSpace, param )
92  {}
93 
94  virtual void operator()( const DomainFunction &arg, RangeFunction &dest ) const
95  {
96  apply( arg, dest );
97  }
98 
99  virtual void finalize() { BaseType::compress(); }
100 
101  };
102 
103  } // namespace Fem
104 
105 } // namespace Dune
106 
107 #endif // #if HAVE_DUNE_ISTL
108 
109 #endif // #ifndef DUNE_FEM_ISTLLINEAROPERATOR_HH
Definition: bindguard.hh:11