dune-pdelab 2.7-git
Loading...
Searching...
No Matches
sum.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=8 sw=2 sts=2:
3#ifndef DUNE_PDELAB_LOCALOPERATOR_SUM_HH
4#define DUNE_PDELAB_LOCALOPERATOR_SUM_HH
5
7
8#include <utility>
9
10
11namespace Dune {
12 namespace PDELab {
13
17
19
24 template<typename... Args>
26 public CombinedOperator<InstationarySumLocalOperator<Args...>, Args...>
27 {
28 template<typename F, typename... FArgs>
29 void applyLops(F && f, FArgs &... args) const
30 {
31 Hybrid::forEach(std::make_index_sequence<sizeof...(Args)>{},
32 [&](auto i){f(*Hybrid::elementAt(this->lops, i), args...);});
33 }
34
35 using Base = CombinedOperator<InstationarySumLocalOperator<Args...>, Args...>;
36 using ArgPtrs = typename Base::ArgPtrs;
37
38 friend Base;
39 public:
40
44 {}
45
49 : Base(lops...)
50 {}
51
55 : Base(std::forward<Args>(lops)...)
56 {}
57
58 protected:
60 : Base(std::forward<ArgPtrs>(lops))
61 { }
62
63 };
64
66
72 template<typename... Args>
73 class InstationarySumLocalOperator<std::tuple<Args...>> :
74 public InstationarySumLocalOperator<Args...>
75 {
76 using Base = InstationarySumLocalOperator<Args...>;
77 using ArgRefs = typename Base::ArgRefs;
78
79 public:
80
83 [[deprecated("The specialization InstationarySumLocalOperator<Tuple<...>> is"
84 "deprecated and will be removed after PDELab 2.7.")]]
86 {}
87
90 [[deprecated("The specialization InstationarySumLocalOperator<Tuple<...>> is"
91 "deprecated and will be removed after PDELab 2.7.")]]
93 : Base(genericTransformTuple(lops,
94 [](auto & l){return stackobject_to_shared_ptr(l);}))
95 { }
96 };
97
98 }
99}
100
101#endif // DUNE_PDELAB_LOCALOPERATOR_SUM_HH
InstationarySumLocalOperator()
Default-construct an InstationarySumLocalOperator. Expects the operators to be added later through th...
Definition: sum.hh:85
InstationarySumLocalOperator(const ArgRefs &lops)
construct a InstationarySumLocalOperator from a tuple of local operators
Definition: sum.hh:92
std::tuple< Args &... > ArgRefs
Definition: combinedoperator.hh:33
InstationarySumLocalOperator(Args &&... lops)
construct a InstationarySumLocalOperator from a set of local operators (rvalue reference)
Definition: sum.hh:54
InstationarySumLocalOperator(Args &... lops)
construct a InstationarySumLocalOperator from a set of local operators
Definition: sum.hh:48
std::tuple< std::shared_ptr< std::remove_reference_t< Args > >... > ArgPtrs
Definition: combinedoperator.hh:32
InstationarySumLocalOperator()
Default-construct an InstationarySumLocalOperator. Expects the operators to be added later through th...
Definition: sum.hh:43
InstationarySumLocalOperator(ArgPtrs &&lops)
Definition: sum.hh:59
STL namespace.
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
A local operator to take combine different local operators.
Definition: combinedoperator.hh:30
A local operator to take the sum of other local operators.
Definition: sum.hh:27