4#ifndef DUNE_LOCALFUNCTIONS_SERENDIPITYLOCALINTERPOLATION_HH
5#define DUNE_LOCALFUNCTIONS_SERENDIPITYLOCALINTERPOLATION_HH
7#include <dune/common/fvector.hh>
8#include <dune/common/power.hh>
10#include <dune/geometry/type.hh>
12#include <dune/localfunctions/common/localbasis.hh>
13#include <dune/localfunctions/common/localfiniteelementtraits.hh>
19 template<
int k,
int d,
class LB>
23 typedef typename Dune::FieldVector<int,d> DuneVector;
24 static void multiindex (DuneVector& alpha)
27 for (
int j=0; j<d; j++){
28 i+=alpha[j]*pow(k+1,j);
31 for (
int j=0; j<d; j++)
37 for (
unsigned int j=0; j<d; j++){
38 if(alpha[j] > 0 && alpha[j] < k){ sum++; }
46 unsigned int size ()
const
52 return 2*(k+1)+2*(k-1);
55 return 4*(k+1)+8*(k-1);
62 template<
typename F,
typename C>
65 typename LB::Traits::DomainType x;
66 typename LB::Traits::RangeType y;
70 for (
unsigned int i=0; i<size(); i++)
73 if(i>0){ multiindex(alpha); }
76 for (
int j=0; j<d; j++)
77 x[j] = (1.0*alpha[j])/k;
86 template<
int d,
class LB>
91 template<
typename F,
typename C>
94 typename LB::Traits::DomainType x(0);
95 typename LB::Traits::RangeType y;
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition: serendipitylocalinterpolation.hh:92
Definition: serendipitylocalinterpolation.hh:21
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition: serendipitylocalinterpolation.hh:63