3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
10#include <dune/functions/common/utility.hh>
12#include <dune/functions/functionspacebases/nodes.hh>
25 auto require(C&& c) ->
decltype(
35 auto require(C&& c) ->
decltype(
44 template<
class C,
class I>
45 auto require(C&& c, I&& i) ->
decltype(
55 auto require(
const N& node) ->
decltype(
56 requireType<typename N::size_type>(),
57 requireConvertible<typename N::size_type>(node.size()),
58 requireConvertible<typename N::size_type>(node.localIndex(std::declval<typename N::size_type>())),
59 requireConvertible<typename N::size_type>(node.treeIndex()),
60 requireBaseOf<BasisNodeMixin, N>()
67template<
class Gr
idView>
68struct LeafBasisNode :
Refines<BasisNode>
71 auto require(
const N& node) ->
decltype(
72 requireType<typename N::Element>(),
73 requireType<typename N::FiniteElement>(),
74 requireConvertible<typename N::Element>(node.element()),
75 requireConvertible<const typename N::FiniteElement&>(node.finiteElement()),
76 requireSameType<typename N::Element, typename GridView::template Codim<0>::Entity>(),
77 requireBaseOf<Dune::Functions::LeafBasisNode, N>()
82template<
class Gr
idView>
86template<
class Gr
idView>
87struct PowerBasisNode :
Refines<BasisNode>
90 auto require(
const N& node) ->
decltype(
91 requireBaseOf<Dune::Functions::PowerBasisNode<
typename N::ChildType,
N::degree()>, N>(),
92 requireConcept<BasisTree<GridView>,
typename N::ChildType>()
98template<
class Gr
idView>
99struct CompositeBasisNode :
Refines<BasisNode>
102 auto require(
const N& node) ->
decltype(
103 requireBaseOf<ExpandTuple<Dune::Functions::template CompositeBasisNode, typename N::ChildTypes>, N>(),
104 requireConceptForTupleEntries<BasisTree<GridView>,
typename N::ChildTypes>()
110template<
class Gr
idView>
111struct BasisTree :
Refines<BasisNode>
114 auto require(
const N& node) ->
decltype(
115 requireConcept<typename std::conditional< N::isLeaf, LeafBasisNode<GridView>, BasisNode>::type, N>(),
116 requireConcept<
typename std::conditional< N::isPower, PowerBasisNode<GridView>, BasisNode>::type, N>(),
117 requireConcept<typename std::conditional< N::isComposite, CompositeBasisNode<GridView>, BasisNode>::type, N>()
123template<
class Gr
idView>
132 auto require(
const PB& preBasis) ->
decltype(
133 requireType<typename PB::GridView>(),
134 requireType<typename PB::size_type>(),
135 requireType<typename PB::Node>(),
136 requireConvertible<decltype(PB::maxMultiIndexSize), typename PB::size_type>(),
137 requireConvertible<decltype(PB::maxMultiIndexSize), typename PB::size_type>(),
138 requireConvertible<decltype(PB::multiIndexBufferSize), typename PB::size_type>(),
139 requireTrue<PB::minMultiIndexSize <= PB::maxMultiIndexSize>(),
140 requireTrue<PB::maxMultiIndexSize <= PB::multiIndexBufferSize>(),
141 requireSameType<typename PB::GridView, GridView>(),
142 const_cast<PB&
>(preBasis).initializeIndices(),
143 requireConvertible<typename PB::GridView>(preBasis.gridView()),
144 requireConvertible<typename PB::Node>(preBasis.makeNode()),
145 requireConvertible<typename PB::size_type>(preBasis.size()),
146 requireConvertible<typename PB::size_type>(preBasis.size(std::declval<MultiIndex<PB>>())),
147 requireConvertible<typename PB::size_type>(preBasis.dimension()),
148 requireConvertible<typename PB::size_type>(preBasis.maxNodeSize()),
149 requireSameType<decltype(const_cast<PB&>(preBasis).update(preBasis.gridView())),
void>(),
150 requireConcept<BasisTree<typename PB::GridView>>(preBasis.makeNode()),
151 requireConvertible<
typename std::vector<MultiIndex<PB>>::iterator>(
154 std::declval<typename std::vector<MultiIndex<PB>>::iterator>()))
161template<
class GlobalBasis>
165 auto require(
const V& localView) ->
decltype(
166 requireType<typename V::size_type>(),
167 requireType<typename V::MultiIndex>(),
168 requireType<typename V::GlobalBasis>(),
169 requireType<typename V::Tree>(),
170 requireType<typename V::GridView>(),
171 requireType<typename V::Element>(),
172 requireSameType<typename V::GlobalBasis, GlobalBasis>(),
173 requireSameType<typename V::GridView, typename GlobalBasis::GridView>(),
174 requireSameType<typename V::size_type, typename GlobalBasis::size_type>(),
175 requireSameType<typename V::Element, typename GlobalBasis::GridView::template Codim<0>::Entity>(),
176 const_cast<V&
>(localView).bind(std::declval<typename V::Element>()),
177 const_cast<V&
>(localView).unbind(),
178 requireConvertible<bool>(localView.bound()),
179 requireConvertible<typename V::Tree>(localView.tree()),
180 requireConvertible<typename V::size_type>(localView.size()),
181 requireConvertible<typename V::MultiIndex>(localView.index(std::declval<typename V::size_type>())),
182 requireConvertible<typename V::size_type>(localView.maxSize()),
183 requireConvertible<typename V::GlobalBasis>(localView.globalBasis()),
184 requireConcept<BasisTree<typename V::GridView>>(localView.tree()),
192template<
class Gr
idView>
196 auto require(
const B& basis) ->
decltype(
197 requireType<typename B::GridView>(),
198 requireType<typename B::size_type>(),
199 requireType<typename B::MultiIndex>(),
200 requireType<typename B::SizePrefix>(),
201 requireType<typename B::LocalView>(),
202 requireSameType<typename B::GridView, GridView>(),
203 requireConvertible<typename B::GridView>(basis.gridView()),
204 requireConvertible<typename B::LocalView>(basis.localView()),
205 requireConvertible<typename B::size_type>(basis.size()),
206 requireConvertible<typename B::size_type>(basis.size(std::declval<typename B::SizePrefix>())),
207 requireConvertible<typename B::size_type>(basis.dimension()),
208 requireSameType<decltype(const_cast<B&>(basis).update(basis.gridView())),
void>(),
209 requireConcept<LocalView<B>>(basis.localView())
A Vector class with statically reserved memory.
Definition: reservedvector.hh:47
Infrastructure for concepts.
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
Namespace for concepts.
Definition: concept.hh:34
Dune namespace.
Definition: alignedallocator.hh:13
An stl-compliant random-access container which stores everything on the stack.
Base class for refined concepts.
Definition: concept.hh:54