3 #ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_ALL_HH
4 #define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_ALL_HH
9 #include <dune/common/fmatrix.hh>
24 template<
class D,
class R>
34 sign0 = sign1 = sign2 = sign3 = 1.0;
40 sign0 = sign1 = sign2 = sign3 = 1.0;
41 if (s&1) sign0 = -1.0;
42 if (s&2) sign1 = -1.0;
43 if (s&4) sign2 = -1.0;
44 if (s&8) sign3 = -1.0;
55 std::vector<typename Traits::RangeType>& out)
const
58 out[0][0] = sign0*(in[0]-1.0); out[0][1]=0.0;
59 out[1][0] = sign1*(in[0]); out[1][1]=0.0;
60 out[2][0] = 0.0; out[2][1]=sign2*(in[1]-1.0);
61 out[3][0] = 0.0; out[3][1]=sign3*(in[1]);
67 std::vector<typename Traits::JacobianType>& out)
const
70 out[0][0][0] = sign0; out[0][0][1] = 0;
71 out[0][1][0] = 0; out[0][1][1] = 0;
73 out[1][0][0] = sign1; out[1][0][1] = 0;
74 out[1][1][0] = 0; out[1][1][1] = 0;
76 out[2][0][0] = 0; out[2][0][1] = 0;
77 out[2][1][0] = 0; out[2][1][1] = sign2;
79 out[3][0][0] = 0; out[3][0][1] = 0;
80 out[3][1][0] = 0; out[3][1][1] = sign3;
90 R sign0, sign1, sign2, sign3;
109 sign0 = sign1 = sign2 = sign3 = 1.0;
115 sign0 = sign1 = sign2 = sign3 = 1.0;
116 if (s&1) sign0 *= -1.0;
117 if (s&2) sign1 *= -1.0;
118 if (s&4) sign2 *= -1.0;
119 if (s&8) sign3 *= -1.0;
121 m0[0] = 0.0; m0[1] = 0.5;
122 m1[0] = 1.0; m1[1] = 0.5;
123 m2[0] = 0.5; m2[1] = 0.0;
124 m3[0] = 0.5; m3[1] = 1.0;
126 n0[0] = -1.0; n0[1] = 0.0;
127 n1[0] = 1.0; n1[1] = 0.0;
128 n2[0] = 0.0; n2[1] = -1.0;
129 n3[0] = 0.0; n3[1] = 1.0;
132 template<
typename F,
typename C>
136 typename F::Traits::RangeType y;
140 f.evaluate(m0,y); out[0] = (y[0]*n0[0]+y[1]*n0[1])*sign0;
141 f.evaluate(m1,y); out[1] = (y[0]*n1[0]+y[1]*n1[1])*sign1;
142 f.evaluate(m2,y); out[2] = (y[0]*n2[0]+y[1]*n2[1])*sign2;
143 f.evaluate(m3,y); out[3] = (y[0]*n3[0]+y[1]*n3[1])*sign3;
147 typename LB::Traits::RangeFieldType sign0,sign1,sign2,sign3;
148 typename LB::Traits::DomainType m0,m1,m2,m3;
149 typename LB::Traits::DomainType n0,n1,n2,n3;
164 for (std::size_t i=0; i<4; i++)
181 std::vector<LocalKey> li;
185 #endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE2D_ALL_HH
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:39
RT0Cube2DLocalInterpolation(unsigned int s)
Make set numer s, where 0<=s<8.
Definition: raviartthomas0cube2dall.hh:113
RT0Cube2DLocalBasis()
Standard constructor.
Definition: raviartthomas0cube2dall.hh:32
LocalBasisTraits< D, 2, Dune::FieldVector< D, 2 >, R, 2, Dune::FieldVector< R, 2 >, Dune::FieldMatrix< R, 2, 2 > > Traits
Definition: raviartthomas0cube2dall.hh:29
Describe position of one degree of freedom.
Definition: localkey.hh:20
std::size_t size() const
number of coefficients
Definition: raviartthomas0cube2dall.hh:169
void interpolate(const F &f, std::vector< C > &out) const
Definition: raviartthomas0cube2dall.hh:133
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas0cube2dall.hh:66
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition: raviartthomas0cube2dall.hh:175
unsigned int size() const
number of shape functions
Definition: raviartthomas0cube2dall.hh:48
Layout map for RT0 elements on quadrilaterals.
Definition: raviartthomas0cube2dall.hh:158
RT0Cube2DLocalBasis(unsigned int s)
Make set numer s, where 0<=s<16.
Definition: raviartthomas0cube2dall.hh:38
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas0cube2dall.hh:84
RT0Cube2DLocalInterpolation()
Standard constructor.
Definition: raviartthomas0cube2dall.hh:107
D DomainType
domain type
Definition: localbasis.hh:51
RT0Cube2DLocalCoefficients()
Standard constructor.
Definition: raviartthomas0cube2dall.hh:162
Lowest order Raviart-Thomas shape functions on the reference quadrilateral.
Definition: raviartthomas0cube2dall.hh:102
Lowest order Raviart-Thomas shape functions on the reference quadrilateral.
Definition: raviartthomas0cube2dall.hh:25
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas0cube2dall.hh:54