4 #ifndef DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
5 #define DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
12 #include <dune/common/static_assert.hh>
24 template<
class Backend,
class BasisTraits>
26 dune_static_assert(Backend::Traits::dimRange == 1,
"PowerInterpolation "
27 "works only with scalar backends");
29 const Backend *backend;
46 class ComponentEvaluator {
51 ComponentEvaluator(
const F &f_, std::size_t comp_) :
55 void evaluate(
const typename Backend::Traits::DomainLocal &x,
56 typename Backend::Traits::Range &y)
const
58 typename Traits::Range fy;
75 template<
typename F,
typename C>
79 for(std::size_t d = 0; d < Traits::dimRange; ++d) {
80 backend->interpolate(ComponentEvaluator<F>(f, d), cout);
82 out.resize(cout.size()*Traits::dimRange);
84 assert(out.size() == cout.size()*Traits::dimRange);
85 std::copy(cout.begin(), cout.end(), out.begin() + d*cout.size());
92 #endif // DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH