4 #ifndef DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
5 #define DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
14 #include <dune/common/static_assert.hh>
28 template<
class Backend,
class BasisTraits>
30 dune_static_assert(Backend::Traits::dimRange == 1,
"PowerInterpolation "
31 "works only with scalar backends");
33 const Backend *backend;
50 class ComponentEvaluator {
55 ComponentEvaluator(
const F &f_, std::size_t comp_) :
59 void evaluate(
const typename Backend::Traits::DomainLocal &x,
60 typename Backend::Traits::Range &y)
const
62 typename Traits::Range fy;
79 template<
typename F,
typename C>
83 for(std::size_t d = 0; d < Traits::dimRange; ++d) {
84 backend->interpolate(ComponentEvaluator<F>(f, d), cout);
86 out.resize(cout.size()*Traits::dimRange);
88 assert(out.size() == cout.size()*Traits::dimRange);
89 std::copy(cout.begin(), cout.end(), out.begin() + d*cout.size());
96 #endif // DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH