DUNE PDELab (git)

raviartthomas1cube3dlocalbasis.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
6#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
7
8#include <numeric>
9#include <vector>
10
12
13#include "../../common/localbasis.hh"
14
15namespace Dune
16{
26 template<class D, class R>
28 {
29
30 public:
33
39 RT1Cube3DLocalBasis (unsigned int s = 0)
40 {
41 sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
42 if (s & 1)
43 {
44 sign0 = -1.0;
45 }
46 if (s & 2)
47 {
48 sign1 = -1.0;
49 }
50 if (s & 4)
51 {
52 sign2 = -1.0;
53 }
54 if (s & 8)
55 {
56 sign3 = -1.0;
57 }
58 if (s & 16)
59 {
60 sign4 = -1.0;
61 }
62 if (s & 32)
63 {
64 sign5 = -1.0;
65 }
66 }
67
69 unsigned int size () const
70 {
71 return 36;
72 }
73
80 inline void evaluateFunction (const typename Traits::DomainType& in,
81 std::vector<typename Traits::RangeType>& out) const
82 {
83 out.resize(36);
84
85 out[0][0] = sign0*(-3.0*in[0]*in[0] + 4.0*in[0] - 1.0);
86 out[0][1] = 0.0;
87 out[0][2] = 0.0;
88
89 out[1][0] = sign1*(-2.0*in[0] + 3.0*in[0]*in[0]);
90 out[1][1] = 0.0;
91 out[1][2] = 0.0;
92
93 out[2][0] = 0.0;
94 out[2][1] = sign2*(-3.0*in[1]*in[1] + 4.0*in[1] - 1.0);
95 out[2][2] = 0.0;
96
97 out[3][0] = 0.0;
98 out[3][1] = sign3*(3.0*in[1]*in[1] - 2.0*in[1]);
99 out[3][2] = 0.0;
100
101 out[4][0] = 0.0;
102 out[4][1] = 0.0;
103 out[4][2] = sign4*(-3.0*in[2]*in[2] + 4.0*in[2] - 1.0);
104
105 out[5][0] = 0.0;
106 out[5][1] = 0.0;
107 out[5][2] = sign5*(3.0*in[2]*in[2] - 2.0*in[2]);
108
109 out[6][0] = -18.0*in[0]*in[0]*in[1] + 9.0*in[0]*in[0] + 24.0*in[0]*in[1] - 6.0*in[1] -12.0*in[0] + 3.0;
110 out[6][1] = 0.0;
111 out[6][2] = 0.0;
112
113 out[7][0] = -18.0*in[0]*in[0]*in[1] + 9.0*in[0]*in[0] + 12.0*in[0]*in[1] - 6.0*in[0];
114 out[7][1] = 0.0;
115 out[7][2] = 0.0;
116
117 out[8][0] = 0.0;
118 out[8][1] = 18.0*in[0]*in[1]*in[1] - 9.0*in[1]*in[1] - 24.0*in[0]*in[1] + 12.0*in[1] + 6.0*in[0] - 3.0;
119 out[8][2] = 0.0;
120
121 out[9][0] = 0.0;
122 out[9][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];
123 out[9][2] = 0.0;
124
125 out[10][0] = 0.0;
126 out[10][1] = 0.0;
127 out[10][2] = -3.0 + 6.0*in[0] + 12.0*in[2] - 24.0*in[0]*in[2] - 9.0*in[2]*in[2] + 18.0*in[0]*in[2]*in[2];
128
129 out[11][0] = 0.0;
130 out[11][1] = 0.0;
131 out[11][2] = 6.0*in[2] - 12.0*in[0]*in[2] - 9.0*in[2]*in[2] + 18.0*in[0]*in[2]*in[2];
132
133 out[12][0] = 3.0 - 12.0*in[0] - 6.0*in[2] + 24.0*in[0]*in[2] + 9.0*in[0]*in[0] - 18.0*in[0]*in[0]*in[2];
134 out[12][1] = 0.0;
135 out[12][2] = 0.0;
136
137 out[13][0] = -6.0*in[0] + 12.0*in[0]*in[2] + 9.0*in[0]*in[0] - 18.0*in[0]*in[0]*in[2];
138 out[13][1] = 0.0;
139 out[13][2] = 0.0;
140
141 out[14][0] = 0.0;
142 out[14][1] = 3.0 - 12.0*in[1] - 6.0*in[2] + 24.0*in[1]*in[2] + 9.0*in[1]*in[1] - 18.0*in[1]*in[1]*in[2];
143 out[14][2] = 0.0;
144
145 out[15][0] = 0.0;
146 out[15][1] = -6.0*in[1] + 12.0*in[1]*in[2] + 9.0*in[1]*in[1] - 18.0*in[1]*in[1]*in[2];
147 out[15][2] = 0.0;
148
149 out[16][0] = 0.0;
150 out[16][1] = 0.0;
151 out[16][2] = -3.0 + 6.0*in[1] + 12.0*in[2] - 24.0*in[1]*in[2] - 9.0*in[2]*in[2] + 18.0*in[1]*in[2]*in[2];
152
153 out[17][0] = 0.0;
154 out[17][1] = 0.0;
155 out[17][2] = 6.0*in[2] - 12.0*in[1]*in[2] - 9.0*in[2]*in[2] + 18.0*in[1]*in[2]*in[2];
156
157 out[18][0] = -9.0 + 36.0*in[0] + 18.0*in[1] + 18.0*in[2] - 72.0*in[0]*in[1] - 72.0*in[0]*in[2] - 36.0*in[1]*in[2] + 144.0*in[0]*in[1]*in[2] - 27.0*in[0]*in[0] + 54.0*in[0]*in[0]*in[1] + 54.0*in[0]*in[0]*in[2] - 108.0*in[0]*in[0]*in[1]*in[2];
158 out[18][1] = 0.0;
159 out[18][2] = 0.0;
160
161 out[19][0] = 18.0*in[0] - 36.0*in[0]*in[1] - 36.0*in[0]*in[2] + 72.0*in[0]*in[1]*in[2] - 27.0*in[0]*in[0] + 54.0*in[0]*in[0]*in[1] + 54.0*in[0]*in[0]*in[2] - 108.0*in[0]*in[0]*in[1]*in[2];
162 out[19][1] = 0.0;
163 out[19][2] = 0.0;
164
165 out[20][0] = 0.0;
166 out[20][1] = 9.0 - 18.0*in[0] - 36.0*in[1] - 18.0*in[2] + 72.0*in[0]*in[1] + 36.0*in[0]*in[2] + 72.0*in[1]*in[2] - 144.0*in[0]*in[1]*in[2] + 27.0*in[1]*in[1] - 54.0*in[1]*in[1]*in[0] - 54.0*in[1]*in[1]*in[2] + 108.0*in[0]*in[1]*in[1]*in[2];
167 out[20][2] = 0.0;
168
169 out[21][0] = 0.0;
170 out[21][1] = -18.0*in[1] + 36.0*in[0]*in[1] + 36.0*in[1]*in[2] - 72.0*in[0]*in[1]*in[2] + 27.0*in[1]*in[1] - 54.0*in[0]*in[1]*in[1] - 54.0*in[1]*in[1]*in[2] + 108.0*in[0]*in[1]*in[1]*in[2];
171 out[21][2] = 0.0;
172
173 out[22][0] = 0.0;
174 out[22][1] = 0.0;
175 out[22][2] = 9.0 - 18.0*in[0] - 18.0*in[1] - 36.0*in[2] + 36.0*in[0]*in[1] + 72.0*in[0]*in[2] + 72.0*in[1]*in[2] - 144.0*in[0]*in[1]*in[2] + 27.0*in[2]*in[2] - 54.0*in[0]*in[2]*in[2] - 54.0*in[1]*in[2]*in[2] + 108.0*in[0]*in[1]*in[2]*in[2];
176
177 out[23][0] = 0.0;
178 out[23][1] = 0.0;
179 out[23][2] = -18.0*in[2] + 36.0*in[0]*in[2] + 36.0*in[1]*in[2] - 72.0*in[0]*in[1]*in[2] + 27.0*in[2]*in[2] - 54.0*in[0]*in[2]*in[2] - 54.0*in[1]*in[2]*in[2] + 108.0*in[0]*in[1]*in[2]*in[2];
180
181 out[24][0] = 96.0*in[0] - 144.0*in[0]*in[1] - 144.0*in[0]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[0]*in[0] + 144.0*in[0]*in[0]*in[1] + 144.0*in[0]*in[0]*in[2] - 216.0*in[0]*in[0]*in[1]*in[2];
182 out[24][1] = 0.0;
183 out[24][2] = 0.0;
184
185 out[25][0] = 0.0;
186 out[25][1] = 96.0*in[1] - 144.0*in[0]*in[1] - 144.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[1]*in[1] + 144.0*in[0]*in[1]*in[1] + 144.0*in[1]*in[1]*in[2] - 216.0*in[0]*in[1]*in[1]*in[2];
187 out[25][2] = 0.0;
188
189 out[26][0] = 0.0;
190 out[26][1] = 0.0;
191 out[26][2] = 96.0*in[2] - 144.0*in[0]*in[2] - 144.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[2]*in[2] + 144.0*in[0]*in[2]*in[2] + 144.0*in[1]*in[2]*in[2] - 216.0*in[0]*in[1]*in[2]*in[2];
192
193 out[27][0] = -144.0*in[0] + 288.0*in[0]*in[1] + 216.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[0]*in[0] - 288.0*in[0]*in[0]*in[1] - 216.0*in[0]*in[0]*in[2] + 432.0*in[0]*in[0]*in[1]*in[2];
194 out[27][1] = 0.0;
195 out[27][2] = 0.0;
196
197 out[28][0] = -144.0*in[0] + 216.0*in[0]*in[1] + 288.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[1] - 288.0*in[0]*in[0]*in[2] + 432.0*in[0]*in[0]*in[1]*in[2];
198 out[28][1] = 0.0;
199 out[28][2] = 0.0;
200
201 out[29][0] = 0.0;
202 out[29][1] = -144.0*in[1] + 288.0*in[0]*in[1] + 216.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[1]*in[1] - 288.0*in[0]*in[1]*in[1] - 216.0*in[1]*in[1]*in[2] + 432.0*in[0]*in[1]*in[1]*in[2];
203 out[29][2] = 0.0;
204
205 out[30][0] = 0.0;
206 out[30][1] = -144.0*in[1] + 216.0*in[0]*in[1] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[1]*in[1] - 216.0*in[0]*in[1]*in[1] - 288.0*in[1]*in[1]*in[2] + 432.0*in[0]*in[1]*in[1]*in[2];
207 out[30][2] = 0.0;
208
209 out[31][0] = 0.0;
210 out[31][1] = 0.0;
211 out[31][2] =-144.0*in[2] + 288.0*in[0]*in[2] + 216.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[2]*in[2] - 288.0*in[0]*in[2]*in[2] - 216.0*in[1]*in[2]*in[2] + 432.0*in[0]*in[1]*in[2]*in[2];
212
213 out[32][0] = 0.0;
214 out[32][1] = 0.0;
215 out[32][2] = -144.0*in[2] + 216.0*in[0]*in[2] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[2]*in[2] - 216.0*in[0]*in[2]*in[2] - 288.0*in[1]*in[2]*in[2] + 432.0*in[0]*in[1]*in[2]*in[2];
216
217 out[33][0] = 216.0*in[0] - 432.0*in[0]*in[1] - 432.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1] + 432.0*in[0]*in[0]*in[2] - 864.0*in[0]*in[0]*in[1]*in[2];
218 out[33][1] = 0.0;
219 out[33][2] = 0.0;
220
221 out[34][0] = 0.0;
222 out[34][1] = 216.0*in[1] - 432.0*in[0]*in[1] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1] + 432.0*in[1]*in[1]*in[2] - 864.0*in[0]*in[1]*in[1]*in[2];
223 out[34][2] = 0.0;
224
225 out[35][0] = 0.0;
226 out[35][1] = 0.0;
227 out[35][2] = 216.0*in[2] - 432.0*in[0]*in[2] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2] + 432.0*in[1]*in[2]*in[2] - 864.0*in[0]*in[1]*in[2]*in[2];
228 }
229
236 inline void evaluateJacobian (const typename Traits::DomainType& in,
237 std::vector<typename Traits::JacobianType>& out) const
238 {
239 out.resize(36);
240
241 out[0][0][0] = sign0*(-6.0*in[0] + 4);
242 out[0][0][1] = 0;
243 out[0][0][2] = 0;
244 out[0][1][0] = 0;
245 out[0][1][1] = 0;
246 out[0][1][2] = 0;
247 out[0][2][0] = 0;
248 out[0][2][1] = 0;
249 out[0][2][2] = 0;
250
251 out[1][0][0] = sign1*(-2 + 6.0*in[0]);
252 out[1][0][1] = 0;
253 out[1][0][2] = 0;
254 out[1][1][0] = 0;
255 out[1][1][1] = 0;
256 out[1][1][2] = 0;
257 out[1][2][0] = 0;
258 out[1][2][1] = 0;
259 out[1][2][2] = 0;
260
261 out[2][0][0] = 0;
262 out[2][0][1] = 0;
263 out[2][0][2] = 0;
264 out[2][1][0] = 0;
265 out[2][1][1] = sign2*(-6.0*in[1] + 4);
266 out[2][1][2] = 0;
267 out[2][2][0] = 0;
268 out[2][2][1] = 0;
269 out[2][2][2] = 0;
270
271 out[3][0][0] = 0;
272 out[3][0][1] = 0;
273 out[3][0][2] = 0;
274 out[3][1][0] = 0;
275 out[3][1][1] = sign3*(6.0*in[1] - 2);
276 out[3][1][2] = 0;
277 out[3][2][0] = 0;
278 out[3][2][1] = 0;
279 out[3][2][2] = 0;
280
281 out[4][0][0] = 0;
282 out[4][0][1] = 0;
283 out[4][0][2] = 0;
284 out[4][1][0] = 0;
285 out[4][1][1] = 0;
286 out[4][1][2] = 0;
287 out[4][2][0] = 0;
288 out[4][2][1] = 0;
289 out[4][2][2] = sign4*(-6.0*in[2] + 4);
290
291 out[5][0][0] = 0;
292 out[5][0][1] = 0;
293 out[5][0][2] = 0;
294 out[5][1][0] = 0;
295 out[5][1][1] = 0;
296 out[5][1][2] = 0;
297 out[5][2][0] = 0;
298 out[5][2][1] = 0;
299 out[5][2][2] = sign5*(6.0*in[2] - 2);
300
301 out[6][0][0] = -36.0*in[0]*in[1] + 18.0*in[0] + 24.0*in[1] - 12.0;
302 out[6][0][1] = -18.0*in[0]*in[0] + 24.0*in[0] - 6;
303 out[6][0][2] = 0.0;
304 out[6][1][0] = 0.0;
305 out[6][1][1] = 0.0;
306 out[6][1][2] = 0.0;
307 out[6][2][0] = 0.0;
308 out[6][2][1] = 0.0;
309 out[6][2][2] = 0.0;
310
311 out[7][0][0] = -36.0*in[0]*in[1] + 18.0*in[0] + 12.0*in[1] - 6.0;
312 out[7][0][1] = -18.0*in[0]*in[0] + 12.0*in[0];
313 out[7][0][2] = 0.0;
314 out[7][1][0] = 0.0;
315 out[7][1][1] = 0.0;
316 out[7][1][2] = 0.0;
317 out[7][2][0] = 0.0;
318 out[7][2][1] = 0.0;
319 out[7][2][2] = 0.0;
320
321 out[8][0][0] = 0.0;
322 out[8][0][1] = 0.0;
323 out[8][0][2] = 0.0;
324 out[8][1][0] = 18.0*in[1]*in[1] - 24.0*in[1] + 6.0;
325 out[8][1][1] = 36.0*in[0]*in[1] - 18.0*in[1] - 24.0*in[0] + 12.0;
326 out[8][1][2] = 0.0;
327 out[8][2][0] = 0.0;
328 out[8][2][1] = 0.0;
329 out[8][2][2] = 0.0;
330
331 out[9][0][0] = 0.0;
332 out[9][0][1] = 0.0;
333 out[9][0][2] = 0.0;
334 out[9][1][0] = -12.0*in[1] + 18.0*in[1]*in[1];
335 out[9][1][1] = 6.0 - 12.0*in[0] - 18.0*in[1] + 36.0*in[0]*in[1];;
336 out[9][1][2] = 0.0;
337 out[9][2][0] = 0.0;
338 out[9][2][1] = 0.0;
339 out[9][2][2] = 0.0;
340
341 out[10][0][0] = 0.0;
342 out[10][0][1] = 0.0;
343 out[10][0][2] = 0.0;
344 out[10][1][0] = 0.0;
345 out[10][1][1] = 0.0;
346 out[10][1][2] = 0.0;
347 out[10][2][0] = 6.0 - 24.0*in[2] + 18.0*in[2]*in[2];
348 out[10][2][1] = 0.0;
349 out[10][2][2] = 12.0 - 24.0*in[0] - 18.0*in[2] + 36.0*in[0]*in[2];
350
351 out[11][0][0] = 0.0;
352 out[11][0][1] = 0.0;
353 out[11][0][2] = 0.0;
354 out[11][1][0] = 0.0;
355 out[11][1][1] = 0.0;
356 out[11][1][2] = 0.0;
357 out[11][2][0] = -12.0*in[2] + 18.0*in[2]*in[2];
358 out[11][2][1] = 0.0;
359 out[11][2][2] = 6.0 - 12.0*in[0] - 18.0*in[2] + 36.0*in[0]*in[2];
360
361 out[12][0][0] = -12.0 + 24.0*in[2] + 18.0*in[0] - 36.0*in[0]*in[2];
362 out[12][0][1] = 0.0;
363 out[12][0][2] = -6.0 + 24.0*in[0] - 18.0*in[0]*in[0];
364 out[12][1][0] = 0.0;
365 out[12][1][1] = 0.0;
366 out[12][1][2] = 0.0;
367 out[12][2][0] = 0.0;
368 out[12][2][1] = 0.0;
369 out[12][2][2] = 0.0;
370
371 out[13][0][0] = -6.0 + 12.0*in[2] + 18.0*in[0] - 36.0*in[0]*in[2];
372 out[13][0][1] = 0.0;
373 out[13][0][2] = 12.0*in[0] - 18.0*in[0]*in[0];
374 out[13][1][0] = 0.0;
375 out[13][1][1] = 0.0;
376 out[13][1][2] = 0.0;
377 out[13][2][0] = 0.0;
378 out[13][2][1] = 0.0;
379 out[13][2][2] = 0.0;
380
381 out[14][0][0] = 0.0;
382 out[14][0][1] = 0.0;
383 out[14][0][2] = 0.0;
384 out[14][1][0] = 0.0;
385 out[14][1][1] = -12.0 + 24.0*in[2] + 18.0*in[1] - 36.0*in[1]*in[2];
386 out[14][1][2] = -6.0 + 24.0*in[1] - 18.0*in[1]*in[1];
387 out[14][2][0] = 0.0;
388 out[14][2][1] = 0.0;
389 out[14][2][2] = 0.0;
390
391 out[15][0][0] = 0.0;
392 out[15][0][1] = 0.0;
393 out[15][0][2] = 0.0;
394 out[15][1][0] = 0.0;
395 out[15][1][1] = -6.0 + 12.0*in[2] + 18.0*in[1] - 36.0*in[1]*in[2];
396 out[15][1][2] = 12.0*in[1] - 18.0*in[1]*in[1];
397 out[15][2][0] = 0.0;
398 out[15][2][1] = 0.0;
399 out[15][2][2] = 0.0;
400
401 out[16][0][0] = 0.0;
402 out[16][0][1] = 0.0;
403 out[16][0][2] = 0.0;
404 out[16][1][0] = 0.0;
405 out[16][1][1] = 0.0;
406 out[16][1][2] = 0.0;
407 out[16][2][0] = 0.0;
408 out[16][2][1] = 6.0 - 24.0*in[2] + 18.0*in[2]*in[2];
409 out[16][2][2] = 12.0 - 24.0*in[1] - 18.0*in[2] + 36.0*in[1]*in[2];
410
411 out[17][0][0] = 0.0;
412 out[17][0][1] = 0.0;
413 out[17][0][2] = 0.0;
414 out[17][1][0] = 0.0;
415 out[17][1][1] = 0.0;
416 out[17][1][2] = 0.0;
417 out[17][2][0] = 0.0;
418 out[17][2][1] = -12.0*in[2] + 18.0*in[2]*in[2];
419 out[17][2][2] = 6.0 - 12.0*in[1] - 18.0*in[2] + 36.0*in[1]*in[2];
420
421 out[18][0][0] = 36.0 - 72.0*in[1] - 72.0*in[2] + 144.0*in[1]*in[2] - 54.0*in[0] + 108.0*in[0]*in[1] + 108.0*in[0]*in[2] - 216.0*in[0]*in[1]*in[2];
422 out[18][0][1] = 18.0 - 72.0*in[0] - 36.0*in[2] + 144.0*in[0]*in[2] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[2];
423 out[18][0][2] = 18.0 - 72.0*in[0] - 36.0*in[1] + 144.0*in[0]*in[1] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[1];
424 out[18][1][0] = 0.0;
425 out[18][1][1] = 0.0;
426 out[18][1][2] = 0.0;
427 out[18][2][0] = 0.0;
428 out[18][2][1] = 0.0;
429 out[18][2][2] = 0.0;
430
431 out[19][0][0] = 18 - 36.0*in[1] - 36.0*in[2] + 72.0*in[1]*in[2] - 54.0*in[0] + 108.0*in[0]*in[1] + 108.0*in[0]*in[2] - 216.0*in[0]*in[1]*in[2];
432 out[19][0][1] = -36.0*in[0] + 72.0*in[0]*in[2] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[2];
433 out[19][0][2] = -36.0*in[0] + 72.0*in[0]*in[1] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[1];
434 out[19][1][0] = 0.0;
435 out[19][1][1] = 0.0;
436 out[19][1][2] = 0.0;
437 out[19][2][0] = 0.0;
438 out[19][2][1] = 0.0;
439 out[19][2][2] = 0.0;
440
441 out[20][0][0] = 0.0;
442 out[20][0][1] = 0.0;
443 out[20][0][2] = 0.0;
444 out[20][1][0] = -18.0 + 72.0*in[1] + 36.0*in[2] - 144.0*in[1]*in[2] - 54.0*in[1]*in[1] + 108.0*in[1]*in[1]*in[2];
445 out[20][1][1] = -36.0 + 72.0*in[0] + 72.0*in[2] - 144.0*in[0]*in[2] + 54.0*in[1] - 108.0*in[1]*in[0] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
446 out[20][1][2] = -18.0 + 36.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1] - 54.0*in[1]*in[1] + 108.0*in[0]*in[1]*in[1];
447 out[20][2][0] = 0.0;
448 out[20][2][1] = 0.0;
449 out[20][2][2] = 0.0;
450
451 out[21][0][0] = 0.0;
452 out[21][0][1] = 0.0;
453 out[21][0][2] = 0.0;
454 out[21][1][0] = 36.0*in[1] - 72.0*in[1]*in[2] - 54.0*in[1]*in[1] + 108.0*in[1]*in[1]*in[2];
455 out[21][1][1] = -18.0 + 36.0*in[0] + 36.0*in[2] - 72.0*in[0]*in[2] + 54.0*in[1] - 108.0*in[0]*in[1] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
456 out[21][1][2] = 36.0*in[1] - 72.0*in[0]*in[1] - 54.0*in[1]*in[1] + 108.0*in[0]*in[1]*in[1];
457 out[21][2][0] = 0.0;
458 out[21][2][1] = 0.0;
459 out[21][2][2] = 0.0;
460
461 out[22][0][0] = 0.0;
462 out[22][0][1] = 0.0;
463 out[22][0][2] = 0.0;
464 out[22][1][0] = 0.0;
465 out[22][1][1] = 0.0;
466 out[22][1][2] = 0.0;
467 out[22][2][0] = -18.0 + 36.0*in[1] + 72.0*in[2] - 144.0*in[1]*in[2] - 54.0*in[2]*in[2] + 108.0*in[1]*in[2]*in[2];
468 out[22][2][1] = -18.0 + 36.0*in[0] + 72.0*in[2] - 144.0*in[0]*in[2] - 54.0*in[2]*in[2] + 108.0*in[0]*in[2]*in[2];
469 out[22][2][2] = -36.0 + 72.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1] + 54.0*in[2] - 108.0*in[0]*in[2] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
470
471 out[23][0][0] = 0.0;
472 out[23][0][1] = 0.0;
473 out[23][0][2] = 0.0;
474 out[23][1][0] = 0.0;
475 out[23][1][1] = 0.0;
476 out[23][1][2] = 0.0;
477 out[23][2][0] = 36.0*in[2] - 72.0*in[1]*in[2] - 54.0*in[2]*in[2] + 108.0*in[1]*in[2]*in[2];
478 out[23][2][1] = 36.0*in[2] - 72.0*in[0]*in[2] - 54.0*in[2]*in[2] + 108.0*in[0]*in[2]*in[2];
479 out[23][2][2] = -18.0 + 36.0*in[0] + 36.0*in[1] - 72.0*in[0]*in[1] + 54.0*in[2] - 108.0*in[0]*in[2] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
480
481 out[24][0][0] = 96.0 - 144.0*in[1] - 144.0*in[2] + 216.0*in[1]*in[2] - 192.0*in[0] + 288.0*in[0]*in[1] + 288.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2];
482 out[24][0][1] = -144.0*in[0] + 216.0*in[0]*in[2] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[2];
483 out[24][0][2] = -144.0*in[0] + 216.0*in[0]*in[1] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[1];
484 out[24][1][0] = 0.0;
485 out[24][1][1] = 0.0;
486 out[24][1][2] = 0.0;
487 out[24][2][0] = 0.0;
488 out[24][2][1] = 0.0;
489 out[24][2][2] = 0.0;
490
491 out[25][0][0] = 0.0;
492 out[25][0][1] = 0.0;
493 out[25][0][2] = 0.0;
494 out[25][1][0] = -144.0*in[1] + 216.0*in[1]*in[2] + 144.0*in[1]*in[1] - 216.0*in[1]*in[1]*in[2];
495 out[25][1][1] = 96.0 - 144.0*in[0] - 144.0*in[2] + 216.0*in[0]*in[2] - 192.0*in[1] + 288.0*in[0]*in[1] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2];
496 out[25][1][2] = -144.0*in[1] + 216.0*in[0]*in[1] + 144.0*in[1]*in[1] - 216.0*in[0]*in[1]*in[1];
497 out[25][2][0] = 0.0;
498 out[25][2][1] = 0.0;
499 out[25][2][2] = 0.0;
500
501 out[26][0][0] = 0.0;
502 out[26][0][1] = 0.0;
503 out[26][0][2] = 0.0;
504 out[26][1][0] = 0.0;
505 out[26][1][1] = 0.0;
506 out[26][1][2] = 0.0;
507 out[26][2][0] = -144.0*in[2] + 216.0*in[1]*in[2] + 144.0*in[2]*in[2] - 216.0*in[1]*in[2]*in[2];
508 out[26][2][1] = -144.0*in[2] + 216.0*in[0]*in[2] + 144.0*in[2]*in[2] - 216.0*in[0]*in[2]*in[2];
509 out[26][2][2] = 96.0 - 144.0*in[0] - 144.0*in[1] + 216.0*in[0]*in[1] - 192.0*in[2] + 288.0*in[0]*in[2] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2];
510
511 out[27][0][0] = -144.0 + 288.0*in[1] + 216.0*in[2] - 432.0*in[1]*in[2] + 288.0*in[0] - 576.0*in[0]*in[1] - 432.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2];
512 out[27][0][1] = 288.0*in[0] - 432.0*in[0]*in[2] - 288.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[2];
513 out[27][0][2] = 216.0*in[0] - 432.0*in[0]*in[1] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1];
514 out[27][1][0] = 0.0;
515 out[27][1][1] = 0.0;
516 out[27][1][2] = 0.0;
517 out[27][2][0] = 0.0;
518 out[27][2][1] = 0.0;
519 out[27][2][2] = 0.0;
520
521 out[28][0][0] = -144.0 + 216.0*in[1] + 288.0*in[2] - 432.0*in[1]*in[2] + 288.0*in[0] - 432.0*in[0]*in[1] - 576.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2];
522 out[28][0][1] = 216.0*in[0] - 432.0*in[0]*in[2] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[2];
523 out[28][0][2] = 288.0*in[0] - 432.0*in[0]*in[1] - 288.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1];
524 out[28][1][0] = 0.0;
525 out[28][1][1] = 0.0;
526 out[28][1][2] = 0.0;
527 out[28][2][0] = 0.0;
528 out[28][2][1] = 0.0;
529 out[28][2][2] = 0.0;
530
531 out[29][0][0] = 0.0;
532 out[29][0][1] = 0.0;
533 out[29][0][2] = 0.0;
534 out[29][1][0] = 288.0*in[1] - 432.0*in[1]*in[2] - 288.0*in[1]*in[1] + 432.0*in[1]*in[1]*in[2];
535 out[29][1][1] = -144.0 + 288.0*in[0] + 216.0*in[2] - 432.0*in[0]*in[2] + 288.0*in[1] - 576.0*in[0]*in[1] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
536 out[29][1][2] = 216.0*in[1] - 432.0*in[0]*in[1] - 216.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1];
537 out[29][2][0] = 0.0;
538 out[29][2][1] = 0.0;
539 out[29][2][2] = 0.0;
540
541 out[30][0][0] = 0.0;
542 out[30][0][1] = 0.0;
543 out[30][0][2] = 0.0;
544 out[30][1][0] = 216.0*in[1] - 432.0*in[1]*in[2] - 216.0*in[1]*in[1] + 432.0*in[1]*in[1]*in[2];
545 out[30][1][1] = -144.0 + 216.0*in[0] + 288.0*in[2] - 432.0*in[0]*in[2] + 288.0*in[1] - 432.0*in[0]*in[1] - 576.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
546 out[30][1][2] = 288.0*in[1] - 432.0*in[0]*in[1] - 288.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1];
547 out[30][2][0] = 0.0;
548 out[30][2][1] = 0.0;
549 out[30][2][2] = 0.0;
550
551 out[31][0][0] = 0.0;
552 out[31][0][1] = 0.0;
553 out[31][0][2] = 0.0;
554 out[31][1][0] = 0.0;
555 out[31][1][1] = 0.0;
556 out[31][1][2] = 0.0;
557 out[31][2][0] = 288.0*in[2] - 432.0*in[1]*in[2] - 288.0*in[2]*in[2] + 432.0*in[1]*in[2]*in[2];
558 out[31][2][1] = 216.0*in[2] - 432.0*in[0]*in[2] - 216.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2];
559 out[31][2][2] = -144.0 + 288.0*in[0] + 216.0*in[1] - 432.0*in[0]*in[1] + 288.0*in[2] - 576.0*in[0]*in[2] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
560
561 out[32][0][0] = 0.0;
562 out[32][0][1] = 0.0;
563 out[32][0][2] = 0.0;
564 out[32][1][0] = 0.0;
565 out[32][1][1] = 0.0;
566 out[32][1][2] = 0.0;
567 out[32][2][0] = 216.0*in[2] - 432.0*in[1]*in[2] - 216.0*in[2]*in[2] + 432.0*in[1]*in[2]*in[2];
568 out[32][2][1] = 288.0*in[2] - 432.0*in[0]*in[2] - 288.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2];
569 out[32][2][2] = -144.0 + 216.0*in[0] + 288.0*in[1] - 432.0*in[0]*in[1] + 288.0*in[2] - 432.0*in[0]*in[2] - 576.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
570
571 out[33][0][0] = 216.0 - 432.0*in[1] - 432.0*in[2] + 864.0*in[1]*in[2] - 432.0*in[0] + 864.0*in[0]*in[1] + 864.0*in[0]*in[2] - 1728.0*in[0]*in[1]*in[2];
572 out[33][0][1] = -432.0*in[0] + 864.0*in[0]*in[2] + 432.0*in[0]*in[0] - 864.0*in[0]*in[0]*in[2];
573 out[33][0][2] = -432.0*in[0] + 864.0*in[0]*in[1] + 432.0*in[0]*in[0] - 864.0*in[0]*in[0]*in[1];
574 out[33][1][0] = 0.0;
575 out[33][1][1] = 0.0;
576 out[33][1][2] = 0.0;
577 out[33][2][0] = 0.0;
578 out[33][2][1] = 0.0;
579 out[33][2][2] = 0.0;
580
581 out[34][0][0] = 0.0;
582 out[34][0][1] = 0.0;
583 out[34][0][2] = 0.0;
584 out[34][1][0] = -432.0*in[1] + 864.0*in[1]*in[2] + 432.0*in[1]*in[1] - 864.0*in[1]*in[1]*in[2];
585 out[34][1][1] = 216.0 - 432.0*in[0] - 432.0*in[2] + 864.0*in[0]*in[2] - 432.0*in[1] + 864.0*in[0]*in[1] + 864.0*in[1]*in[2] - 1728.0*in[0]*in[1]*in[2];
586 out[34][1][2] = -432.0*in[1] + 864.0*in[0]*in[1] + 432.0*in[1]*in[1] - 864.0*in[0]*in[1]*in[1];
587 out[34][2][0] = 0.0;
588 out[34][2][1] = 0.0;
589 out[34][2][2] = 0.0;
590
591 out[35][0][0] = 0.0;
592 out[35][0][1] = 0.0;
593 out[35][0][2] = 0.0;
594 out[35][1][0] = 0.0;
595 out[35][1][1] = 0.0;
596 out[35][1][2] = 0.0;
597 out[35][2][0] = -432.0*in[2] + 864.0*in[1]*in[2] + 432.0*in[2]*in[2] - 864.0*in[1]*in[2]*in[2];
598 out[35][2][1] = -432.0*in[2] + 864.0*in[0]*in[2] + 432.0*in[2]*in[2] - 864.0*in[0]*in[2]*in[2];
599 out[35][2][2] = 216.0 - 432.0*in[0] - 432.0*in[1] + 864.0*in[0]*in[1] - 432.0*in[2] + 864.0*in[0]*in[2] + 864.0*in[1]*in[2] - 1728.0*in[0]*in[1]*in[2];
600 }
601
603 void partial (const std::array<unsigned int, 3>& order,
604 const typename Traits::DomainType& in, // position
605 std::vector<typename Traits::RangeType>& out) const // return value
606 {
607 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
608 if (totalOrder == 0) {
609 evaluateFunction(in, out);
610 } else {
611 DUNE_THROW(NotImplemented, "Desired derivative order is not implemented");
612 }
613 }
614
616 unsigned int order () const
617 {
618 return 3;
619 }
620
621 private:
622 R sign0, sign1, sign2, sign3, sign4, sign5;
623 };
624}
625#endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
A dense n x m matrix.
Definition: fmatrix.hh:117
Default exception for dummy implementations.
Definition: exceptions.hh:263
First order Raviart-Thomas shape functions on the reference hexahedron.
Definition: raviartthomas1cube3dlocalbasis.hh:28
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: raviartthomas1cube3dlocalbasis.hh:603
unsigned int size() const
number of shape functions
Definition: raviartthomas1cube3dlocalbasis.hh:69
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:80
RT1Cube3DLocalBasis(unsigned int s=0)
Make set number s, where 0 <= s < 64.
Definition: raviartthomas1cube3dlocalbasis.hh:39
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:236
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:616
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:279
Dune namespace.
Definition: alignedallocator.hh:13
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:35
D DomainType
domain type
Definition: localbasis.hh:43
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)