5#ifndef DUNE_LOCALFUNCTIONS_ENRICHED_CUBEQ1BUBBLE_LOCALINTERPOLATION_HH
6#define DUNE_LOCALFUNCTIONS_ENRICHED_CUBEQ1BUBBLE_LOCALINTERPOLATION_HH
35 static const int dim = LB::dimension;
36 static const int numVertices =
power(2, dim);
38 using DomainType =
typename LB::Traits::DomainType;
39 using RangeType =
typename LB::Traits::RangeType;
49 template<
class F,
class C,
50 class R = std::invoke_result_t<F, DomainType>,
51 std::enable_if_t<std::is_convertible_v<R, C>,
int> = 0>
52 static constexpr void interpolate (
const F& f, std::vector<C>& out)
54 out.resize(numVertices+1);
58 for (
int i = 0; i < numVertices; ++i)
61 for (
int j = 0; j < dim; ++j)
62 x[j] = (i & (1<<j)) ? 1 : 0;
72 std::vector<RangeType> sfValues;
73 LB::evaluateFunction(x, sfValues);
76 for (
int i = 0; i < numVertices; ++i)
77 out[numVertices] -= out[i]*sfValues[i];
Interpolation into the CubeQ1BubbleLocalBasis.
Definition: localinterpolation.hh:34
static constexpr void interpolate(const F &f, std::vector< C > &out)
Local interpolation of the function f.
Definition: localinterpolation.hh:52
Dune namespace.
Definition: alignedallocator.hh:13
constexpr Base power(Base m, Exponent p)
Power method for integer exponents.
Definition: math.hh:75