3#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS12DLOCALINTERPOLATION_HH
4#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS12DLOCALINTERPOLATION_HH
29 sign0 = sign1 = sign2 = 1.0;
39 sign0 = sign1 = sign2 = 1.0;
56 n2[0] = 1.0/sqrt(2.0);
57 n2[1] = 1.0/sqrt(2.0);
58 c0 = 0.5*n0[0] - 1.0*n0[1];
59 c1 = -1.0*n1[0] + 0.5*n1[1];
60 c2 = 0.5*n2[0] + 0.5*n2[1];
71 template<
typename F,
typename C>
75 typedef typename LB::Traits::RangeFieldType Scalar;
76 typedef typename LB::Traits::DomainFieldType Vector;
77 typename F::Traits::RangeType y;
80 fill(out.begin(), out.end(), 0.0);
82 const int qOrder1 = 4;
86 it != rule1.end(); ++it)
88 Scalar qPos = it->position();
89 typename LB::Traits::DomainType localPos;
93 f.evaluate(localPos, y);
94 out[0] += (y[0]*n0[0] + y[1]*n0[1])*it->weight()*sign0/c0;
95 out[3] += (y[0]*n0[0] + y[1]*n0[1])*(2.0*qPos - 1.0)*it->weight()/c0;
99 f.evaluate(localPos, y);
100 out[1] += (y[0]*n1[0] + y[1]*n1[1])*it->weight()*sign1/c1;
101 out[4] += (y[0]*n1[0] + y[1]*n1[1])*(1.0 - 2.0*qPos)*it->weight()/c1;
103 localPos[0] = 1.0 - qPos;
105 f.evaluate(localPos, y);
106 out[2] += (y[0]*n2[0] + y[1]*n2[1])*it->weight()*sign2/c2;
107 out[5] += (y[0]*n2[0] + y[1]*n2[1])*(2.0*qPos - 1.0)*it->weight()/c2;
110 const int qOrder2 = 8;
114 it != rule2.end(); ++it)
119 out[6] += y[0]*it->weight();
120 out[7] += y[1]*it->weight();
125 typename LB::Traits::RangeFieldType sign0,sign1,sign2;
126 typename LB::Traits::DomainType n0,n1,n2;
127 typename LB::Traits::RangeFieldType c0,c1,c2;
vector space out of a tensor product of fields.
Definition: fvector.hh:93
Abstract base class for quadrature rules.
Definition: quadraturerules.hh:97
static const QuadratureRule & rule(const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
select the appropriate QuadratureRule for GeometryType t and order p
Definition: quadraturerules.hh:225
First order Raviart-Thomas shape functions on the reference quadrilateral.
Definition: raviartthomas12dlocalinterpolation.hh:23
RT12DLocalInterpolation()
Standard constructor.
Definition: raviartthomas12dlocalinterpolation.hh:27
void interpolate(const F &f, std::vector< C > &out) const
Interpolate a given function with shape functions.
Definition: raviartthomas12dlocalinterpolation.hh:72
RT12DLocalInterpolation(unsigned int s)
Make set number s, where 0 <= s < 8.
Definition: raviartthomas12dlocalinterpolation.hh:37
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:696
Dune namespace.
Definition: alignedallocator.hh:10