3#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI2_SIMPLEX2D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI2_SIMPLEX2D_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
26 template<
class D,
class R>
38 for (
size_t i=0; i<3; i++)
49 for (
size_t i=0; i<3; i++)
50 sign_[i] = s[i] ? -1.0 : 1.0;
66 std::vector<typename Traits::RangeType>& out)
const
70 out[0][0] = sign_[0]*(-2*in[0]*in[1] + in[0]*in[0]);
71 out[0][1] = sign_[0]*(-1 + 6*in[1] -2*in[0]*in[1] - 5*in[1]*in[1]);
73 out[1][0] = 1.5*in[0] + 3*in[0]*in[1] - 4.5*in[0]*in[0];
74 out[1][1] = -3 + 6*in[0] + 10.5*in[1] - 15*in[0]*in[1] - 7.5*in[1]*in[1];
76 out[2][0] = sign_[0]*(-7.5*in[0] + 5*in[0]*in[1] + 12.5*in[0]*in[0]);
77 out[2][1] = sign_[0]*(-5 + 30*in[0] + 7.5*in[1] - 25*in[0]*in[1] - 30*in[0]*in[0] - 2.5*in[1]*in[1]);
81 out[3][0] = sign_[1]*(-1 + 6*in[0] - 2*in[0]*in[1] - 5*in[0]*in[0]);
82 out[3][1] = sign_[1]*(-2*in[0]*in[1] + in[1]*in[1]);
84 out[4][0] = 3 - 10.5*in[0] - 6*in[1] + 15*in[0]*in[1] + 7.5*in[0]*in[0];
85 out[4][1] = -1.5*in[1] - 3*in[0]*in[1] + 4.5*in[1]*in[1];
87 out[5][0] = sign_[1]*(-5 + 7.5*in[0] + 30*in[1] - 25*in[0]*in[1] - 2.5*in[0]*in[0] - 30*in[1]*in[1]);
88 out[5][1] = sign_[1]*(-7.5*in[1] + 5*in[0]*in[1] + 12.5*in[1]*in[1]);
92 out[6][0] = sign_[2]*(-3*in[0] + 4*in[0]*in[1] + 4*in[0]*in[0]);
93 out[6][1] = sign_[2]*(-3*in[1] + 4*in[0]*in[1] + 4*in[1]*in[1]);
95 out[7][0] = -3*in[0] + 6*in[0]*in[0];
96 out[7][1] = 3*in[1] - 6*in[1]*in[1];
98 out[8][0] = sign_[2]*(-10*in[0]*in[1] + 5*in[0]*in[0]);
99 out[8][1] = sign_[2]*(-10*in[0]*in[1] + 5*in[1]*in[1]);
103 out[9][0] = 18*in[0] - 12*in[0]*in[1] - 18*in[0]*in[0];
104 out[9][1] = 6*in[1] - 12*in[0]*in[1] - 6*in[1]*in[1];
106 out[10][0] = 6*in[0] - 12*in[0]*in[1] - 6*in[0]*in[0];
107 out[10][1] = 18*in[1] - 12*in[0]*in[1] - 18*in[1]*in[1];
109 out[11][0] = 90*in[0] - 180*in[0]*in[1] - 90*in[0]*in[0];
110 out[11][1] = -90*in[1] + 180*in[0]*in[1] + 90*in[1]*in[1];
120 std::vector<typename Traits::JacobianType>& out)
const
124 out[0][0][0] = sign_[0]*(-2*in[1] + 2*in[0]);
125 out[0][0][1] = sign_[0]*(-2*in[0]);
127 out[0][1][0] = sign_[0]*(-2*in[1]);
128 out[0][1][1] = sign_[0]*(6 -2*in[0] - 10*in[1]);
131 out[1][0][0] = 1.5 + 3*in[1] - 9*in[0];
132 out[1][0][1] = 3*in[0];
134 out[1][1][0] = 6 - 15*in[1];
135 out[1][1][1] = 10.5 - 15*in[0] - 15*in[1];
138 out[2][0][0] = sign_[0]*(-7.5 + 5*in[1] + 25*in[0]);
139 out[2][0][1] = sign_[0]*(5*in[0]);
141 out[2][1][0] = sign_[0]*(30 - 25*in[1] - 60*in[0]);
142 out[2][1][1] = sign_[0]*(7.5 - 25*in[0] - 5*in[1]);
146 out[3][0][0] = sign_[1]*(6 - 2*in[1] - 10*in[0]);
147 out[3][0][1] = sign_[1]*(-2*in[0]);
149 out[3][1][0] = sign_[1]*(-2*in[1]);
150 out[3][1][1] = sign_[1]*(-2*in[0] + 2*in[1]);
153 out[4][0][0] = -10.5 + 15*in[1] + 15*in[0];
154 out[4][0][1] = -6 + 15*in[0];
156 out[4][1][0] = -3*in[1];
157 out[4][1][1] = -1.5 - 3*in[0] + 9*in[1];
160 out[5][0][0] = sign_[1]*(7.5 - 25*in[1] - 5*in[0]);
161 out[5][0][1] = sign_[1]*(30 - 25*in[0] - 60*in[1]);
163 out[5][1][0] = sign_[1]*(5*in[1]);
164 out[5][1][1] = sign_[1]*(-7.5 + 5*in[0] + 25*in[1]);
168 out[6][0][0] = sign_[2]*(-3 + 4*in[1] + 8*in[0]);
169 out[6][0][1] = sign_[2]*(4*in[0]);
171 out[6][1][0] = sign_[2]*(4*in[1]);
172 out[6][1][1] = sign_[2]*(-3 + 4*in[0] + 8*in[1]);
175 out[7][0][0] = -3 + 12*in[0];
179 out[7][1][1] = 3 - 12*in[1];
182 out[8][0][0] = sign_[2]*(-10*in[1] + 10*in[0]);
183 out[8][0][1] = sign_[2]*(-10*in[0]);
185 out[8][1][0] = sign_[2]*(-10*in[1]);
186 out[8][1][1] = sign_[2]*(-10*in[0] + 10*in[1]);
189 out[9][0][0] = 18 - 12*in[1] - 36*in[0];
190 out[9][0][1] = -12*in[0];
192 out[9][1][0] = -12*in[1];
193 out[9][1][1] = 6 - 12*in[0] - 12*in[1];
195 out[10][0][0] = 6 - 12*in[1] - 12*in[0];
196 out[10][0][1] = -12*in[0];
198 out[10][1][0] = -12*in[1];
199 out[10][1][1] = 18 - 12*in[0] - 36*in[1];
201 out[11][0][0] = 90 - 180*in[1] - 180*in[0];
202 out[11][0][1] = -180*in[0];
204 out[11][1][0] = 180*in[1];
205 out[11][1][1] = -90 + 180*in[0] + 180*in[1];
211 std::vector<typename Traits::RangeType>& out)
const
214 if (totalOrder == 0) {
216 }
else if (totalOrder == 1) {
218 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
222 out[0][0] = sign_[0]*(-2*in[1] + 2*in[0]);
223 out[0][1] = sign_[0]*(-2*in[1]);
225 out[1][0] = 1.5 + 3*in[1] - 9*in[0];
226 out[1][1] = 6 - 15*in[1];
228 out[2][0] = sign_[0]*(-7.5 + 5*in[1] + 25*in[0]);
229 out[2][1] = sign_[0]*(30 - 25*in[1] - 60*in[0]);
231 out[3][0] = sign_[1]*(6 - 2*in[1] - 10*in[0]);
232 out[3][1] = sign_[1]*(-2*in[1]);
234 out[4][0] = -10.5 + 15*in[1] + 15*in[0];
235 out[4][1] = -3*in[1];
237 out[5][0] = sign_[1]*(7.5 - 25*in[1] - 5*in[0]);
238 out[5][1] = sign_[1]*(5*in[1]);
240 out[6][0] = sign_[2]*(-3 + 4*in[1] + 8*in[0]);
241 out[6][1] = sign_[2]*(4*in[1]);
243 out[7][0] = -3 + 12*in[0];
246 out[8][0] = sign_[2]*(-10*in[1] + 10*in[0]);
247 out[8][1] = sign_[2]*(-10*in[1]);
249 out[9][0] = 18 - 12*in[1] - 36*in[0];
250 out[9][1] = -12*in[1];
252 out[10][0] = 6 - 12*in[1] - 12*in[0];
253 out[10][1] = -12*in[1];
255 out[11][0] = 90 - 180*in[1] - 180*in[0];
256 out[11][1] = 180*in[1];
259 out[0][0] = sign_[0]*(-2*in[0]);
260 out[0][1] = sign_[0]*(6 -2*in[0] - 10*in[1]);
263 out[1][1] = 10.5 - 15*in[0] - 15*in[1];
265 out[2][0] = sign_[0]*(5*in[0]);
266 out[2][1] = sign_[0]*(7.5 - 25*in[0] - 5*in[1]);
268 out[3][0] = sign_[1]*(-2*in[0]);
269 out[3][1] = sign_[1]*(-2*in[0] + 2*in[1]);
271 out[4][0] = -6 + 15*in[0];
272 out[4][1] = -1.5 - 3*in[0] + 9*in[1];
274 out[5][0] = sign_[1]*(30 - 25*in[0] - 60*in[1]);
275 out[5][1] = sign_[1]*(-7.5 + 5*in[0] + 25*in[1]);
277 out[6][0] = sign_[2]*(4*in[0]);
278 out[6][1] = sign_[2]*(-3 + 4*in[0] + 8*in[1]);
281 out[7][1] = 3 - 12*in[1];
283 out[8][0] = sign_[2]*(-10*in[0]);
284 out[8][1] = sign_[2]*(-10*in[0] + 10*in[1]);
286 out[9][0] = -12*in[0];
287 out[9][1] = 6 - 12*in[0] - 12*in[1];
289 out[10][0] = -12*in[0];
290 out[10][1] = 18 - 12*in[0] - 36*in[1];
292 out[11][0] = -180*in[0];
293 out[11][1] = -90 + 180*in[0] + 180*in[1];
310 std::array<R,3> sign_;
First order Brezzi-Douglas-Marini shape functions on quadrilaterals.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:28
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:119
BDM2Simplex2DLocalBasis(std::bitset< 3 > s)
Make set number s, where 0 <= s < 8.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:47
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: brezzidouglasmarini2simplex2dlocalbasis.hh:209
unsigned int size() const
number of shape functions
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:54
BDM2Simplex2DLocalBasis()
Standard constructor.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:36
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:65
unsigned int order() const
Polynomial order of the shape functions.
Definition: brezzidouglasmarini2simplex2dlocalbasis.hh:304
A dense n x m matrix.
Definition: fmatrix.hh:69
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Default exception for dummy implementations.
Definition: exceptions.hh:261
Default exception class for range errors.
Definition: exceptions.hh:252
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