Dune-Functions 2.11
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
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
9
10#include <dune/common/reservedvector.hh>
11#include <dune/common/typeutilities.hh>
12#include <dune/common/concept.hh>
13
14#include <dune/common/typetree/treepath.hh>
15
19
20
21
22namespace Dune {
23namespace Functions {
24
25
26
27template<class RB, class TP>
29{
30public:
31
32 using RootBasis = RB;
33
34 using RootLocalView = typename RootBasis::LocalView;
35
36 using PrefixPath = TP;
37
39 using GridView = typename RootBasis::GridView;
40
42 using MultiIndex = typename RootBasis::MultiIndex;
43
44 using size_type = std::size_t;
45
48
49 using SizePrefix = typename RootBasis::SizePrefix;
50
51
57
63 template<class RootRootBasis, class InnerTP, class OuterTP>
67
68
71 const GridView& gridView() const
72 {
73 return rootBasis_->gridView();
74 }
75
80 {
81 return rootBasis_->dimension();
82 }
83
86 {
87 return rootBasis_->size();
88 }
89
91 size_type size(const SizePrefix& prefix) const
92 {
93 return rootBasis_->size(prefix);
94 }
95
100 {
101 return LocalView(*this, prefixPath_);
102 }
103
104 const RootBasis& rootBasis() const
105 {
106 return *rootBasis_;
107 }
108
109 const PrefixPath& prefixPath() const
110 {
111 return prefixPath_;
112 }
113
116 {
117 return rootBasis_->containerDescriptor();
118 }
119
120protected:
123};
124
125
126// CTAD guide for a non-SubspaceBasis root basis
127template<class RB, class TP>
128SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
129
130// CTAD guide for a SubspaceBasis root basis
131template<class RootRootBasis, class InnerTP, class OuterTP>
132SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
133 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, decltype(Dune::TypeTree::join(rootBasis.prefixPath(), prefixPath))>;
134
135
136
147template<class RootBasis, class... PrefixTreeIndices>
148auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::TreePath<PrefixTreeIndices...>& prefixPath)
149{
150 return SubspaceBasis(rootBasis, prefixPath);
151}
152
153template<class RootBasis, class... PrefixTreeIndices>
154auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
155{
156 return subspaceBasis(rootBasis, TypeTree::treePath(prefixTreeIndices...));
157}
158
159
160
161} // end namespace Functions
162} // end namespace Dune
163
164
165
166#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
Definition monomialset.hh:19
Definition monomialset.hh:19
SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::TreePath< PrefixTreeIndices... > &prefixPath)
Create SubspaceBasis from a root basis and a prefixPath.
Definition subspacebasis.hh:148
Definition subspacebasis.hh:29
typename RootBasis::LocalView RootLocalView
Definition subspacebasis.hh:34
LocalView localView() const
Return local view for basis.
Definition subspacebasis.hh:99
typename RootBasis::SizePrefix SizePrefix
Definition subspacebasis.hh:49
TP PrefixPath
Definition subspacebasis.hh:36
SubspaceLocalView< RootLocalView, PrefixPath > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition subspacebasis.hh:47
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition subspacebasis.hh:91
typename RootBasis::GridView GridView
The grid view that the FE space is defined on.
Definition subspacebasis.hh:39
const PrefixPath & prefixPath() const
Definition subspacebasis.hh:109
SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
Constructor from another SubspaceBasis.
Definition subspacebasis.hh:64
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition subspacebasis.hh:71
auto containerDescriptor() const
Return the associated container descriptor.
Definition subspacebasis.hh:115
RB RootBasis
Definition subspacebasis.hh:32
size_type size() const
Return number of possible values for next position in empty multi index.
Definition subspacebasis.hh:85
const RootBasis & rootBasis() const
Definition subspacebasis.hh:104
typename RootBasis::MultiIndex MultiIndex
Type used for global numbering of the basis vectors.
Definition subspacebasis.hh:42
size_type dimension() const
Definition subspacebasis.hh:79
std::size_t size_type
Definition subspacebasis.hh:44
SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
Constructor for a given grid view object.
Definition subspacebasis.hh:53
The restriction of a finite element basis to a single element.
Definition subspacelocalview.hh:34