dune-functions 2.9.0
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
12namespace Dune {
13namespace Functions {
14
15
16
23{};
24
25
35template<class Signature>
37{
40};
41
42
50template<>
51struct DefaultDerivativeTraits< double(double) >
52{
54 typedef double Range;
55};
56
66template<typename K, int n>
67struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
68{
70 typedef FieldVector<K,n> Range;
71};
72
82template<typename K, int n, int m>
83struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
84{
86 typedef FieldMatrix<K,m,n> Range;
87};
88
98template<typename K, int n, int m>
99struct 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