7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
11#include <dune/common/concept.hh>
12#include <dune/common/reservedvector.hh>
14#include <dune/functions/common/utility.hh>
16#include <dune/functions/functionspacebases/nodes.hh>
23using namespace Dune::Concept;
29 auto require(C&& c) ->
decltype(
39 auto require(C&& c) ->
decltype(
48 template<
class C,
class I>
49 auto require(C&& c, I&& i) ->
decltype(
59 auto require(
const N& node) ->
decltype(
60 requireType<typename N::size_type>(),
61 requireConvertible<typename N::size_type>(node.size()),
62 requireConvertible<typename N::size_type>(node.localIndex(std::declval<typename N::size_type>())),
63 requireConvertible<typename N::size_type>(node.treeIndex()),
64 requireBaseOf<BasisNodeMixin, N>()
71template<
class Gr
idView>
72struct LeafBasisNode : Refines<BasisNode>
75 auto require(
const N& node) ->
decltype(
76 requireType<typename N::Element>(),
77 requireType<typename N::FiniteElement>(),
78 requireConvertible<typename N::Element>(node.element()),
79 requireConvertible<const typename N::FiniteElement&>(node.finiteElement()),
80 requireSameType<typename N::Element, typename GridView::template Codim<0>::Entity>(),
81 requireBaseOf<Dune::Functions::LeafBasisNode, N>()
86template<
class Gr
idView>
90template<
class Gr
idView>
91struct PowerBasisNode : Refines<BasisNode>
94 auto require(
const N& node) ->
decltype(
95 requireBaseOf<Dune::Functions::PowerBasisNode<
typename N::ChildType, N::degree()>, N>(),
96 requireConcept<BasisTree<GridView>,
typename N::ChildType>()
101template<
class Gr
idView>
102struct DynamicPowerBasisNode : Refines<BasisNode>
105 auto require(
const N& node) ->
decltype(
106 requireBaseOf<Dune::Functions::DynamicPowerBasisNode<typename N::ChildType>, N>(),
107 requireConcept<BasisTree<GridView>,
typename N::ChildType>()
112template<
class Gr
idView>
113struct CompositeBasisNode : Refines<BasisNode>
116 auto require(
const N& node) ->
decltype(
117 requireBaseOf<ExpandTuple<Dune::Functions::template CompositeBasisNode, typename N::ChildTypes>, N>(),
118 requireConceptForTupleEntries<BasisTree<GridView>,
typename N::ChildTypes>()
124template<
class Gr
idView>
125struct BasisTree : Refines<BasisNode>
127 template<
class N,
class NodeTag =
typename N::NodeTag>
128 auto require(
const N& node) ->
decltype(
129 requireConcept<std::conditional_t<N::isLeaf, LeafBasisNode<GridView>, BasisNode>, N>(),
130 requireConcept<std::conditional_t<std::is_same_v<NodeTag, Dune::TypeTree::PowerNodeTag>,
131 PowerBasisNode<GridView>, BasisNode>, N>(),
132 requireConcept<std::conditional_t<std::is_same_v<NodeTag, Dune::TypeTree::DynamicPowerNodeTag>,
133 DynamicPowerBasisNode<GridView>, BasisNode>, N>(),
134 requireConcept<std::conditional_t<N::isComposite, CompositeBasisNode<GridView>, BasisNode>, N>()
140template<
class Gr
idView>
145 using MultiIndex = Dune::ReservedVector<typename PB::size_type, PB::multiIndexBufferSize>;
149 auto require(
const PB& preBasis) ->
decltype(
150 requireType<typename PB::GridView>(),
151 requireType<typename PB::size_type>(),
152 requireType<typename PB::Node>(),
153 requireConvertible<decltype(PB::maxMultiIndexSize), typename PB::size_type>(),
154 requireConvertible<decltype(PB::maxMultiIndexSize), typename PB::size_type>(),
155 requireConvertible<decltype(PB::multiIndexBufferSize), typename PB::size_type>(),
156 requireTrue<PB::minMultiIndexSize <= PB::maxMultiIndexSize>(),
157 requireTrue<PB::maxMultiIndexSize <= PB::multiIndexBufferSize>(),
158 requireSameType<typename PB::GridView, GridView>(),
159 const_cast<PB&
>(preBasis).initializeIndices(),
160 requireConvertible<typename PB::GridView>(preBasis.gridView()),
161 requireConvertible<typename PB::Node>(preBasis.makeNode()),
162 requireConvertible<typename PB::size_type>(preBasis.size()),
163 requireConvertible<typename PB::size_type>(preBasis.size(std::declval<MultiIndex<PB>>())),
164 requireConvertible<typename PB::size_type>(preBasis.dimension()),
165 requireConvertible<typename PB::size_type>(preBasis.maxNodeSize()),
166 requireSameType<decltype(const_cast<PB&>(preBasis).update(preBasis.gridView())),
void>(),
167 requireConcept<BasisTree<typename PB::GridView>>(preBasis.makeNode()),
168 requireConvertible<
typename std::vector<MultiIndex<PB>>::iterator>(
171 std::declval<typename std::vector<MultiIndex<PB>>::iterator>()))
178template<
class GlobalBasis>
182 auto require(
const V& localView) ->
decltype(
183 requireType<typename V::size_type>(),
184 requireType<typename V::MultiIndex>(),
185 requireType<typename V::GlobalBasis>(),
186 requireType<typename V::Tree>(),
187 requireType<typename V::GridView>(),
188 requireType<typename V::Element>(),
189 requireSameType<typename V::GlobalBasis, GlobalBasis>(),
190 requireSameType<typename V::GridView, typename GlobalBasis::GridView>(),
191 requireSameType<typename V::size_type, typename GlobalBasis::size_type>(),
192 requireSameType<typename V::Element, typename GlobalBasis::GridView::template Codim<0>::Entity>(),
193 const_cast<V&
>(localView).bind(std::declval<typename V::Element>()),
194 const_cast<V&
>(localView).unbind(),
195 requireConvertible<bool>(localView.bound()),
196 requireConvertible<typename V::Tree>(localView.tree()),
197 requireConvertible<typename V::size_type>(localView.size()),
198 requireConvertible<typename V::MultiIndex>(localView.index(std::declval<typename V::size_type>())),
199 requireConvertible<typename V::size_type>(localView.maxSize()),
200 requireConvertible<typename V::GlobalBasis>(localView.globalBasis()),
201 requireConcept<BasisTree<typename V::GridView>>(localView.tree()),
209template<
class Gr
idView>
213 auto require(
const B& basis) ->
decltype(
214 requireType<typename B::GridView>(),
215 requireType<typename B::size_type>(),
216 requireType<typename B::MultiIndex>(),
217 requireType<typename B::SizePrefix>(),
218 requireType<typename B::LocalView>(),
219 requireSameType<typename B::GridView, GridView>(),
220 requireConvertible<typename B::GridView>(basis.gridView()),
221 requireConvertible<typename B::LocalView>(basis.localView()),
222 requireConvertible<typename B::size_type>(basis.size()),
223 requireConvertible<typename B::size_type>(basis.size(std::declval<typename B::SizePrefix>())),
224 requireConvertible<typename B::size_type>(basis.dimension()),
225 requireSameType<decltype(const_cast<B&>(basis).update(basis.gridView())),
void>(),
226 requireConcept<LocalView<B>>(basis.localView())
Definition: polynomial.hh:17