dune-functions  2.5-dev
subspacebasis.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_SUBSPACEBASIS_HH
4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
5 
6 #include <dune/common/reservedvector.hh>
7 #include <dune/common/typeutilities.hh>
8 #include <dune/common/concept.hh>
9 
13 
14 
15 
16 namespace Dune {
17 namespace Functions {
18 
19 
20 
21 template<class RB, class TP>
23 {
24 public:
25 
26  using RootBasis = RB;
27 
28  using RootLocalView = typename RootBasis::LocalView;
29 
30  using PrefixPath = TP;
31 
33  using GridView = typename RootBasis::GridView;
34 
36  using MultiIndex = typename RootBasis::MultiIndex;
37 
38  using size_type = std::size_t;
39 
42 
43  using SizePrefix = typename RootBasis::SizePrefix;
44  using LocalIndexSet = typename RootBasis::LocalIndexSet;
45 
46 
49  rootBasis_(&rootBasis),
50  prefixPath_(prefixPath)
51  {
52 // static_assert(models<Concept::NodeFactory<GridView>, NodeFactory>(), "Type passed to DefaultGlobalBasis does not model the NodeFactory concept.");
53  }
54 
57  const GridView& gridView() const
58  {
59  return rootBasis_->gridView();
60  }
61 
66  {
67  return rootBasis_->dimension();
68  }
69 
71  size_type size() const
72  {
73  return rootBasis_->size();
74  }
75 
77  size_type size(const SizePrefix& prefix) const
78  {
79  return rootBasis_->size(prefix);
80  }
81 
86  {
87  return LocalView(*this, prefixPath_);
88  }
89 
91  {
92  return rootBasis_->localIndexSet();
93  }
94 
95  const RootBasis& rootBasis() const
96  {
97  return *rootBasis_;
98  }
99 
100  const PrefixPath& prefixPath() const
101  {
102  return prefixPath_;
103  }
104 
105 protected:
108 };
109 
110 
111 template<class RootBasis, class... PrefixTreeIndices>
112 auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
113 {
114  using PrefixPath = TypeTree::HybridTreePath<PrefixTreeIndices...>;
116 }
117 
118 template<class RootBasis, class... PrefixTreeIndices>
119 auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
120 {
121  return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
122 }
123 
124 
125 
126 } // end namespace Functions
127 } // end namespace Dune
128 
129 
130 
131 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
const PrefixPath & prefixPath() const
Definition: subspacebasis.hh:100
TP PrefixPath
Definition: subspacebasis.hh:30
size_type size() const
Return number of possible values for next position in empty multi index.
Definition: subspacebasis.hh:71
The restriction of a finite element basis to a single element.
Definition: subspacelocalview.hh:29
std::size_t size_type
Definition: subspacebasis.hh:38
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition: subspacebasis.hh:41
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: subspacebasis.hh:57
size_type dimension() const
Definition: subspacebasis.hh:65
const RootBasis * rootBasis_
Definition: subspacebasis.hh:106
typename RootBasis::LocalView RootLocalView
Definition: subspacebasis.hh:28
Definition: polynomial.hh:7
typename RootBasis::SizePrefix SizePrefix
Definition: subspacebasis.hh:43
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition: subspacebasis.hh:48
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition: subspacebasis.hh:33
Definition: subspacebasis.hh:22
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition: subspacebasis.hh:36
PrefixPath prefixPath_
Definition: subspacebasis.hh:107
RB RootBasis
Definition: subspacebasis.hh:26
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
Definition: subspacebasis.hh:112
const RootBasis & rootBasis() const
Definition: subspacebasis.hh:95
LocalIndexSet localIndexSet() const
Definition: subspacebasis.hh:90
LocalView localView() const
Return local view for basis.
Definition: subspacebasis.hh:85
typename RootBasis::LocalIndexSet LocalIndexSet
Definition: subspacebasis.hh:44
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition: subspacebasis.hh:77