3#ifndef DUNE_RT02DLOCALINTERPOLATION_HH
4#define DUNE_RT02DLOCALINTERPOLATION_HH
10#include <dune/localfunctions/common/localinterpolation.hh>
15 class RT02DLocalInterpolation
20 RT02DLocalInterpolation (std::bitset<3> s = 0)
23 for (std::size_t i=0; i<sign_.size(); i++)
24 sign_[i] = (s[i]) ? -1.0 : 1.0;
31 n_[2] = {1.0/sqrt(2.0), 1.0/sqrt(2.0)};
32 c_[0] = ( 0.5*n_[0][0] - 1.0*n_[0][1]);
33 c_[1] = (-1.0*n_[1][0] + 0.5*n_[1][1]);
34 c_[2] = ( 0.5*n_[2][0] + 0.5*n_[2][1]);
37 template<
typename F,
typename C>
38 void interpolate (
const F& ff, std::vector<C>& out)
const
41 auto&& f = Impl::makeFunctionWithCallOperator<typename LB::Traits::DomainType>(ff);
45 for (
int i=0; i<3; i++)
48 out[i] = (y[0]*n_[i][0]+y[1]*n_[i][1])*sign_[i]/c_[i];
54 std::array<typename LB::Traits::RangeFieldType,3> sign_;
56 std::array<typename LB::Traits::DomainType,3> m_;
58 std::array<typename LB::Traits::DomainType,3> n_;
60 std::array<typename LB::Traits::RangeFieldType,3> c_;
Dune namespace.
Definition: alignedallocator.hh:11