Loading...
Searching...
No Matches
hierarchicnodetorangemap.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_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
#include <utility>
#include <type_traits>
#include <dune/common/concept.hh>
#include <dune/functions/functionspacebases/concepts.hh>
#include <dune/functions/common/indexaccess.hh>
namespace Dune {
namespace Functions {
struct HierarchicNodeToRangeMap
{
template<class Node, class TreePath, class Range,
std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
{
return resolveStaticMultiIndex(y, treePath);
}
template<class Node, class TreePath, class Range,
std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
{
return std::forward<Range>(y);
}
};
} // namespace Dune::Functions
} // namespace Dune
#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
indexaccess.hh
Dune::Functions::resolveStaticMultiIndex
constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
Provide multi-index access by chaining operator[].
Definition indexaccess.hh:421
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::HierarchicNodeToRangeMap
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
Dune::Functions::HierarchicNodeToRangeMap::operator()
decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
Definition hierarchicnodetorangemap.hh:37
Dune::Functions::HierarchicNodeToRangeMap::operator()
decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
Definition hierarchicnodetorangemap.hh:44
concepts.hh