4 #ifndef DUNE_PDELAB_ORDERING_PERMUTATIONORDERING_HH 5 #define DUNE_PDELAB_ORDERING_PERMUTATIONORDERING_HH 7 #warning "The file dune/pdelab/ordering/permutationordering.hh and the contained variants of PermutationOrdering are deprecated and will be removed after PDELab 2.4. Please use the Permuted<> decorator from dune/pdelab/ordering/permutedordering.hh instead." 13 #include <dune/common/classname.hh> 14 #include <dune/common/exceptions.hh> 15 #include <dune/common/stdstreams.hh> 17 #include <dune/typetree/compositenode.hh> 18 #include <dune/typetree/powernode.hh> 19 #include <dune/typetree/traversal.hh> 20 #include <dune/typetree/visitor.hh> 33 namespace permutation_ordering {
36 template<
typename DI,
typename CI,
typename Node>
58 Base(Node& node,
bool container_blocked,
const OrderingTag& ordering_tag)
59 : BaseT(node,container_blocked),
60 _perm(ordering_tag.permutation())
78 : BaseT(
std::move(other)),
79 _perm(
std::move(other._perm))
86 template<
typename ItIn,
typename ItOut>
92 for (ItIn in = begin; in != end; ++in, ++out)
93 out->back() = _perm[out->back()];
96 template<
typename CIOutIterator,
typename DIOutIterator = DummyDOFIndexIterator>
100 CIOutIterator ci_out,
const CIOutIterator ci_end)
const 105 for (; ci_out != ci_end; ++ci_out)
107 ci_out->back() = _perm[ci_out->back()];
119 ci.back() = _perm[ci.back()];
123 const std::vector<std::size_t>& _perm;
129 template<
typename DI,
typename CI,
typename Child, std::
size_t k>
131 :
public TypeTree::PowerNode<Child, k>
134 PowerLexicographicOrdering<DI,CI,Child,k>
137 typedef TypeTree::PowerNode<Child, k> Node;
157 , Base(*this,container_blocked,ordering_tag)
162 for (std::size_t i = 0; i < Node::CHILDREN; ++i)
164 this->child(i).update();
169 std::string
name()
const {
return "PowerPermutationOrdering"; }
173 template<
typename GFS,
typename Transformation>
177 static const bool recursive =
true;
179 template<
typename TC>
184 typename Transformation::DOFIndex,
185 typename Transformation::ContainerIndex,
194 template<
typename TC>
195 static typename result<TC>::type transform(
const GFS& gfs,
const Transformation& t,
const array<std::shared_ptr<TC>,GFS::CHILDREN>& children)
197 return typename result<TC>::type(gfs.backend().blocked(gfs),gfs->orderingTag(),children);
200 template<
typename TC>
203 return std::make_shared<typename result<TC>::type>(gfs->backend().blocked(*gfs),gfs->orderingTag(),children);
212 template<
typename DI,
typename CI,
typename... Children>
214 public TypeTree::CompositeNode<Children...>,
217 CompositePermutationOrdering<
224 typedef TypeTree::CompositeNode<Children...> Node;
247 std::shared_ptr<Children>... children)
249 ,
Base(*this,backend_blocked,ordering_tag)
252 std::string
name()
const {
return "CompositePermutationOrdering"; }
256 TypeTree::applyToTree(*
this,ordering::update_direct_children());
261 template<
typename GFS,
typename Transformation>
265 static const bool recursive =
true;
267 template<
typename... TC>
272 typename Transformation::DOFIndex,
273 typename Transformation::ContainerIndex,
281 template<
typename... TC>
282 static typename result<TC...>::type
transform(
const GFS& gfs,
const Transformation& t, std::shared_ptr<TC>... children)
284 return typename result<TC...>::type(gfs.backend().blocked(gfs),gfs.orderingTag(),children...);
287 template<
typename... TC>
288 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const GFS> gfs,
const Transformation& t, std::shared_ptr<TC>... children)
290 return std::make_shared<
typename result<TC...>::type>(gfs->backend().blocked(*gfs),gfs.orderingTag(),children...);
301 #endif // DUNE_PDELAB_ORDERING_PERMUTATIONORDERING_HH
Base(const This &other)
Copy constructor.
Definition: permutationordering.hh:68
static const bool consume_tree_index
Definition: permutationordering.hh:50
Indicate permuted ordering of the unknowns of non-leaf grid function spaces according to a given perm...
Definition: gridfunctionspace/tags.hh:134
Definition: lexicographicordering.hh:104
void setDelegate(const VirtualOrderingBase< DI, CI > *delegate)
Set the delegate called in mapIndex().
Definition: orderingbase.hh:222
BaseT::Traits Traits
Definition: permutationordering.hh:46
DI::size_type SizeType
Definition: ordering/utility.hh:201
Base(This &&other)
Definition: permutationordering.hh:77
virtual void map_index_dynamic(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: permutationordering.hh:114
Base< DI, CI, Node > This
Definition: permutationordering.hh:44
static result< TC... >::type transform(const GFS &gfs, const Transformation &t, std::shared_ptr< TC >...children)
Definition: permutationordering.hh:282
static result< TC >::storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t, const array< std::shared_ptr< TC >, GFS::CHILDREN > &children)
Definition: permutationordering.hh:201
Definition: adaptivity.hh:27
std::string name() const
Definition: permutationordering.hh:169
PowerPermutationOrdering(bool container_blocked, const PermutationOrderingTag &ordering_tag, const typename Node::NodeStorage &children)
Construct ordering object.
Definition: permutationordering.hh:155
void update()
Definition: permutationordering.hh:160
std::shared_ptr< type > storage_type
Definition: permutationordering.hh:277
Interface for merging index spaces.
Definition: permutationordering.hh:213
void update()
Definition: permutationordering.hh:254
static result< TC >::type transform(const GFS &gfs, const Transformation &t, const array< std::shared_ptr< TC >, GFS::CHILDREN > &children)
Definition: permutationordering.hh:195
Base(Node &node, bool container_blocked, const OrderingTag &ordering_tag)
Construct ordering object.
Definition: permutationordering.hh:58
Interface for merging index spaces.
Definition: permutationordering.hh:37
DI::View DOFIndexView
Definition: ordering/utility.hh:198
lexicographic_ordering::Base< DI, CI, Node > BaseT
Definition: permutationordering.hh:45
void _mapIndex(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: orderingbase.hh:227
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: permutationordering.hh:87
static result< TC... >::storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< TC >...children)
Definition: permutationordering.hh:288
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: lexicographicordering.hh:59
Definition: ordering/utility.hh:186
PowerPermutationOrdering< typename Transformation::DOFIndex, typename Transformation::ContainerIndex, TC, GFS::CHILDREN > type
Definition: permutationordering.hh:188
PermutationOrderingTag OrderingTag
Definition: permutationordering.hh:48
Definition: ordering/utility.hh:231
Definition: lexicographicordering.hh:33
void update()
Definition: orderingbase.hh:97
std::shared_ptr< type > storage_type
Definition: permutationordering.hh:190
Interface for merging index spaces.
Definition: permutationordering.hh:130
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: permutationordering.hh:98
std::string name() const
Definition: permutationordering.hh:252
CompositePermutationOrdering(bool backend_blocked, const PermutationOrderingTag &ordering_tag, std::shared_ptr< Children >...children)
Construct ordering object.
Definition: permutationordering.hh:246
CompositePermutationOrdering< typename Transformation::DOFIndex, typename Transformation::ContainerIndex, TC... > type
Definition: permutationordering.hh:275
CI ContainerIndex
Definition: ordering/utility.hh:160
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