5#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE2D_LOCALBASIS_HH
6#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE2D_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
26 template<
class D,
class R>
41 for (
size_t i=0; i<4; i++)
42 sign_[i] = (s[i]) ? -1.0 : 1.0;
58 std::vector<typename Traits::RangeType>& out)
const
62 out[0][0] = sign_[0]*(-1.0 + 4.0*in[0]-3*in[0]*in[0]);
64 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];
66 out[2][0] = sign_[1]*(-2.0*in[0] + 3.0*in[0]*in[0]);
68 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];
71 out[4][1] = sign_[2]*(-1.0 + 4.0*in[1] - 3.0*in[1]*in[1]);
73 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];
75 out[6][1] = sign_[3]*(-2.0*in[1] + 3.0*in[1]*in[1]);
77 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];
78 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];
81 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];
82 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];
85 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];
95 std::vector<typename Traits::JacobianType>& out)
const
99 out[0][0][0] = sign_[0]*(4.0 - 6.0*in[0]);
104 out[1][0][0] = -12.0 + 24.0*in[1] + 18.0*in[0] - 36.0*in[0]*in[1];
105 out[1][0][1] = -6 + 24.0*in[0] - 18.0*in[0]*in[0];
109 out[2][0][0] = sign_[1]*(-2.0 + 6.0*in[0]);
114 out[3][0][0] = -6.0 + 12.0*in[1] + 18.0*in[0] - 36.0*in[0]*in[1];
115 out[3][0][1] = 12.0*in[0] - 18.0*in[0]*in[0];
122 out[4][1][1] = sign_[2]*(4.0 - 6.0*in[1]);
126 out[5][1][0] = 6.0 - 24.0*in[1] + 18.0*in[1]*in[1];
127 out[5][1][1] = 12.0 - 24.0*in[0] - 18.0*in[1] + 36.0*in[0]*in[1];
132 out[6][1][1] = sign_[3]*(-2.0 + 6.0*in[1]);
136 out[7][1][0] = -12.0*in[1] + 18.0*in[1]*in[1];
137 out[7][1][1] = 6.0 - 12.0*in[0] - 18.0*in[1] + 36.0*in[1]*in[0];
139 out[8][0][0] = 24.0 - 36.0*in[1] - 48.0*in[0] + 72.0*in[0]*in[1];
140 out[8][0][1] = -36.0*in[0] + 36.0*in[0]*in[0];
146 out[9][1][0] = -36.0*in[1] + 36.0*in[1]*in[1];
147 out[9][1][1] = 24.0 - 36.0*in[0] - 48.0*in[1] + 72.0*in[0]*in[1];
149 out[10][0][0] = -36.0 + 72.0*in[1] + 72.0*in[0] - 144.0*in[0]*in[1];
150 out[10][0][1] = 72.0*in[0] - 72.0*in[0]*in[0];
156 out[11][1][0] = 72.0*in[1] - 72.0*in[1]*in[1];
157 out[11][1][1] = -36.0 + 72.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1];
163 std::vector<typename Traits::RangeType>& out)
const
166 if (totalOrder == 0) {
180 std::array<R,4> sign_;
A dense n x m matrix.
Definition: fmatrix.hh:117
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Default exception for dummy implementations.
Definition: exceptions.hh:263
First order Raviart-Thomas shape functions on the reference quadrilateral.
Definition: raviartthomas1cube2dlocalbasis.hh:28
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:94
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:174
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas1cube2dlocalbasis.hh:57
unsigned int size() const
number of shape functions
Definition: raviartthomas1cube2dlocalbasis.hh:46
RT1Cube2DLocalBasis(std::bitset< 4 > s=0)
Make set number s, where 0 <= s < 16.
Definition: raviartthomas1cube2dlocalbasis.hh:39
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:161
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:291
Dune namespace.
Definition: alignedallocator.hh:13
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:34
D DomainType
domain type
Definition: localbasis.hh:42