dune-functions 2.8.0
Loading...
Searching...
No Matches
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
16namespace Dune {
17namespace Functions {
18
19
20
21template<class RB, class TP>
23{
24public:
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
45
50 {
51// static_assert(models<Concept::NodeFactory<GridView>, NodeFactory>(), "Type passed to DefaultGlobalBasis does not model the NodeFactory concept.");
52 }
53
56 const GridView& gridView() const
57 {
58 return rootBasis_->gridView();
59 }
60
65 {
66 return rootBasis_->dimension();
67 }
68
71 {
72 return rootBasis_->size();
73 }
74
76 size_type size(const SizePrefix& prefix) const
77 {
78 return rootBasis_->size(prefix);
79 }
80
85 {
86 return LocalView(*this, prefixPath_);
87 }
88
89 const RootBasis& rootBasis() const
90 {
91 return *rootBasis_;
92 }
93
94 const PrefixPath& prefixPath() const
95 {
96 return prefixPath_;
97 }
98
99protected:
102};
103
104
105template<class RootBasis, class... PrefixTreeIndices>
106auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
107{
108 using PrefixPath = TypeTree::HybridTreePath<PrefixTreeIndices...>;
109 return SubspaceBasis<RootBasis, PrefixPath>{rootBasis, prefixPath};
110}
111
112template<class RootBasis, class... PrefixTreeIndices>
113auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
114{
115 return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
116}
117
118
119
120} // end namespace Functions
121} // end namespace Dune
122
123
124
125#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
Definition: polynomial.hh:10
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
Definition: subspacebasis.hh:106
Definition: subspacebasis.hh:23
typename RootBasis::LocalView RootLocalView
Definition: subspacebasis.hh:28
LocalView localView() const
Return local view for basis.
Definition: subspacebasis.hh:84
const RootBasis * rootBasis_
Definition: subspacebasis.hh:100
typename RootBasis::SizePrefix SizePrefix
Definition: subspacebasis.hh:43
TP PrefixPath
Definition: subspacebasis.hh:30
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition: subspacebasis.hh:41
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition: subspacebasis.hh:76
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition: subspacebasis.hh:33
const PrefixPath & prefixPath() const
Definition: subspacebasis.hh:94
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: subspacebasis.hh:56
RB RootBasis
Definition: subspacebasis.hh:26
PrefixPath prefixPath_
Definition: subspacebasis.hh:101
size_type size() const
Return number of possible values for next position in empty multi index.
Definition: subspacebasis.hh:70
const RootBasis & rootBasis() const
Definition: subspacebasis.hh:89
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition: subspacebasis.hh:36
size_type dimension() const
Definition: subspacebasis.hh:64
std::size_t size_type
Definition: subspacebasis.hh:38
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition: subspacebasis.hh:47
The restriction of a finite element basis to a single element.
Definition: subspacelocalview.hh:30