3#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE2D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE2D_LOCALBASIS_HH
11#include "../../common/localbasis.hh"
24 template<
class D,
class R>
39 for (
size_t i=0; i<4; i++)
40 sign_[i] = (s[i]) ? -1.0 : 1.0;
56 std::vector<typename Traits::RangeType>& out)
const
60 out[0][0] = sign_[0]*(-1.0 + 4.0*in[0]-3*in[0]*in[0]);
62 out[1][0] = 3.0 - 12.0*in[0] - 6.0*in[1] + 24.0*in[0]*in[1]+9*in[0]*in[0] - 18.0*in[0]*in[0]*in[1];
64 out[2][0] = sign_[1]*(-2.0*in[0] + 3.0*in[0]*in[0]);
66 out[3][0] = -6.0*in[0] + 12.0*in[0]*in[1] + 9.0*in[0]*in[0] - 18.0*in[0]*in[0]*in[1];
69 out[4][1] = sign_[2]*(-1.0 + 4.0*in[1] - 3.0*in[1]*in[1]);
71 out[5][1] = -3.0 + 6.0*in[0] + 12.0*in[1] - 24.0*in[0]*in[1] - 9.0*in[1]*in[1] + 18.0*in[0]*in[1]*in[1];
73 out[6][1] = sign_[3]*(-2.0*in[1] + 3.0*in[1]*in[1]);
75 out[7][1] = 6.0*in[1] - 12.0*in[0]*in[1] - 9.0*in[1]*in[1] + 18.0*in[0]*in[1]*in[1];
76 out[8][0] = 24.0*in[0] - 36.0*in[0]*in[1] - 24.0*in[0]*in[0] + 36.0*in[0]*in[0]*in[1];
79 out[9][1] = 24.0*in[1] - 36.0*in[0]*in[1] - 24.0*in[1]*in[1] + 36.0*in[0]*in[1]*in[1];
80 out[10][0] = -36.0*in[0] + 72.0*in[0]*in[1] + 36.0*in[0]*in[0] - 72.0*in[0]*in[0]*in[1];
83 out[11][1] = -36.0*in[1] + 72.0*in[0]*in[1] + 36*in[1]*in[1] - 72.0*in[0]*in[1]*in[1];
93 std::vector<typename Traits::JacobianType>& out)
const
97 out[0][0][0] = sign_[0]*(4.0 - 6.0*in[0]);
102 out[1][0][0] = -12.0 + 24.0*in[1] + 18.0*in[0] - 36.0*in[0]*in[1];
103 out[1][0][1] = -6 + 24.0*in[0] - 18.0*in[0]*in[0];
107 out[2][0][0] = sign_[1]*(-2.0 + 6.0*in[0]);
112 out[3][0][0] = -6.0 + 12.0*in[1] + 18.0*in[0] - 36.0*in[0]*in[1];
113 out[3][0][1] = 12.0*in[0] - 18.0*in[0]*in[0];
120 out[4][1][1] = sign_[2]*(4.0 - 6.0*in[1]);
124 out[5][1][0] = 6.0 - 24.0*in[1] + 18.0*in[1]*in[1];
125 out[5][1][1] = 12.0 - 24.0*in[0] - 18.0*in[1] + 36.0*in[0]*in[1];
130 out[6][1][1] = sign_[3]*(-2.0 + 6.0*in[1]);
134 out[7][1][0] = -12.0*in[1] + 18.0*in[1]*in[1];
135 out[7][1][1] = 6.0 - 12.0*in[0] - 18.0*in[1] + 36.0*in[1]*in[0];
137 out[8][0][0] = 24.0 - 36.0*in[1] - 48.0*in[0] + 72.0*in[0]*in[1];
138 out[8][0][1] = -36.0*in[0] + 36.0*in[0]*in[0];
144 out[9][1][0] = -36.0*in[1] + 36.0*in[1]*in[1];
145 out[9][1][1] = 24.0 - 36.0*in[0] - 48.0*in[1] + 72.0*in[0]*in[1];
147 out[10][0][0] = -36.0 + 72.0*in[1] + 72.0*in[0] - 144.0*in[0]*in[1];
148 out[10][0][1] = 72.0*in[0] - 72.0*in[0]*in[0];
154 out[11][1][0] = 72.0*in[1] - 72.0*in[1]*in[1];
155 out[11][1][1] = -36.0 + 72.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1];
161 std::vector<typename Traits::RangeType>& out)
const
164 if (totalOrder == 0) {
178 std::array<R,4> sign_;
A dense n x m matrix.
Definition: fmatrix.hh:69
Default exception for dummy implementations.
Definition: exceptions.hh:261
First order Raviart-Thomas shape functions on the reference quadrilateral.
Definition: raviartthomas1cube2dlocalbasis.hh:26
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:92
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:172
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:55
unsigned int size() const
number of shape functions
Definition: raviartthomas1cube2dlocalbasis.hh:44
RT1Cube2DLocalBasis(std::bitset< 4 > s=0)
Make set number s, where 0 <= s < 16.
Definition: raviartthomas1cube2dlocalbasis.hh:37
void partial(const std::array< unsigned int, 2 > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of all shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:159
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:289
Dune namespace.
Definition: alignedallocator.hh:11
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43