DUNE-FUNCTIONS (unstable)

defaultderivativetraits.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
8#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
9
10#include <type_traits>
11#include <utility>
12
13#include <dune/common/fvector.hh>
14#include <dune/common/fmatrix.hh>
15
16namespace Dune {
17namespace Functions {
18
19
20
27{};
28
29
39template<class Signature>
41{
44};
45
46
54template<>
55struct DefaultDerivativeTraits< double(double) >
56{
58 typedef double Range;
59};
60
70template<typename K, int n>
71struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
72{
74 typedef FieldVector<K,n> Range;
75};
76
86template<typename K, int n, int m>
87struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
88{
90 typedef FieldMatrix<K,m,n> Range;
91};
92
102template<typename K, int n, int m>
103struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
104{
106 typedef FieldMatrix<K,m,n> Range;
107};
108
109
110}} // namespace Dune::Functions
111
112
113#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
Dummy range class to be used if no proper type is available.
Definition: defaultderivativetraits.hh:27
Definition: polynomial.hh:17
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:106
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:90
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:74
double Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:58
Default implementation for derivative traits.
Definition: defaultderivativetraits.hh:41
InvalidRange Range
Range of derivative for function with given signature.
Definition: defaultderivativetraits.hh:43
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 13, 22:30, 2024)