Go to the documentation of this file.
4 #ifndef DUNE_PDELAB_ORDERING_LEXICOGRAPHICORDERING_HH
5 #define DUNE_PDELAB_ORDERING_LEXICOGRAPHICORDERING_HH
11 #include <dune/common/classname.hh>
12 #include <dune/common/exceptions.hh>
13 #include <dune/common/stdstreams.hh>
15 #include <dune/typetree/compositenode.hh>
16 #include <dune/typetree/powernode.hh>
17 #include <dune/typetree/traversal.hh>
18 #include <dune/typetree/visitor.hh>
30 namespace lexicographic_ordering {
32 template<
typename DI,
typename CI,
typename Node>
54 :
BaseT(node,container_blocked,gfs_data,nullptr)
58 template<
typename ItIn,
typename ItOut>
63 for (ItIn in = begin; in != end; ++in, ++out)
64 out->push_back(in->treeIndex().back());
68 for (ItIn in = begin; in != end; ++in, ++out)
69 out->back() += (this->
blockOffset(in->treeIndex().back()));
73 template<
typename CIOutIterator,
typename DIOutIterator = DummyDOFIndexIterator>
77 CIOutIterator ci_out,
const CIOutIterator ci_end)
const
81 for (; ci_out != ci_end; ++ci_out)
83 ci_out->push_back(child_index);
88 for (; ci_out != ci_end; ++ci_out)
103 template<
typename DI,
typename CI,
typename Child, std::
size_t k>
105 :
public TypeTree::PowerNode<Child, k>
108 PowerLexicographicOrdering<DI,CI,Child,k>
111 typedef TypeTree::PowerNode<Child, k> Node;
131 ,
Base(*this,container_blocked,gfs_data)
136 for (std::size_t i = 0; i < k; ++i)
138 this->child(i).update();
143 std::string
name()
const {
return "PowerLexicographicOrdering"; }
147 template<
typename GFS,
typename Transformation>
153 template<
typename TC>
158 typename Transformation::DOFIndex,
159 typename Transformation::ContainerIndex,
168 template<
typename TC>
171 return typename result<TC>::type(gfs.backend().blocked(gfs),children,
const_cast<GFS*
>(&gfs));
174 template<
typename TC>
177 return std::make_shared<typename result<TC>::type>(gfs->backend().blocked(*gfs),children,
const_cast<GFS*
>(gfs.get()));
182 template<
typename GFS,
typename Transformation>
183 power_gfs_to_lexicographic_ordering_descriptor<GFS,Transformation>
190 template<
typename DI,
typename CI,
typename... Children>
192 public TypeTree::CompositeNode<Children...>,
195 CompositeLexicographicOrdering<
202 typedef TypeTree::CompositeNode<Children...> Node;
226 ,
Base(*this,backend_blocked,gfs_data)
229 std::string
name()
const {
return "CompositeLexicographicOrdering"; }
233 TypeTree::applyToTree(*
this,ordering::update_direct_children());
238 template<
typename GFS,
typename Transformation>
244 template<
typename... TC>
249 typename Transformation::DOFIndex,
250 typename Transformation::ContainerIndex,
258 template<
typename... TC>
259 static typename result<TC...>::type
transform(
const GFS& gfs,
const Transformation& t, std::shared_ptr<TC>... children)
261 return typename result<TC...>::type(gfs.backend().blocked(gfs),
const_cast<GFS*
>(&gfs),children...);
264 template<
typename... TC>
265 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const GFS> gfs,
const Transformation& t, std::shared_ptr<TC>... children)
267 return std::make_shared<
typename result<TC...>::type>(gfs->backend().blocked(*gfs),
const_cast<GFS*
>(gfs.get()),children...);
273 template<
typename GFS,
typename Transformation>
274 composite_gfs_to_lexicographic_ordering_descriptor<GFS,Transformation>
281 #endif // DUNE_PDELAB_ORDERING_LEXICOGRAPHICORDERING_HH
Definition: lexicographicordering.hh:104
std::string name() const
Definition: lexicographicordering.hh:143
composite_gfs_to_entityblocked_ordering_descriptor< GFS, Transformation > register_composite_gfs_to_ordering_descriptor(GFS *, Transformation *, EntityBlockedOrderingTag *)
void update()
Definition: lexicographicordering.hh:134
PowerLexicographicOrdering(bool container_blocked, const typename Node::NodeStorage &children, typename Base::GFSData *gfs_data)
Construct ordering object.
Definition: lexicographicordering.hh:129
static result< TC >::type transform(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< TC >, TypeTree::StaticDegree< GFS >::value > &children)
Definition: lexicographicordering.hh:169
Indicate lexicographic ordering of the unknowns of non-leaf grid function spaces.
Definition: gridfunctionspace/tags.hh:63
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: lexicographicordering.hh:59
power_gfs_to_entityblocked_ordering_descriptor< GFS, Transformation > register_power_gfs_to_ordering_descriptor(GFS *, Transformation *, EntityBlockedOrderingTag *)
Definition: orderingbase.hh:20
std::string name() const
Definition: lexicographicordering.hh:229
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
void update()
Definition: lexicographicordering.hh:231
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: lexicographicordering.hh:175
Traits::SizeType blockOffset(const typename Traits::SizeType child_index) const
Definition: orderingbase.hh:81
Definition: lexicographicordering.hh:154
LexicographicOrderingTag OrderingTag
Definition: lexicographicordering.hh:43
Traits::SizeType extract_entity_indices(const typename Traits::DOFIndex::EntityIndex &ei, typename Traits::SizeType child_index, CIOutIterator ci_out, const CIOutIterator ci_end) const
Definition: lexicographicordering.hh:75
static result< TC... >::storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< TC >... children)
Definition: lexicographicordering.hh:265
Definition: lexicographicordering.hh:239
static const bool recursive
Definition: lexicographicordering.hh:242
Dune::PDELab::impl::GridFunctionSpaceOrderingData< typename Traits::SizeType > GFSData
Definition: orderingbase.hh:32
std::shared_ptr< type > storage_type
Definition: lexicographicordering.hh:164
static const bool recursive
Definition: lexicographicordering.hh:151
static result< TC... >::type transform(const GFS &gfs, const Transformation &t, std::shared_ptr< TC >... children)
Definition: lexicographicordering.hh:259
PowerLexicographicOrdering< typename Transformation::DOFIndex, typename Transformation::ContainerIndex, TC, TypeTree::StaticDegree< GFS >::value > type
Definition: lexicographicordering.hh:162
DI::size_type SizeType
Definition: ordering/utility.hh:201
Definition: lexicographicordering.hh:33
std::shared_ptr< type > storage_type
Definition: lexicographicordering.hh:254
void update()
Definition: orderingbase.hh:97
Base(Node &node, bool container_blocked, typename BaseT::GFSData *gfs_data)
Construct ordering object.
Definition: lexicographicordering.hh:53
CompositeLexicographicOrdering< typename Transformation::DOFIndex, typename Transformation::ContainerIndex, TC... > type
Definition: lexicographicordering.hh:252
Definition: ordering/utility.hh:186
CompositeLexicographicOrdering(bool backend_blocked, typename Base::GFSData *gfs_data, std::shared_ptr< Children >... children)
Construct ordering object.
Definition: lexicographicordering.hh:224
Interface for merging index spaces.
Definition: lexicographicordering.hh:191
static const bool consume_tree_index
Definition: lexicographicordering.hh:45
const bool _container_blocked
Definition: orderingbase.hh:275
Definition: lexicographicordering.hh:148
Definition: lexicographicordering.hh:245
OrderingBase< DI, CI >::Traits Traits
Definition: lexicographicordering.hh:41