4#ifndef DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
5#define DUNE_LOCALFUNCTIONS_META_POWER_INTERPOLATION_HH
11#include <dune/localfunctions/common/localinterpolation.hh>
23 template<
class Backend,
class BasisTraits>
25 static_assert(Backend::Traits::dimRange == 1,
26 "PowerInterpolation works only with scalar backends");
28 const Backend *backend;
45 class ComponentEvaluator
51 ComponentEvaluator(
const F &f_, std::size_t comp_) :
55 typename Backend::Traits::Range operator()(
const typename Backend::Traits::DomainLocal &x)
const
57 typename Traits::Range fy = f(x);
58 typename Backend::Traits::Range y;
75 template<
typename F,
typename C>
78 auto&& f = Impl::makeFunctionWithCallOperator<typename Backend::Traits::DomainLocal>(ff);
83 for(std::size_t d = 0; d < Traits::dimRange; ++d) {
88 backend->interpolate(ComponentEvaluator<std::decay_t<
decltype(f)>>(f, d), cout);
90 out.resize(cout.size()*Traits::dimRange);
92 assert(out.size() == cout.size()*Traits::dimRange);
93 std::copy(cout.begin(), cout.end(), out.begin() + d*cout.size());
Meta-interpolation turning a scalar interpolation into vector-valued interpolation.
Definition: interpolation.hh:24
void interpolate(const F &ff, std::vector< C > &out) const
Determine coefficients interpolating a given function.
Definition: interpolation.hh:76
BasisTraits Traits
Export basis traits.
Definition: interpolation.hh:32
PowerInterpolation(const Backend &backend_)
Construct a PowerInterpolation.
Definition: interpolation.hh:41
Dune namespace.
Definition: alignedallocator.hh:11