dune-functions  2.7.1
defaultderivativetraits.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
4 #define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
5 
6 #include <type_traits>
7 #include <utility>
8 
9 #include <dune/common/fvector.hh>
10 #include <dune/common/fmatrix.hh>
11 
12 namespace Dune {
13 namespace Functions {
14 
15 
16 
23 {};
24 
25 
35 template<class Signature>
37 {
40 };
41 
42 
50 template<>
51 struct DefaultDerivativeTraits< double(double) >
52 {
54  typedef double Range;
55 };
56 
66 template<typename K, int n>
67 struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
68 {
70  typedef FieldVector<K,n> Range;
71 };
72 
82 template<typename K, int n, int m>
83 struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
84 {
86  typedef FieldMatrix<K,m,n> Range;
87 };
88 
98 template<typename K, int n, int m>
99 struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
100 {
102  typedef FieldMatrix<K,m,n> Range;
103 };
104 
105 
106 }} // namespace Dune::Functions
107 
108 
109 #endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
Definition: polynomial.hh:10
Dummy range class to be used if no proper type is available.
Definition: defaultderivativetraits.hh:23
Default implementation for derivative traits.
Definition: defaultderivativetraits.hh:37
InvalidRange Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:39
double Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:54
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:70
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:86
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:102