1#ifndef DUNE_FEM_HPDG_SPACE_COMMON_DATAPROJECTION_TUPLE_HH
2#define DUNE_FEM_HPDG_SPACE_COMMON_DATAPROJECTION_TUPLE_HH
10#include <dune/fem/common/forloop.hh>
12#include "dataprojection.hh"
33 template<
class... DataProjections >
36 template<
class Head,
class... Tail >
38 :
public DataProjection< typename Head::DiscreteFunctionSpaceType, DataProjectionTuple< Head, Tail... > >
45 using DiscreteFunctionSpaceType =
typename BaseType::DiscreteFunctionSpaceType;
47 using BasisFunctionSetType =
typename BaseType::BasisFunctionSetType;
49 using EntityType =
typename BaseType::EntityType;
55 static void apply (
const EntityType &entity,
56 const BasisFunctionSetType &prior,
57 const BasisFunctionSetType &present,
58 const std::vector< std::size_t > &origin,
59 const std::vector< std::size_t > &destination,
60 std::tuple< Head, Tail... > &tuple )
62 std::get< i >( tuple )( entity, prior, present, origin, destination );
69 template <
class TemporaryStorage>
70 static void apply ( TemporaryStorage& tmp,
71 std::tuple< Head, Tail... > &tuple )
73 std::get< i >( tuple )( tmp );
80 template<
class Communicator >
81 static void apply ( Communicator &comm,
82 std::tuple< Head, Tail... > &tuple )
84 std::get< i >( tuple ).addToList( comm );
93 DataProjectionTuple ( Head &&
head, Tail &&...
tail )
94 : tuple_(
std::forward< Head >(
head ),
std::forward< Tail >(
tail )... )
101 DataProjectionTuple (
const ThisType & ) =
delete;
103 DataProjectionTuple ( ThisType && ) =
default;
105 ThisType &operator= (
const ThisType & ) =
delete;
107 ThisType &operator= ( ThisType && ) =
default;
112 void operator() (
const EntityType &entity,
113 const BasisFunctionSetType &prior,
114 const BasisFunctionSetType &present,
115 const std::vector< std::size_t > &origin,
116 const std::vector< std::size_t > &destination )
118 Dune::Fem::ForLoop< Operation, 0,
sizeof...( Tail ) >::apply( entity, prior, present, origin, destination, tuple_ );
121 template <
class TemporaryStorage>
122 void operator () ( TemporaryStorage& tmp )
124 Dune::Fem::ForLoop< Project, 0,
sizeof...( Tail ) >::apply( tmp, tuple_ );
128 template<
class Communicator >
129 void addToList ( Communicator &comm )
131 Dune::Fem::ForLoop< AddToList, 0,
sizeof...( Tail ) >::apply( comm, tuple_ );
135 std::tuple< Head, Tail... > tuple_;
149 template<
class... DiscreteFunctions >
A DataProjection wrapping an arbitrary number of projection operators.
Definition: tuple.hh:34
Abstract definition of the local restriction and prolongation of discrete functions.
Definition: dataprojection.hh:29
A DataProjection for managing an arbitrary number of discrete functions.
Definition: tuple.hh:152
Local -projection for the restriction and prolongation of discrete functions.
Definition: default.hh:40
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integer_sequence< T, II... > tail(std::integer_sequence< T, I0, II... >)
For a sequence [head,tail...) return the tail sequence.
Definition: integersequence.hh:58
constexpr std::integral_constant< T, I0 > head(std::integer_sequence< T, I0, II... >)
For a sequence [head,tail...) return the single head element.
Definition: integersequence.hh:53