Loading...
Searching...
No Matches
defaultderivativetraits.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
#include <type_traits>
#include <utility>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
namespace Dune {
namespace Functions {
class InvalidRange
{};
template<class Signature>
struct DefaultDerivativeTraits
{
typedef InvalidRange Range;
};
template<>
struct DefaultDerivativeTraits< double(double) >
{
typedef double Range;
};
template<typename K, int n>
struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
{
typedef FieldVector<K,n> Range;
};
template<typename K, int n, int m>
struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
{
typedef FieldMatrix<K,m,n> Range;
};
template<typename K, int n, int m>
struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
{
typedef FieldMatrix<K,m,n> Range;
};
}} // namespace Dune::Functions
#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::InvalidRange
Dummy range class to be used if no proper type is available.
Definition defaultderivativetraits.hh:27
Dune::Functions::DefaultDerivativeTraits
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
Dune::Functions::DefaultDerivativeTraits::Range
InvalidRange Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:43
Dune::Functions::DefaultDerivativeTraits< double(double) >::Range
double Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:58
Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)>::Range
FieldVector< K, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:74
Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)>::Range
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:90
Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)>::Range
FieldMatrix< K, m, n > Range
Range of derivative for function with given signature.
Definition defaultderivativetraits.hh:106