3#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
27 template<
class D,
class R>
39 for (
size_t i=0; i<6; i++)
50 for (
size_t i=0; i<6; i++)
51 sign_[i] = s[i] ? -1.0 : 1.0;
67 std::vector<typename Traits::RangeType>& out)
const
71 out[0][0] = sign_[0] * (in[0] - 1.0);
74 out[1][0] = sign_[1] * in[0];
78 out[2][1] = sign_[2] * (in[1] - 1.0);
81 out[3][1] = sign_[3] * in[1];
85 out[4][2] = sign_[4] * (in[2] - 1.0);
88 out[5][2] = sign_[5] * in[2];
89 out[6][0] = 6.0 * in[0] * in[1] - 3 * in[0]-6 * in[1] + 3.0;
90 out[6][1] = -3.0 * in[1] * in[1] + 3 * in[1];
92 out[7][0] = -6.0 * in[0] * in[1] + 3 * in[0];
93 out[7][1] = 3.0 * in[1] * in[1] - 3 * in[1];
95 out[8][0] = 3.0 * in[0] * in[0] - 3 * in[0];
96 out[8][1] = -6.0 * in[0] * in[1] + 3 * in[1]+6 * in[0]-3.0;
98 out[9][0] = -3.0 * in[0] * in[0] + 3 * in[0];
99 out[9][1] = 6.0 * in[0] * in[1] - 3 * in[1];
101 out[10][0] = -3.0 * in[0] * in[0] + 3 * in[0];
103 out[10][2] = 6.0 * in[0] * in[2]-6 * in[0]-3 * in[2] + 3.0;
104 out[11][0] = 3.0 * in[0] * in[0]-3 * in[0];
106 out[11][2] = -6.0 * in[0] * in[2] + 3 * in[2];
107 out[12][0] = -6.0 * in[0] * in[2]+6 * in[2] + 3 * in[0]-3.0;
109 out[12][2] = 3.0 * in[2] * in[2]-3 * in[2];
110 out[13][0] = -3 * in[0]+6 * in[0] * in[2];
112 out[13][2] = -3.0 * in[2] * in[2] + 3 * in[2];
114 out[14][1] = 6.0 * in[1] * in[2]-3 * in[1]-6 * in[2] + 3.0;
115 out[14][2] = -3 * in[2] * in[2] + 3 * in[2];
117 out[15][1] = -6.0 * in[1] * in[2] + 3 * in[1];
118 out[15][2] = 3.0 * in[2] * in[2]-3 * in[2];
120 out[16][1] = 3.0 * in[1] * in[1]-3 * in[1];
121 out[16][2] = -6.0 * in[1] * in[2] + 3 * in[2]+6 * in[1]-3.0;
123 out[17][1] = -3.0 * in[1] * in[1] + 3 * in[1];
124 out[17][2] = 6.0 * in[1] * in[2] - 3.0 * in[2];
134 std::vector<typename Traits::JacobianType>& out)
const
138 out[0][0][0] = sign_[0]; out[0][0][1] = 0; out[0][0][2] = 0;
139 out[0][1][0] = 0; out[0][1][1] = 0; out[0][1][2] = 0;
140 out[0][2][0] = 0; out[0][2][1] = 0; out[0][2][2] = 0;
142 out[1][0][0] = sign_[1]; out[1][0][1] = 0; out[1][0][2] = 0;
143 out[1][1][0] = 0; out[1][1][1] = 0; out[1][1][2] = 0;
144 out[1][2][0] = 0; out[1][2][1] = 0; out[1][2][2] = 0;
146 out[2][0][0] = 0; out[2][0][1] = 0; out[2][0][2] = 0;
147 out[2][1][0] = 0; out[2][1][1] = sign_[2]; out[2][1][2] = 0;
148 out[2][2][0] = 0; out[2][2][1] = 0; out[2][2][2] = 0;
150 out[3][0][0] = 0; out[3][0][1] = 0; out[3][0][2] = 0;
151 out[3][1][0] = 0; out[3][1][1] = sign_[3]; out[3][1][2] = 0;
152 out[3][2][0] = 0; out[3][2][1] = 0; out[3][2][2] = 0;
154 out[4][0][0] = 0; out[4][0][1] = 0; out[4][0][2] = 0;
155 out[4][1][0] = 0; out[4][1][1] = 0; out[4][1][2] = 0;
156 out[4][2][0] = 0; out[4][2][1] = 0; out[4][2][2] = sign_[4];
158 out[5][0][0] = 0; out[5][0][1] = 0; out[5][0][2] = 0;
159 out[5][1][0] = 0; out[5][1][1] = 0; out[5][1][2] = 0;
160 out[5][2][0] = 0; out[5][2][1] = 0; out[5][2][2] = sign_[5];
164 out[6][0][0] = 6*in[1]-3; out[6][0][1] = 6*in[0]-6; out[6][0][2] = 0.0;
165 out[6][1][0] = 0.0; out[6][1][1] =-6*in[1]+3; out[6][1][2] = 0.0;
166 out[6][2][0] = 0.0; out[6][2][1] = 0.0; out[6][2][2] = 0.0;
168 out[7][0][0] = -6*in[1]+3; out[7][0][1] =-6*in[0]; out[7][0][2] = 0.0;
169 out[7][1][0] = 0.0; out[7][1][1] = 6*in[1]-3; out[7][1][2] = 0.0;
170 out[7][2][0] = 0.0; out[7][2][1] = 0.0; out[7][2][2] = 0.0;
173 out[8][0][0] = 6*in[0]-3; out[8][0][1] = 0.0; out[8][0][2] = 0.0;
174 out[8][1][0] =-6*in[1]+6; out[8][1][1] =-6*in[0]+3; out[8][1][2] = 0.0;
175 out[8][2][0] = 0.0; out[8][2][1] = 0.0; out[8][2][2] = 0.0;
177 out[9][0][0] = -6*in[0]+3; out[9][0][1] = 0.0; out[9][0][2] = 0.0;
178 out[9][1][0] = 6*in[1]; out[9][1][1] = 6*in[0]-3; out[9][1][2] = 0.0;
179 out[9][2][0] = 0.0; out[9][2][1] = 0.0; out[9][2][2] = 0.0;
181 out[10][0][0] = -6*in[0]+3; out[10][0][1] = 0.0; out[10][0][2] = 0.0;
182 out[10][1][0] = 0.0; out[10][1][1] = 0.0; out[10][1][2] = 0.0;
183 out[10][2][0] =6*in[2]-6; out[10][2][1] = 0.0; out[10][2][2] =6*in[0]-3;
185 out[11][0][0] =6*in[0]-3; out[11][0][1] = 0.0; out[11][0][2] = 0.0;
186 out[11][1][0] = 0.0; out[11][1][1] = 0.0; out[11][1][2] = 0.0;
187 out[11][2][0] = -6*in[2]; out[11][2][1] = 0.0; out[11][2][2] = -6*in[0]+3;
190 out[12][0][0] = -6*in[2]+3; out[12][0][1] =0.0; out[12][0][2] = -6*in[0]+6;
191 out[12][1][0] = 0.0; out[12][1][1] = 0.0; out[12][1][2] = 0.0;
192 out[12][2][0] = 0.0; out[12][2][1] = 0.0; out[12][2][2] =6*in[2]-3;
195 out[13][0][0] =6*in[2]-3; out[13][0][1] = 0.0; out[13][0][2] = 6*in[0];
196 out[13][1][0] = 0.0; out[13][1][1] = 0.0; out[13][1][2] = 0.0;
197 out[13][2][0] = 0.0; out[13][2][1] = 0.0; out[13][2][2] =-6*in[2]+3;
199 out[14][0][0] = 0.0; out[14][0][1] = 0.0; out[14][0][2] = 0.0;
200 out[14][1][0] = 0.0; out[14][1][1] = 6*in[2]-3; out[14][1][2] = 6*in[1]-6;
201 out[14][2][0] = 0.0; out[14][2][1] = 0.0; out[14][2][2] =-6*in[2]+3;
203 out[15][0][0] = 0.0; out[15][0][1] = 0.0; out[15][0][2] = 0.0;
204 out[15][1][0] = 0.0; out[15][1][1] =-6*in[2]+3; out[15][1][2] =-6*in[1];
205 out[15][2][0] = 0.0; out[15][2][1] = 0.0; out[15][2][2] = 6*in[2]-3;
207 out[16][0][0] = 0.0; out[16][0][1] = 0.0; out[16][0][2] = 0.0;
208 out[16][1][0] = 0.0; out[16][1][1] = 6*in[1]-3; out[16][1][2] = 0.0;
209 out[16][2][0] = 0.0; out[16][2][1] =-6*in[2]+6; out[16][2][2] =-6*in[1]+3;
211 out[17][0][0] = 0.0; out[17][0][1] = 0.0; out[17][0][2] = 0.0;
212 out[17][1][0] = 0.0; out[17][1][1] =-6*in[1]+3; out[17][1][2] = 0.0;
213 out[17][2][0] = 0.0; out[17][2][1] = 6*in[2]; out[17][2][2] = 6*in[1]-3;
219 std::vector<typename Traits::RangeType>& out)
const
222 if (totalOrder == 0) {
224 }
else if (totalOrder == 1) {
226 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
230 out[0][0] = sign_[0];
234 out[1][0] = sign_[1];
254 out[6][0] = 6*in[1]-3;
258 out[7][0] = -6*in[1]+3;
262 out[8][0] = 6*in[0]-3;
263 out[8][1] =-6*in[1]+6;
266 out[9][0] = -6*in[0]+3;
270 out[10][0] = -6*in[0]+3;
272 out[10][2] =6*in[2]-6;
274 out[11][0] =6*in[0]-3;
276 out[11][2] = -6*in[2];
278 out[12][0] = -6*in[2]+3;
282 out[13][0] =6*in[2]-3;
312 out[2][1] = sign_[2];
316 out[3][1] = sign_[3];
327 out[6][0] = 6*in[0]-6;
328 out[6][1] =-6*in[1]+3;
332 out[7][1] = 6*in[1]-3;
336 out[8][1] =-6*in[0]+3;
340 out[9][1] = 6*in[0]-3;
360 out[14][1] = 6*in[2]-3;
364 out[15][1] =-6*in[2]+3;
368 out[16][1] = 6*in[1]-3;
369 out[16][2] =-6*in[2]+6;
372 out[17][1] =-6*in[1]+3;
373 out[17][2] = 6*in[2];
394 out[4][2] = sign_[4];
398 out[5][2] = sign_[5];
418 out[10][2] =6*in[0]-3;
422 out[11][2] = -6*in[0]+3;
424 out[12][0] = -6*in[0]+6;
426 out[12][2] =6*in[2]-3;
428 out[13][0] = 6*in[0];
430 out[13][2] =-6*in[2]+3;
433 out[14][1] = 6*in[1]-6;
434 out[14][2] =-6*in[2]+3;
437 out[15][1] =-6*in[1];
438 out[15][2] = 6*in[2]-3;
442 out[16][2] =-6*in[1]+3;
446 out[17][2] = 6*in[1]-3;
463 std::array<R,6> sign_;
First order Brezzi-Douglas-Marini shape functions on the reference hexahedron.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:29
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:133
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:66
void partial(const std::array< unsigned int, 3 > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:217
BDM1Cube3DLocalBasis(std::bitset< 6 > s)
Make set number s, where 0 <= s < 64.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:48
unsigned int order() const
Polynomial order of the shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:457
BDM1Cube3DLocalBasis()
Standard constructor.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:37
unsigned int size() const
number of shape functions
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:55
A dense n x m matrix.
Definition: fmatrix.hh:68
vector space out of a tensor product of fields.
Definition: fvector.hh:93
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
T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:331
Dune namespace.
Definition: alignedallocator.hh:10
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43