4 #ifndef DUNE_PDELAB_ORDERING_DECORATOR_HH 5 #define DUNE_PDELAB_ORDERING_DECORATOR_HH 9 #include <dune/typetree/typetree.hh> 26 template<
typename D,
typename U>
27 struct decorated_ordering_tag;
34 template<
typename DecoratedOrderingTag, std::
size_t level>
35 struct basetag_access_provider
40 template<
typename D,
typename U>
41 struct basetag_access_provider<decorated_ordering_tag<D,U>,0>
46 const BaseTag& baseTag()
const 48 return static_cast<decorated_ordering_tag<D,U>&
>(*this);
53 return static_cast<decorated_ordering_tag<D,U>&
>(*this);
58 template<
typename T, T v>
61 typedef std::integral_constant<T,v> type;
67 typedef std::integral_constant<std::size_t,D::level> type;
71 struct decoration_level
72 :
public std::conditional<
73 std::is_base_of<is_decorated, D>::value,
75 lazy_constant<std::size_t,0>
83 template<
typename D,
typename U>
86 , impl::basetag_access_provider<decorated_ordering_tag<D,U>,impl::decoration_level<U>::value>
102 : Undecorated(
std::move(u))
113 template<
typename Ordering>
114 const Ordering& _unwind_decorators(
const Ordering& ordering, std::integral_constant<std::size_t,0>)
121 template<
typename Ordering, std::
size_t level>
122 auto _unwind_decorators(
const Ordering& ordering, std::integral_constant<std::size_t,level>)
125 ordering.template child<0>(),
126 std::integral_constant<std::size_t,level-1>()
130 return _unwind_decorators(
131 ordering.template child<0>(),
132 std::integral_constant<std::size_t,level-1>()
143 template<
typename GFS>
148 impl::decoration_level<typename GFS::OrderingTag>()
152 return _unwind_decorators(
154 impl::decoration_level<typename GFS::OrderingTag>()
159 template<
typename GFS,
typename Transformation,
typename Undecorated,
typename GlueTag,
typename Tag>
161 :
public TypeTree::meta_function
165 TypeTree::declptr<GFS>(),
166 TypeTree::declptr<Transformation>(),
167 TypeTree::declptr<Undecorated>(),
168 TypeTree::declptr<GlueTag>(),
169 TypeTree::declptr<Tag>()
175 template<typename GFS, typename Transformation, typename OrderingTag>
179 static const bool recursive =
false;
181 typedef typename leaf_gfs_to_ordering_descriptor<
184 typename OrderingTag::Undecorated
194 typename OrderingTag::Decorator
200 static transformed_type
transform(
const GFS& gfs,
const Transformation& t)
202 return decorator_descriptor::transform(gfs,t,std::make_shared<undecorated_type>(undecorated_descriptor::transform(gfs,t)));
205 static transformed_storage_type
transform(std::shared_ptr<const GFS>& gfs_pointer,
const Transformation& t)
207 return decorator_descriptor::transform(gfs_pointer,t,undecorated_descriptor::transform(gfs_pointer,t));
212 template<
typename GFS,
typename Transformation,
typename D,
typename U>
217 template<
typename GFS,
typename Transformation,
typename OrderingTag>
221 static const bool recursive =
true;
223 template<
typename TC>
227 typedef typename power_gfs_to_ordering_descriptor<
230 typename OrderingTag::Undecorated
239 typename OrderingTag::Decorator
242 typedef typename decorator_descriptor::transformed_type
type;
243 typedef typename decorator_descriptor::transformed_storage_type
storage_type;
247 template<
typename TC>
253 template<
typename TC>
262 template<
typename GFS,
typename Transformation,
typename OrderingTag>
266 static const bool recursive =
false;
268 typedef typename power_gfs_to_ordering_descriptor<
271 typename OrderingTag::Undecorated
281 typename OrderingTag::Decorator
287 static transformed_type
transform(
const GFS& gfs,
const Transformation& t)
289 return decorator_descriptor::transform(gfs,t,std::make_shared<undecorated_type>(undecorated_descriptor::transform(gfs,t)));
292 static transformed_storage_type
transform_storage(std::shared_ptr<const GFS>& gfs_pointer,
const Transformation& t)
294 return decorator_descriptor::transform_storage(gfs_pointer,t,undecorated_descriptor::transform_storage(gfs_pointer,t));
300 template<
typename GFS,
typename Transformation,
typename OrderingTag>
302 :
public std::conditional<
303 power_gfs_to_ordering_descriptor<
306 typename OrderingTag::Undecorated
308 recursive_power_gfs_to_decorated<
313 nonrecursive_power_gfs_to_decorated<
320 template<
typename GFS,
typename Transformation,
typename D,
typename U>
333 template<
typename GFS,
typename Transformation,
typename OrderingTag>
337 static const bool recursive =
true;
339 template<
typename... TC>
343 typedef typename composite_gfs_to_ordering_descriptor<
346 typename OrderingTag::Undecorated
355 typename OrderingTag::Decorator
358 typedef typename decorator_descriptor::transformed_type
type;
359 typedef typename decorator_descriptor::transformed_storage_type
storage_type;
363 template<
typename... TC>
364 static typename result<TC...>::type
transform(
const GFS& gfs,
const Transformation& t, std::shared_ptr<TC>... children)
369 template<
typename... TC>
370 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const GFS> gfs_pointer,
const Transformation& t, std::shared_ptr<TC>... children)
378 template<
typename GFS,
typename Transformation,
typename OrderingTag>
382 static const bool recursive =
false;
384 typedef typename composite_gfs_to_ordering_descriptor<
387 typename OrderingTag::Undecorated
397 typename OrderingTag::Decorator
403 static transformed_type
transform(
const GFS& gfs,
const Transformation& t)
405 return decorator_descriptor::transform(gfs,t,std::make_shared<undecorated_type>(undecorated_descriptor::transform(gfs,t)));
408 static transformed_storage_type
transform_storage(std::shared_ptr<const GFS>& gfs_pointer,
const Transformation& t)
410 return decorator_descriptor::transform_storage(gfs_pointer,t,undecorated_descriptor::transform(gfs_pointer,t));
416 template<
typename GFS,
typename Transformation,
typename OrderingTag>
418 :
public std::conditional<
419 composite_gfs_to_ordering_descriptor<
422 typename OrderingTag::Undecorated
424 recursive_composite_gfs_to_decorated<
429 nonrecursive_composite_gfs_to_decorated<
437 template<
typename GFS,
typename Transformation,
typename D,
typename U>
448 #endif // DUNE_PDELAB_ORDERING_DECORATOR_HH Definition: decorator.hh:334
Definition: decorator.hh:224
decorated_ordering_tag(const Undecorated &u)
Definition: decorator.hh:97
decorator_descriptor::transformed_type transformed_type
Definition: decorator.hh:197
gfs_to_decorator_descriptor< GFS, Transformation, undecorated_type, OrderingTag, typename OrderingTag::Decorator >::type decorator_descriptor
Definition: decorator.hh:195
Definition: decorator.hh:379
decorator_descriptor::transformed_type type
Definition: decorator.hh:358
decorator_descriptor::transformed_storage_type transformed_storage_type
Definition: decorator.hh:198
U Undecorated
Definition: decorator.hh:90
static result< TC... >::type transform(const GFS &gfs, const Transformation &t, std::shared_ptr< TC >... children)
Definition: decorator.hh:364
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
auto undecorated_ordering(const GFS &gfs) -> decltype(_unwind_decorators(gfs.ordering(), impl::decoration_level< typename GFS::OrderingTag >()))
Unwinds the stack of decorators on top of the base ordering of gfs and returns the base ordering...
Definition: decorator.hh:144
gfs_to_decorator_descriptor< GFS, Transformation, undecorated_type, OrderingTag, typename OrderingTag::Decorator >::type decorator_descriptor
Definition: decorator.hh:356
static transformed_storage_type transform_storage(std::shared_ptr< const GFS > &gfs_pointer, const Transformation &t)
Definition: decorator.hh:408
decorator_descriptor::transformed_storage_type transformed_storage_type
Definition: decorator.hh:401
leaf_gfs_to_decorated< GFS, Transformation, decorated_ordering_tag< D, U > > register_leaf_gfs_to_ordering_descriptor(GFS *, Transformation *, decorated_ordering_tag< D, U > *)
composite_gfs_to_decorated< GFS, Transformation, decorated_ordering_tag< D, U > > register_composite_gfs_to_ordering_descriptor(GFS *, Transformation *, decorated_ordering_tag< D, U > *)
decorator_descriptor::transformed_type transformed_type
Definition: decorator.hh:284
gfs_to_chunked< GFS, Transformation, Undecorated, GlueTag > register_gfs_to_decorator_descriptor(GFS *, Transformation *, Undecorated *, GlueTag *, Chunked< UndecoratedTag > *)
static result< TC >::storage_type transform_storage(std::shared_ptr< const GFS > gfs_pointer, const Transformation &t, const std::array< std::shared_ptr< TC >, TypeTree::StaticDegree< GFS >::value > &children)
Definition: decorator.hh:254
Definition: decorator.hh:160
gfs_to_decorator_descriptor< GFS, Transformation, undecorated_type, OrderingTag, typename OrderingTag::Decorator >::type decorator_descriptor
Definition: decorator.hh:240
decorator_descriptor::transformed_storage_type storage_type
Definition: decorator.hh:243
gfs_to_decorator_descriptor< GFS, Transformation, undecorated_type, OrderingTag, typename OrderingTag::Decorator >::type decorator_descriptor
Definition: decorator.hh:282
decorated_ordering_tag()
Definition: decorator.hh:94
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
power_gfs_to_ordering_descriptor< GFS, Transformation, typename OrderingTag::Undecorated >::type undecorated_descriptor
Definition: decorator.hh:272
leaf_gfs_to_ordering_descriptor< GFS, Transformation, typename OrderingTag::Undecorated >::type undecorated_descriptor
Definition: decorator.hh:185
Definition: decorator.hh:301
undecorated_descriptor::transformed_type undecorated_type
Definition: decorator.hh:187
power_gfs_to_ordering_descriptor< GFS, Transformation, typename OrderingTag::Undecorated >::type undecorated_descriptor
Definition: decorator.hh:231
composite_gfs_to_ordering_descriptor< GFS, Transformation, typename OrderingTag::Undecorated >::type undecorated_descriptor
Definition: decorator.hh:347
Definition: decorator.hh:218
static transformed_storage_type transform_storage(std::shared_ptr< const GFS > &gfs_pointer, const Transformation &t)
Definition: decorator.hh:292
static result< TC >::type transform(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< TC >, TypeTree::StaticDegree< GFS >::value > &children)
Definition: decorator.hh:248
decorated_ordering_tag(Undecorated &&u)
Definition: decorator.hh:101
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: decorator.hh:287
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: decorator.hh:403
gfs_to_decorator_descriptor< GFS, Transformation, undecorated_type, OrderingTag, typename OrderingTag::Decorator >::type decorator_descriptor
Definition: decorator.hh:398
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: decorator.hh:200
Definition: decorator.hh:340
undecorated_descriptor::template result< TC... >::type undecorated_type
Definition: decorator.hh:349
Definition: decorator.hh:84
decorator_descriptor::transformed_storage_type storage_type
Definition: decorator.hh:359
composite_gfs_to_ordering_descriptor< GFS, Transformation, typename OrderingTag::Undecorated >::type undecorated_descriptor
Definition: decorator.hh:388
undecorated_descriptor::transformed_type undecorated_type
Definition: decorator.hh:274
static transformed_storage_type transform(std::shared_ptr< const GFS > &gfs_pointer, const Transformation &t)
Definition: decorator.hh:205
Definition: decorator.hh:263
Definition: decorator.hh:176
decorator_descriptor::transformed_type type
Definition: decorator.hh:242
static result< TC... >::storage_type transform_storage(std::shared_ptr< const GFS > gfs_pointer, const Transformation &t, std::shared_ptr< TC >... children)
Definition: decorator.hh:370
decorator_descriptor::transformed_type transformed_type
Definition: decorator.hh:400
decorator_descriptor::transformed_storage_type transformed_storage_type
Definition: decorator.hh:285
power_gfs_to_decorated< GFS, Transformation, decorated_ordering_tag< D, U > > register_power_gfs_to_ordering_descriptor(GFS *, Transformation *, decorated_ordering_tag< D, U > *)
undecorated_descriptor::template result< TC >::type undecorated_type
Definition: decorator.hh:233
Definition: decorator.hh:417
D Decorator
Definition: decorator.hh:89
undecorated_descriptor::transformed_type undecorated_type
Definition: decorator.hh:390