4#ifndef DUNE_PDELAB_ORDERING_ENTITYBLOCKEDLOCALORDERING_HH
5#define DUNE_PDELAB_ORDERING_ENTITYBLOCKEDLOCALORDERING_HH
11#include <dune/common/classname.hh>
12#include <dune/common/exceptions.hh>
13#include <dune/common/stdstreams.hh>
14#include <dune/common/typetraits.hh>
15#include <dune/common/deprecated.hh>
16#include <dune/common/hybridutilities.hh>
18#include <dune/typetree/compositenode.hh>
19#include <dune/typetree/powernode.hh>
20#include <dune/typetree/traversal.hh>
21#include <dune/typetree/visitor.hh>
22#include <dune/typetree/typetraits.hh>
32 template<
typename ChildOrdering, std::
size_t k>
34 :
public TypeTree::PowerNode<ChildOrdering,k>
36 typename ChildOrdering::Traits::DOFIndex,
37 typename ChildOrdering::Traits::ContainerIndex>
40 typedef TypeTree::PowerNode<ChildOrdering,k> NodeT;
42 typename ChildOrdering::Traits::DOFIndex,
43 typename ChildOrdering::Traits::ContainerIndex>
BaseT;
52 : NodeT(child_storage)
53 ,
BaseT(*this,container_blocked,nullptr)
66 const typename Traits::DOFIndex::EntityIndex &
index)
const {
72 template<
typename GFS,
typename Transformation>
76 static const bool recursive =
true;
86 static typename result<TC>::type transform(
const GFS& gfs,
const Transformation& t,
const std::array<std::shared_ptr<TC>,TypeTree::StaticDegree<GFS>::value>& children)
94 return std::make_shared<typename result<TC>::type>(children,gfs->backend().blocked(*gfs));
101 template<
typename GFS,
typename Transformation>
119 auto es_visitor = impl::common_entity_set<EntitySet>{};
120 TypeTree::applyToTree(gfs, es_visitor);
121 assert(es_visitor._entity_set);
122 auto& es = *es_visitor._entity_set;
124 auto local_ordering = std::make_shared<LocalOrdering>(LocalOrderingTransformation::transform(gfs,gfs_to_local_ordering<Transformation>()));
125 bool blocked = gfs.backend().blocked(gfs);
127 transformed_type r(make_tuple(std::move(local_ordering)),blocked,
const_cast<GFS*
>(&gfs),es);
134 auto es_visitor = impl::common_entity_set<EntitySet>{};
135 TypeTree::applyToTree(*gfs, es_visitor);
136 assert(es_visitor._entity_set);
137 auto& es = *es_visitor._entity_set;
139 auto local_ordering = LocalOrderingTransformation::transform_storage(gfs,gfs_to_local_ordering<Transformation>());
140 bool blocked = gfs->backend().blocked(*gfs);
142 transformed_storage_type r(std::make_shared<transformed_type>(make_tuple(std::move(local_ordering)),blocked,
const_cast<GFS*
>(gfs.get()),es));
148 template<
typename GFS,
typename Transformation>
149 power_gfs_to_entityblocked_ordering_descriptor<GFS,Transformation>
154 template<
typename... Children>
156 :
public TypeTree::CompositeNode<Children...>
157 ,
public LocalOrderingBase<typename first_type<Children...>::type::Traits::EntitySet,
158 typename first_type<Children...>::type::Traits::DOFIndex,
159 typename first_type<Children...>::type::Traits::ContainerIndex>
162 typedef TypeTree::CompositeNode<Children...> Node;
163 typedef LocalOrderingBase<
typename first_type<Children...>::type::Traits::EntitySet,
164 typename first_type<Children...>::type::Traits::DOFIndex,
165 typename first_type<Children...>::type::Traits::ContainerIndex>
Base;
175 ,
Base(*this,container_blocked,nullptr)
191 const typename Traits::DOFIndex::EntityIndex &
index)
const {
198 template<
typename GFS,
typename Transformation>
202 static const bool recursive =
true;
204 template<
typename... TC>
211 template<
typename... TC>
212 static typename result<TC...>::type
transform(
const GFS& gfs,
const Transformation& t, std::shared_ptr<TC>... children)
217 template<
typename... TC>
218 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const GFS> gfs,
const Transformation& t, std::shared_ptr<TC>... children)
220 return std::make_shared<
typename result<TC...>::type>(gfs->backend().blocked(*gfs),children...);
225 template<
typename GFS,
typename Transformation>
242 auto es_visitor = impl::common_entity_set<EntitySet>{};
243 TypeTree::applyToTree(gfs, es_visitor);
244 assert(es_visitor._entity_set);
245 auto& es = *es_visitor._entity_set;
246 bool blocked = gfs.backend().blocked(gfs);
248 auto local_ordering = std::make_shared<LocalOrdering>(LocalOrderingTransformation::transform(gfs,gfs_to_local_ordering<Transformation>()));
250 transformed_type r(make_tuple(std::move(local_ordering)),blocked,
const_cast<GFS*
>(&gfs),es);
257 auto es_visitor = impl::common_entity_set<EntitySet>{};
258 TypeTree::applyToTree(*gfs, es_visitor);
259 assert(es_visitor._entity_set);
260 auto& es = *es_visitor._entity_set;
261 bool blocked = gfs->backend().blocked(*gfs);
263 auto local_ordering = make_tuple(LocalOrderingTransformation::transform_storage(gfs,gfs_to_local_ordering<Transformation>()));
265 transformed_storage_type r(std::make_shared<transformed_type>(std::move(local_ordering),blocked,
const_cast<GFS*
>(gfs.get()),es));
271 template<
typename GFS,
typename Transformation>
272 composite_gfs_to_entityblocked_ordering_descriptor<GFS,Transformation>
std::size_t index
Definition: interpolate.hh:97
composite_gfs_to_entityblocked_ordering_descriptor< GFS, Transformation > register_composite_gfs_to_ordering_descriptor(GFS *, Transformation *, EntityBlockedOrderingTag *)
power_gfs_to_entityblocked_ordering_descriptor< GFS, Transformation > register_power_gfs_to_ordering_descriptor(GFS *, Transformation *, EntityBlockedOrderingTag *)
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Indicate blocking of the unknowns by grid entity.
Definition: gridfunctionspace/tags.hh:53
Definition: entityblockedlocalordering.hh:38
BaseT::Traits Traits
Definition: entityblockedlocalordering.hh:49
static const bool consume_tree_index
Definition: entityblockedlocalordering.hh:47
PowerEntityBlockedLocalOrdering(const typename NodeT::NodeStorage &child_storage, bool container_blocked)
Definition: entityblockedlocalordering.hh:51
Traits::SizeType size(const typename Traits::ContainerIndex &suffix, const typename Traits::DOFIndex::EntityIndex &index) const
Returns the size for a given suffix.
Definition: entityblockedlocalordering.hh:65
static result< TC >::type transform(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< TC >, TypeTree::StaticDegree< GFS >::value > &children)
Definition: entityblockedlocalordering.hh:86
static result< TC >::storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t, const std::array< std::shared_ptr< TC >, TypeTree::StaticDegree< GFS >::value > &children)
Definition: entityblockedlocalordering.hh:92
PowerEntityBlockedLocalOrdering< TC, TypeTree::StaticDegree< GFS >::value > type
Definition: entityblockedlocalordering.hh:81
std::shared_ptr< type > storage_type
Definition: entityblockedlocalordering.hh:82
Definition: entityblockedlocalordering.hh:103
GridViewOrdering< LocalOrdering > transformed_type
Definition: entityblockedlocalordering.hh:110
static transformed_storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t)
Definition: entityblockedlocalordering.hh:131
TypeTree::TransformTree< GFS, gfs_to_local_ordering< Transformation > > LocalOrderingTransformation
Definition: entityblockedlocalordering.hh:107
LocalOrderingTransformation::Type LocalOrdering
Definition: entityblockedlocalordering.hh:108
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: entityblockedlocalordering.hh:116
std::shared_ptr< transformed_type > transformed_storage_type
Definition: entityblockedlocalordering.hh:112
typename GFS::Traits::EntitySet EntitySet
Definition: entityblockedlocalordering.hh:114
static const bool recursive
Definition: entityblockedlocalordering.hh:105
Definition: entityblockedlocalordering.hh:160
Traits::SizeType size(const typename Traits::ContainerIndex &suffix, const typename Traits::DOFIndex::EntityIndex &index) const
Returns the size for a given suffix.
Definition: entityblockedlocalordering.hh:190
static const bool consume_tree_index
Definition: entityblockedlocalordering.hh:171
CompositeEntityBlockedLocalOrdering(bool container_blocked, std::shared_ptr< Children >... children)
Definition: entityblockedlocalordering.hh:173
Base::Traits Traits
Definition: entityblockedlocalordering.hh:169
static result< TC... >::type transform(const GFS &gfs, const Transformation &t, std::shared_ptr< TC >... children)
Definition: entityblockedlocalordering.hh:212
static result< TC... >::storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< TC >... children)
Definition: entityblockedlocalordering.hh:218
std::shared_ptr< type > storage_type
Definition: entityblockedlocalordering.hh:208
CompositeEntityBlockedLocalOrdering< TC... > type
Definition: entityblockedlocalordering.hh:207
Definition: entityblockedlocalordering.hh:227
GridViewOrdering< LocalOrdering > transformed_type
Definition: entityblockedlocalordering.hh:233
typename GFS::Traits::EntitySet EntitySet
Definition: entityblockedlocalordering.hh:237
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: entityblockedlocalordering.hh:239
TypeTree::TransformTree< GFS, gfs_to_local_ordering< Transformation > > LocalOrderingTransformation
Definition: entityblockedlocalordering.hh:230
static transformed_storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t)
Definition: entityblockedlocalordering.hh:254
static const bool recursive
Definition: entityblockedlocalordering.hh:228
LocalOrderingTransformation::Type LocalOrdering
Definition: entityblockedlocalordering.hh:231
std::shared_ptr< transformed_type > transformed_storage_type
Definition: entityblockedlocalordering.hh:235
Transforms a local ordering (entity-wise order) into a global ordering.
Definition: gridviewordering.hh:440
Entity-wise orderings.
Definition: localorderingbase.hh:30
Traits::SizeType node_size(const Node &node, typename Traits::ContainerIndex suffix, const typename Traits::DOFIndex::EntityIndex &index) const
Gives the size for a given entity and suffix.
Definition: localorderingbase.hh:287
Traits::SizeType size(const typename Traits::DOFIndex::EntityIndex &index) const
Definition: localorderingbase.hh:229
std::size_t SizeType
Definition: ordering/utility.hh:178
CI ContainerIndex
Definition: ordering/utility.hh:176
Definition: ordering/utility.hh:224