DUNE PDELab (2.7)
transformation.hh
69 typedef decltype(registerNodeTransformation(declptr<S>(),declptr<T>(),declptr<Tag>())) lookup_type;
75 static_assert((!std::is_same<type,void>::value), "Unable to find valid transformation descriptor");
91 template<typename SourceTree, typename Transformation, typename Tag = StartTag, bool recursive = true>
97 typedef typename LookupNodeTransformation<SourceTree,Transformation,typename SourceTree::ImplementationTag>::type NodeTransformation;
100 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_type transformed_type;
103 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_storage_type transformed_storage_type;
113 static transformed_type transform(const SourceTree& s, const Transformation& t = Transformation())
115 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
121 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
125 static transformed_type transform(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
127 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
133 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
138 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
140 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform_storage(sp,t);
145 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, Transformation& t)
147 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform_storage(sp,t);
256 // The problem is that the transformed power node must be parameterized on the transformed child
258 // template of the node transformation struct called result (see example of such a specification
261 typedef typename LookupNodeTransformation<typename S::ChildType,T,ImplementationTag<typename S::ChildType>>::type ChildNodeTransformation;
263 typedef typename NodeTransformation::template result<typename TransformTree<typename S::ChildType,
269 typedef typename NodeTransformation::template result<typename TransformTree<typename S::ChildType,
279 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
293 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
308 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
322 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
336 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
349 typedef TransformTree<typename S::ChildType,T,NodeTag<typename S::ChildType>,ChildNodeTransformation::recursive> ChildTreeTransformation;
367 // helper struct that does the actual transformation for a composite node. We need this additional struct
368 // to extract the template argument list with the types of all children from the node, which we cannot do
369 // directly in the transformation<> template, as the type passed to transformation<> will usually be a
370 // derived type and will normally have more template arguments than just the children. This declaration
371 // just introduces the type of the helper struct, we always instantiate the specialization defined below;
375 // specialized version of the helper struct which extracts the template argument list with the children from
376 // its second template parameter, which has to be CompositeNode::ChildTypes. Apart from that, the struct is
377 // similar to the one for a PowerNode, but it obviously delegates transformation of the children to the TMP.
425 std::initializer_list<int>{(setElement<i>(storage, ChildTransformation<i>::transform_storage(s.template childStorage<i>(), std::forward<Trafo>(t))),0)...};
430 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, Trafo&& t, std::index_sequence<i...> indices)
433 std::initializer_list<int>{(setElement<i>(storage, ChildTransformation<i>::transform_storage(sp->template childStorage<i>(), std::forward<Trafo>(t))),0)...};
434 return NodeTransformation::transform_storage(sp, std::forward<Trafo>(t), std::get<i>(storage)...);
457 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_storage_type transformed_storage_type;
A few common exception classes.
Traits for type conversions and type information.
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
STL namespace.
static transformed_type transform(std::shared_ptr< const SourceTree > sp, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:131
static transformed_type transform(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:125
static transformed_type transform(const SourceTree &s, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:119
transformed_type type
The type of the transformed tree.
Definition: transformation.hh:108
static transformed_type transform(const SourceTree &s, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:113
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Definition: transformation.hh:138
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, Transformation &t)
Definition: transformation.hh:145
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:148
![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/80x15.png)