1 #ifndef DUNE_FEM_DIFFERENTIABLEOPERATOR_HH
2 #define DUNE_FEM_DIFFERENTIABLEOPERATOR_HH
3 
4 #include <dune/fem/operator/common/operator.hh>
5 
6 namespace Dune
7 {
8 
9   namespace Fem
10   {
11 
12     /** \class DifferentiableOperator
13      *  \brief abstract differentiable operator
14      *
15      *  Differentiable operators are operators providing a linearization.
16      *
17      *  \tparam  JacobianOperator  type of linear operator describing the Jacobian
18      *                             (linearization) of this operator
19      *
20      *  \note The types for the operator's domain and range function are derived
21      *        from the JacobianOperator.
22      *
23      *  \interfaceclass
24      */
25     template< class JacobianOperator >
26     class DifferentiableOperator
27     : public virtual Dune::Fem::Operator< typename JacobianOperator::DomainFunctionType,
28                                           typename JacobianOperator::RangeFunctionType >
29     {
30       typedef Dune::Fem::Operator< typename JacobianOperator::DomainFunctionType,
31                                    typename JacobianOperator::RangeFunctionType > BaseType;
32 
33     public:
34       /** \brief type of linear operator modelling the operator's Jacobian */
35       typedef JacobianOperator JacobianOperatorType;
36 
37       /** \brief type of discrete function in the operator's domain */
38       typedef typename BaseType::DomainFunctionType DomainFunctionType;
39       /** \brief type of discrete function in the operator's range */
40       typedef typename BaseType::RangeFunctionType RangeFunctionType;
41 
42       /** \brief field type of the operator's domain */
43       typedef typename DomainFunctionType::RangeFieldType DomainFieldType;
44       /** \brief field type of the operator's range */
45       typedef typename RangeFunctionType::RangeFieldType RangeFieldType;
46 
47       /** \brief obtain linearization
48        *
49        *  \param[in]   u    argument discrete function
50        *  \param[out]  jOp  destination Jacobian operator
51        *
52        *  \note This method has to be implemented by all derived classes.
53        */
54       virtual void jacobian ( const DomainFunctionType &u, JacobianOperatorType &jOp ) const = 0;
55     };
56 
57   } // namespace Fem
58 
59 } // namespace Dune
60 
61 #endif // #ifndef DUNE_FEM_DIFFERENTIABLEOPERATOR_HH
62