3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
10#include <dune/functions/common/type_traits.hh>
11#include <dune/functions/functionspacebases/subspacelocalview.hh>
12#include <dune/functions/functionspacebases/concepts.hh>
21template<
class RB,
class TP>
28 using RootLocalView =
typename RootBasis::LocalView;
30 using PrefixPath = TP;
33 using GridView =
typename RootBasis::GridView;
36 using MultiIndex =
typename RootBasis::MultiIndex;
38 using size_type = std::size_t;
41 using LocalView = SubspaceLocalView<RootLocalView, PrefixPath>;
43 using SizePrefix =
typename RootBasis::SizePrefix;
47 SubspaceBasis(
const RootBasis& rootBasis,
const PrefixPath& prefixPath) :
48 rootBasis_(&rootBasis),
49 prefixPath_(prefixPath)
56 const GridView& gridView()
const
58 return rootBasis_->gridView();
64 size_type dimension()
const
66 return rootBasis_->dimension();
70 size_type size()
const
72 return rootBasis_->size();
76 size_type size(
const SizePrefix& prefix)
const
78 return rootBasis_->size(prefix);
84 LocalView localView()
const
86 return LocalView(*
this, prefixPath_);
89 const RootBasis& rootBasis()
const
94 const PrefixPath& prefixPath()
const
100 const RootBasis* rootBasis_;
101 PrefixPath prefixPath_;
105template<
class RootBasis,
class... PrefixTreeIndices>
106auto subspaceBasis(
const RootBasis& rootBasis,
const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
108 using PrefixPath = TypeTree::HybridTreePath<PrefixTreeIndices...>;
109 return SubspaceBasis<RootBasis, PrefixPath>{rootBasis, prefixPath};
112template<
class RootBasis,
class... PrefixTreeIndices>
113auto subspaceBasis(
const RootBasis& rootBasis,
const PrefixTreeIndices&... prefixTreeIndices)
Infrastructure for concepts.
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:177
Dune namespace.
Definition: alignedallocator.hh:11
An stl-compliant random-access container which stores everything on the stack.
Utilities for type computations, constraining overloads, ...