dune-functions 2.9.0
hierarchicnodetorangemap.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_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
5
6
7#include <utility>
8#include <type_traits>
9
10#include <dune/common/concept.hh>
11
14
15namespace Dune {
16namespace Functions {
17
18
19
30{
31 template<class Node, class TreePath, class Range,
32 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
34 {
35 return resolveStaticMultiIndex(y, treePath);
36 }
37
38 template<class Node, class TreePath, class Range,
39 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
41 {
42 return std::forward<Range>(y);
43 }
44};
45
46
47
48} // namespace Dune::Functions
49} // namespace Dune
50
51
52#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition: indexaccess.hh:398
Definition: polynomial.hh:10
A simple node to range map using the nested tree indices.
Definition: hierarchicnodetorangemap.hh:30
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition: hierarchicnodetorangemap.hh:33
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition: hierarchicnodetorangemap.hh:40