5#ifndef DUNE_LOCALFUNCTIONS_LAGRANGE_LAGRANGEPRISM_HH
6#define DUNE_LOCALFUNCTIONS_LAGRANGE_LAGRANGEPRISM_HH
22namespace Dune {
namespace Impl
26 template<
int compileTimeOrder>
27 struct LagrangePrismOrderTraits;
30 template<
int compileTimeOrder>
31 requires (compileTimeOrder >= 0)
32 struct LagrangePrismOrderTraits<compileTimeOrder>
34 static constexpr bool is_static_order =
true;
36 constexpr LagrangePrismOrderTraits(
int = compileTimeOrder)
38 static_assert((0 <= compileTimeOrder) and (compileTimeOrder <= 2),
"LagrangePrism: Only order 0,1, and 2 are supported");
44 static constexpr unsigned int order() {
45 return compileTimeOrder;
52 return binomial(compileTimeOrder+2,2) * (compileTimeOrder+1);
59 struct LagrangePrismOrderTraits<-1>
61 unsigned int runTimeOrder_;
64 static constexpr bool is_static_order =
false;
66 constexpr explicit LagrangePrismOrderTraits(
int runTimeOrder)
67 : runTimeOrder_(runTimeOrder >= 0 ? (unsigned int)(runTimeOrder) : 0u)
68 , size_(
binomial(runTimeOrder+2,2) * (runTimeOrder+1))
70 if ((runTimeOrder < 0) or (runTimeOrder > 2))
77 constexpr unsigned int order()
const
100 template<
class D,
class R,
int compileTimeOrder>
101 class LagrangePrismLocalBasis
102 :
public LagrangePrismOrderTraits<compileTimeOrder>
104 using OrderTraits = LagrangePrismOrderTraits<compileTimeOrder>;
107 using Traits = LocalBasisTraits<D,dim,FieldVector<D,dim>,R,1,FieldVector<R,1>,FieldMatrix<R,1,dim> >;
109 constexpr LagrangePrismLocalBasis(OrderTraits orderTraits)
110 : OrderTraits(orderTraits)
113 using OrderTraits::order;
114 using OrderTraits::size;
131 out[0] = (1.0-in[0]-in[1])*(1.0-in[2]);
132 out[1] = in[0]*(1-in[2]);
133 out[2] = in[1]*(1-in[2]);
134 out[3] = in[2]*(1.0-in[0]-in[1]);
135 out[4] = in[0]*in[2];
136 out[5] = in[1]*in[2];
143 FieldVector<R,3> segmentShapeFunction;
144 segmentShapeFunction[0] = 1 + in[2] * (-3 + 2*in[2]);
145 segmentShapeFunction[1] = in[2] * (4 - 4*in[2]);
146 segmentShapeFunction[2] = in[2] * (-1 + 2*in[2]);
148 FieldVector<R, 6> triangleShapeFunction;
149 triangleShapeFunction[0] = 2 * (1 - in[0] - in[1]) * (0.5 - in[0] - in[1]);
150 triangleShapeFunction[1] = 2 * in[0] * (-0.5 + in[0]);
151 triangleShapeFunction[2] = 2 * in[1] * (-0.5 + in[1]);
152 triangleShapeFunction[3] = 4*in[0] * (1 - in[0] - in[1]);
153 triangleShapeFunction[4] = 4*in[1] * (1 - in[0] - in[1]);
154 triangleShapeFunction[5] = 4*in[0]*in[1];
157 out[0] = triangleShapeFunction[0] * segmentShapeFunction[0];
158 out[1] = triangleShapeFunction[1] * segmentShapeFunction[0];
159 out[2] = triangleShapeFunction[2] * segmentShapeFunction[0];
162 out[3] = triangleShapeFunction[0] * segmentShapeFunction[2];
163 out[4] = triangleShapeFunction[1] * segmentShapeFunction[2];
164 out[5] = triangleShapeFunction[2] * segmentShapeFunction[2];
167 out[6] = triangleShapeFunction[0] * segmentShapeFunction[1];
168 out[7] = triangleShapeFunction[1] * segmentShapeFunction[1];
169 out[8] = triangleShapeFunction[2] * segmentShapeFunction[1];
172 out[9] = triangleShapeFunction[3] * segmentShapeFunction[0];
173 out[10] = triangleShapeFunction[4] * segmentShapeFunction[0];
174 out[11] = triangleShapeFunction[5] * segmentShapeFunction[0];
177 out[12] = triangleShapeFunction[3] * segmentShapeFunction[2];
178 out[13] = triangleShapeFunction[4] * segmentShapeFunction[2];
179 out[14] = triangleShapeFunction[5] * segmentShapeFunction[2];
182 out[15] = triangleShapeFunction[3] * segmentShapeFunction[1];
183 out[16] = triangleShapeFunction[4] * segmentShapeFunction[1];
184 out[17] = triangleShapeFunction[5] * segmentShapeFunction[1];
189 DUNE_THROW(NotImplemented,
"LagrangePrismLocalBasis::evaluateFunction for order " << order());
211 out[0][0] = {in[2]-1, in[2]-1, in[0]+in[1]-1};
212 out[1][0] = {1-in[2], 0, -in[0]};
213 out[2][0] = { 0, 1-in[2], -in[1]};
214 out[3][0] = { -in[2], -in[2], 1-in[0]-in[1]};
215 out[4][0] = { in[2], 0, in[0]};
216 out[5][0] = { 0, in[2], in[1]};
224 FieldVector<R, 6> triangleShapeFunction;
225 triangleShapeFunction[0] = 2 * (1 - in[0] - in[1]) * (0.5 - in[0] - in[1]);
226 triangleShapeFunction[1] = 2 * in[0] * (-0.5 + in[0]);
227 triangleShapeFunction[2] = 2 * in[1] * (-0.5 + in[1]);
228 triangleShapeFunction[3] = 4*in[0] * (1 - in[0] - in[1]);
229 triangleShapeFunction[4] = 4*in[1] * (1 - in[0] - in[1]);
230 triangleShapeFunction[5] = 4*in[0]*in[1];
233 triangleShapeFunctionDer[0] = {-3 + 4*(in[0] + in[1]), -3 + 4*(in[0] + in[1])};
234 triangleShapeFunctionDer[1] = { -1 + 4*in[0], 0};
235 triangleShapeFunctionDer[2] = { 0, -1 + 4*in[1]};
236 triangleShapeFunctionDer[3] = { 4 - 8*in[0] - 4*in[1], -4*in[0]};
237 triangleShapeFunctionDer[4] = { -4*in[1], 4 - 4*in[0] - 8*in[1]};
238 triangleShapeFunctionDer[5] = { 4*in[1], 4*in[0]};
241 FieldVector<R,3> segmentShapeFunction;
242 segmentShapeFunction[0] = 1 + in[2] * (-3 + 2*in[2]);
243 segmentShapeFunction[1] = in[2] * ( 4 - 4*in[2]);
244 segmentShapeFunction[2] = in[2] * (-1 + 2*in[2]);
246 FieldVector<R,3> segmentShapeFunctionDer;
247 segmentShapeFunctionDer[0] = -3 + 4*in[2];
248 segmentShapeFunctionDer[1] = 4 - 8*in[2];
249 segmentShapeFunctionDer[2] = -1 + 4*in[2];
252 out[0][0][0] = triangleShapeFunctionDer[0][0] * segmentShapeFunction[0];
253 out[0][0][1] = triangleShapeFunctionDer[0][1] * segmentShapeFunction[0];
254 out[0][0][2] = triangleShapeFunction[0] * segmentShapeFunctionDer[0];
256 out[1][0][0] = triangleShapeFunctionDer[1][0] * segmentShapeFunction[0];
257 out[1][0][1] = triangleShapeFunctionDer[1][1] * segmentShapeFunction[0];
258 out[1][0][2] = triangleShapeFunction[1] * segmentShapeFunctionDer[0];
260 out[2][0][0] = triangleShapeFunctionDer[2][0] * segmentShapeFunction[0];
261 out[2][0][1] = triangleShapeFunctionDer[2][1] * segmentShapeFunction[0];
262 out[2][0][2] = triangleShapeFunction[2] * segmentShapeFunctionDer[0];
265 out[3][0][0] = triangleShapeFunctionDer[0][0] * segmentShapeFunction[2];
266 out[3][0][1] = triangleShapeFunctionDer[0][1] * segmentShapeFunction[2];
267 out[3][0][2] = triangleShapeFunction[0] * segmentShapeFunctionDer[2];
269 out[4][0][0] = triangleShapeFunctionDer[1][0] * segmentShapeFunction[2];
270 out[4][0][1] = triangleShapeFunctionDer[1][1] * segmentShapeFunction[2];
271 out[4][0][2] = triangleShapeFunction[1] * segmentShapeFunctionDer[2];
273 out[5][0][0] = triangleShapeFunctionDer[2][0] * segmentShapeFunction[2];
274 out[5][0][1] = triangleShapeFunctionDer[2][1] * segmentShapeFunction[2];
275 out[5][0][2] = triangleShapeFunction[2] * segmentShapeFunctionDer[2];
278 out[6][0][0] = triangleShapeFunctionDer[0][0] * segmentShapeFunction[1];
279 out[6][0][1] = triangleShapeFunctionDer[0][1] * segmentShapeFunction[1];
280 out[6][0][2] = triangleShapeFunction[0] * segmentShapeFunctionDer[1];
282 out[7][0][0] = triangleShapeFunctionDer[1][0] * segmentShapeFunction[1];
283 out[7][0][1] = triangleShapeFunctionDer[1][1] * segmentShapeFunction[1];
284 out[7][0][2] = triangleShapeFunction[1] * segmentShapeFunctionDer[1];
286 out[8][0][0] = triangleShapeFunctionDer[2][0] * segmentShapeFunction[1];
287 out[8][0][1] = triangleShapeFunctionDer[2][1] * segmentShapeFunction[1];
288 out[8][0][2] = triangleShapeFunction[2] * segmentShapeFunctionDer[1];
291 out[9][0][0] = triangleShapeFunctionDer[3][0] * segmentShapeFunction[0];
292 out[9][0][1] = triangleShapeFunctionDer[3][1] * segmentShapeFunction[0];
293 out[9][0][2] = triangleShapeFunction[3] * segmentShapeFunctionDer[0];
295 out[10][0][0] = triangleShapeFunctionDer[4][0] * segmentShapeFunction[0];
296 out[10][0][1] = triangleShapeFunctionDer[4][1] * segmentShapeFunction[0];
297 out[10][0][2] = triangleShapeFunction[4] * segmentShapeFunctionDer[0];
299 out[11][0][0] = triangleShapeFunctionDer[5][0] * segmentShapeFunction[0];
300 out[11][0][1] = triangleShapeFunctionDer[5][1] * segmentShapeFunction[0];
301 out[11][0][2] = triangleShapeFunction[5] * segmentShapeFunctionDer[0];
304 out[12][0][0] = triangleShapeFunctionDer[3][0] * segmentShapeFunction[2];
305 out[12][0][1] = triangleShapeFunctionDer[3][1] * segmentShapeFunction[2];
306 out[12][0][2] = triangleShapeFunction[3] * segmentShapeFunctionDer[2];
308 out[13][0][0] = triangleShapeFunctionDer[4][0] * segmentShapeFunction[2];
309 out[13][0][1] = triangleShapeFunctionDer[4][1] * segmentShapeFunction[2];
310 out[13][0][2] = triangleShapeFunction[4] * segmentShapeFunctionDer[2];
312 out[14][0][0] = triangleShapeFunctionDer[5][0] * segmentShapeFunction[2];
313 out[14][0][1] = triangleShapeFunctionDer[5][1] * segmentShapeFunction[2];
314 out[14][0][2] = triangleShapeFunction[5] * segmentShapeFunctionDer[2];
317 out[15][0][0] = triangleShapeFunctionDer[3][0] * segmentShapeFunction[1];
318 out[15][0][1] = triangleShapeFunctionDer[3][1] * segmentShapeFunction[1];
319 out[15][0][2] = triangleShapeFunction[3] * segmentShapeFunctionDer[1];
321 out[16][0][0] = triangleShapeFunctionDer[4][0] * segmentShapeFunction[1];
322 out[16][0][1] = triangleShapeFunctionDer[4][1] * segmentShapeFunction[1];
323 out[16][0][2] = triangleShapeFunction[4] * segmentShapeFunctionDer[1];
325 out[17][0][0] = triangleShapeFunctionDer[5][0] * segmentShapeFunction[1];
326 out[17][0][1] = triangleShapeFunctionDer[5][1] * segmentShapeFunction[1];
327 out[17][0][2] = triangleShapeFunction[5] * segmentShapeFunctionDer[1];
332 DUNE_THROW(NotImplemented,
"LagrangePrismLocalBasis::evaluateJacobian for order " << order());
351 evaluateFunction(in, out);
356 if (OrderTraits::order()==0)
363 if (OrderTraits::order()==1)
387 out[0] = in[0]+in[1]-1;
390 out[3] = 1-in[0]-in[1];
395 DUNE_THROW(RangeError,
"Component out of range.");
397 }
else if (totalOrder == 2) {
399 if (order[0] == 1 && order[2] == 1) {
406 }
else if (order[1] == 1 && order[2] == 1) {
426 if (OrderTraits::order()==2)
435 FieldVector<R,6> triangleShapeFunctionDerX;
436 triangleShapeFunctionDerX[0] = -3 + 4*(in[0] + in[1]);
437 triangleShapeFunctionDerX[1] = -1 + 4* in[0];
438 triangleShapeFunctionDerX[2] = 0;
439 triangleShapeFunctionDerX[3] = 4 - 8* in[0] - 4*in[1];
440 triangleShapeFunctionDerX[4] = -4*in[1];
441 triangleShapeFunctionDerX[5] = 4*in[1];
443 FieldVector<R,3> segmentShapeFunction;
444 segmentShapeFunction[0] = 1 + in[2] * (-3 + 2*in[2]);
445 segmentShapeFunction[1] = in[2] * ( 4 - 4*in[2]);
446 segmentShapeFunction[2] = in[2] * (-1 + 2*in[2]);
448 out[0] = triangleShapeFunctionDerX[0] * segmentShapeFunction[0];
449 out[1] = triangleShapeFunctionDerX[1] * segmentShapeFunction[0];
450 out[2] = triangleShapeFunctionDerX[2] * segmentShapeFunction[0];
451 out[3] = triangleShapeFunctionDerX[0] * segmentShapeFunction[2];
452 out[4] = triangleShapeFunctionDerX[1] * segmentShapeFunction[2];
453 out[5] = triangleShapeFunctionDerX[2] * segmentShapeFunction[2];
454 out[6] = triangleShapeFunctionDerX[0] * segmentShapeFunction[1];
455 out[7] = triangleShapeFunctionDerX[1] * segmentShapeFunction[1];
456 out[8] = triangleShapeFunctionDerX[2] * segmentShapeFunction[1];
457 out[9] = triangleShapeFunctionDerX[3] * segmentShapeFunction[0];
458 out[10] = triangleShapeFunctionDerX[4] * segmentShapeFunction[0];
459 out[11] = triangleShapeFunctionDerX[5] * segmentShapeFunction[0];
460 out[12] = triangleShapeFunctionDerX[3] * segmentShapeFunction[2];
461 out[13] = triangleShapeFunctionDerX[4] * segmentShapeFunction[2];
462 out[14] = triangleShapeFunctionDerX[5] * segmentShapeFunction[2];
463 out[15] = triangleShapeFunctionDerX[3] * segmentShapeFunction[1];
464 out[16] = triangleShapeFunctionDerX[4] * segmentShapeFunction[1];
465 out[17] = triangleShapeFunctionDerX[5] * segmentShapeFunction[1];
470 FieldVector<R,6> triangleShapeFunctionDerY;
471 triangleShapeFunctionDerY[0] = -3 + 4*(in[0] + in[1]);
472 triangleShapeFunctionDerY[1] = 0;
473 triangleShapeFunctionDerY[2] = -1 + 4* in[1];
474 triangleShapeFunctionDerY[3] = -4* in[0];
475 triangleShapeFunctionDerY[4] = 4 - 4* in[0] - 8*in[1];
476 triangleShapeFunctionDerY[5] = 4* in[0];
478 FieldVector<R,3> segmentShapeFunction;
479 segmentShapeFunction[0] = 1 + in[2] * (-3 + 2*in[2]);
480 segmentShapeFunction[1] = in[2] * ( 4 - 4*in[2]);
481 segmentShapeFunction[2] = in[2] * (-1 + 2*in[2]);
483 out[0] = triangleShapeFunctionDerY[0] * segmentShapeFunction[0];
484 out[1] = triangleShapeFunctionDerY[1] * segmentShapeFunction[0];
485 out[2] = triangleShapeFunctionDerY[2] * segmentShapeFunction[0];
486 out[3] = triangleShapeFunctionDerY[0] * segmentShapeFunction[2];
487 out[4] = triangleShapeFunctionDerY[1] * segmentShapeFunction[2];
488 out[5] = triangleShapeFunctionDerY[2] * segmentShapeFunction[2];
489 out[6] = triangleShapeFunctionDerY[0] * segmentShapeFunction[1];
490 out[7] = triangleShapeFunctionDerY[1] * segmentShapeFunction[1];
491 out[8] = triangleShapeFunctionDerY[2] * segmentShapeFunction[1];
492 out[9] = triangleShapeFunctionDerY[3] * segmentShapeFunction[0];
493 out[10] = triangleShapeFunctionDerY[4] * segmentShapeFunction[0];
494 out[11] = triangleShapeFunctionDerY[5] * segmentShapeFunction[0];
495 out[12] = triangleShapeFunctionDerY[3] * segmentShapeFunction[2];
496 out[13] = triangleShapeFunctionDerY[4] * segmentShapeFunction[2];
497 out[14] = triangleShapeFunctionDerY[5] * segmentShapeFunction[2];
498 out[15] = triangleShapeFunctionDerY[3] * segmentShapeFunction[1];
499 out[16] = triangleShapeFunctionDerY[4] * segmentShapeFunction[1];
500 out[17] = triangleShapeFunctionDerY[5] * segmentShapeFunction[1];
505 FieldVector<R, 6> triangleShapeFunction;
506 triangleShapeFunction[0] = 2 * (1 - in[0] - in[1]) * (0.5 - in[0] - in[1]);
507 triangleShapeFunction[1] = 2 * in[0] * (-0.5 + in[0]);
508 triangleShapeFunction[2] = 2 * in[1] * (-0.5 + in[1]);
509 triangleShapeFunction[3] = 4*in[0] * (1 - in[0] - in[1]);
510 triangleShapeFunction[4] = 4*in[1] * (1 - in[0] - in[1]);
511 triangleShapeFunction[5] = 4*in[0]*in[1];
513 FieldVector<R,3> segmentShapeFunctionDer;
514 segmentShapeFunctionDer[0] = -3 + 4*in[2];
515 segmentShapeFunctionDer[1] = 4 - 8*in[2];
516 segmentShapeFunctionDer[2] = -1 + 4*in[2];
518 out[0] = triangleShapeFunction[0] * segmentShapeFunctionDer[0];
519 out[1] = triangleShapeFunction[1] * segmentShapeFunctionDer[0];
520 out[2] = triangleShapeFunction[2] * segmentShapeFunctionDer[0];
521 out[3] = triangleShapeFunction[0] * segmentShapeFunctionDer[2];
522 out[4] = triangleShapeFunction[1] * segmentShapeFunctionDer[2];
523 out[5] = triangleShapeFunction[2] * segmentShapeFunctionDer[2];
524 out[6] = triangleShapeFunction[0] * segmentShapeFunctionDer[1];
525 out[7] = triangleShapeFunction[1] * segmentShapeFunctionDer[1];
526 out[8] = triangleShapeFunction[2] * segmentShapeFunctionDer[1];
527 out[9] = triangleShapeFunction[3] * segmentShapeFunctionDer[0];
528 out[10] = triangleShapeFunction[4] * segmentShapeFunctionDer[0];
529 out[11] = triangleShapeFunction[5] * segmentShapeFunctionDer[0];
530 out[12] = triangleShapeFunction[3] * segmentShapeFunctionDer[2];
531 out[13] = triangleShapeFunction[4] * segmentShapeFunctionDer[2];
532 out[14] = triangleShapeFunction[5] * segmentShapeFunctionDer[2];
533 out[15] = triangleShapeFunction[3] * segmentShapeFunctionDer[1];
534 out[16] = triangleShapeFunction[4] * segmentShapeFunctionDer[1];
535 out[17] = triangleShapeFunction[5] * segmentShapeFunctionDer[1];
539 DUNE_THROW(RangeError,
"Component out of range.");
542 DUNE_THROW(NotImplemented,
"Desired derivative order is not implemented");
548 DUNE_THROW(NotImplemented,
"LagrangePrismLocalBasis::partial not implemented for order " << OrderTraits::order());
557 template<
int compileTimeOrder>
558 class LagrangePrismLocalCoefficients
559 :
public LagrangePrismOrderTraits<compileTimeOrder>
561 using OrderTraits = LagrangePrismOrderTraits<compileTimeOrder>;
564 using OrderTraits::order;
565 using OrderTraits::size;
568 LagrangePrismLocalCoefficients (OrderTraits orderTraits)
569 : OrderTraits(orderTraits)
574 localKeys_[0] = LocalKey(0,0,0);
581 localKeys_[i] = LocalKey(i,3,0);
588 localKeys_[0] = LocalKey(0,3,0);
589 localKeys_[1] = LocalKey(1,3,0);
590 localKeys_[2] = LocalKey(2,3,0);
591 localKeys_[3] = LocalKey(3,3,0);
592 localKeys_[4] = LocalKey(4,3,0);
593 localKeys_[5] = LocalKey(5,3,0);
596 localKeys_[6] = LocalKey(0,2,0);
597 localKeys_[7] = LocalKey(1,2,0);
598 localKeys_[8] = LocalKey(2,2,0);
599 localKeys_[9] = LocalKey(3,2,0);
600 localKeys_[10] = LocalKey(4,2,0);
601 localKeys_[11] = LocalKey(5,2,0);
602 localKeys_[12] = LocalKey(6,2,0);
603 localKeys_[13] = LocalKey(7,2,0);
604 localKeys_[14] = LocalKey(8,2,0);
607 localKeys_[15] = LocalKey(0,1,0);
608 localKeys_[16] = LocalKey(1,1,0);
609 localKeys_[17] = LocalKey(2,1,0);
615 DUNE_THROW(NotImplemented,
"LagrangePrismLocalCoefficients not implemented for order " << order());
619 LagrangePrismLocalCoefficients ()
620 requires(OrderTraits::is_static_order)
621 : LagrangePrismLocalCoefficients(OrderTraits())
628 return localKeys_[i];
639 template<
class D,
class R,
int compileTimeOrder>
640 class LagrangePrismLocalInterpolation
641 :
public LagrangePrismOrderTraits<compileTimeOrder>
643 using Traits =
typename LagrangePrismLocalBasis<D,R,compileTimeOrder>::Traits;
644 using OrderTraits = LagrangePrismOrderTraits<compileTimeOrder>;
647 constexpr LagrangePrismLocalInterpolation(OrderTraits orderTraits)
648 : OrderTraits(orderTraits)
658 template<
typename F,
typename C>
661 constexpr auto dim = Traits::dimDomain;
662 auto k = OrderTraits::order();
663 using Domain =
typename Traits::DomainType;
664 using DomainField =
typename Traits::DomainFieldType;
666 out.
resize(OrderTraits::size());
671 auto center = ReferenceElements<DomainField,dim>::general(GeometryTypes::prism).position(0,0);
672 out[0] = Impl::rangeCast(f(center));
679 for (
unsigned int i=0; i<OrderTraits::size(); i++)
681 auto vertex = ReferenceElements<DomainField,3>::general(GeometryTypes::prism).position(i,3);
682 out[i] = Impl::rangeCast(f(vertex));
689 out[0] = Impl::rangeCast( f( Domain( {0.0, 0.0, 0.0} ) ) );
690 out[1] = Impl::rangeCast( f( Domain( {1.0, 0.0, 0.0} ) ) );
691 out[2] = Impl::rangeCast( f( Domain( {0.0, 1.0, 0.0} ) ) );
692 out[3] = Impl::rangeCast( f( Domain( {0.0, 0.0, 1.0} ) ) );
693 out[4] = Impl::rangeCast( f( Domain( {1.0, 0.0, 1.0} ) ) );
694 out[5] = Impl::rangeCast( f( Domain( {0.0, 1.0, 1.0} ) ) );
695 out[6] = Impl::rangeCast( f( Domain( {0.0, 0.0, 0.5} ) ) );
696 out[7] = Impl::rangeCast( f( Domain( {1.0, 0.0, 0.5} ) ) );
697 out[8] = Impl::rangeCast( f( Domain( {0.0, 1.0, 0.5} ) ) );
698 out[9] = Impl::rangeCast( f( Domain( {0.5, 0.0, 0.0} ) ) );
699 out[10] = Impl::rangeCast( f( Domain( {0.0, 0.5, 0.0} ) ) );
700 out[11] = Impl::rangeCast( f( Domain( {0.5, 0.5, 0.0} ) ) );
701 out[12] = Impl::rangeCast( f( Domain( {0.5, 0.0, 1.0} ) ) );
702 out[13] = Impl::rangeCast( f( Domain( {0.0, 0.5, 1.0} ) ) );
703 out[14] = Impl::rangeCast( f( Domain( {0.5, 0.5, 1.0} ) ) );
704 out[15] = Impl::rangeCast( f( Domain( {0.5, 0.0, 0.5} ) ) );
705 out[16] = Impl::rangeCast( f( Domain( {0.0, 0.5, 0.5} ) ) );
706 out[17] = Impl::rangeCast( f( Domain( {0.5, 0.5, 0.5} ) ) );
711 DUNE_THROW(NotImplemented,
"LagrangePrismLocalInterpolation not implemented for order " << k);
726 template<
class D,
class R,
int compileTimeOrder = -1>
728 :
public Impl::LagrangePrismOrderTraits<compileTimeOrder>
730 using OrderTraits = Impl::LagrangePrismOrderTraits<compileTimeOrder>;
736 Impl::LagrangePrismLocalCoefficients<compileTimeOrder>,
737 Impl::LagrangePrismLocalInterpolation<D,R,compileTimeOrder> >;
743 , coefficients_(*this)
744 , interpolation_(*this)
746 static_assert(OrderTraits::is_static_order,
"Default constructor only allowed for compile-time >= 0");
747 static_assert((0 <= compileTimeOrder) and (compileTimeOrder <= 2),
"LagrangePrism: Only order 0,1, and 2 are supported");
752 : OrderTraits(runTimeOrder)
754 , coefficients_(*this)
755 , interpolation_(*this)
757 static_assert(not OrderTraits::is_static_order,
"Passing a run-time order only allowed for compile-time = -1");
758 if ((runTimeOrder < 0) or (runTimeOrder > 2))
773 return coefficients_;
780 return interpolation_;
787 return GeometryTypes::prism;
791 Impl::LagrangePrismLocalBasis<D,R,compileTimeOrder> basis_;
792 Impl::LagrangePrismLocalCoefficients<compileTimeOrder> coefficients_;
793 Impl::LagrangePrismLocalInterpolation<D,R,compileTimeOrder> interpolation_;
#define DUNE_THROW(E,...)
static constexpr T binomial(const T &n, const T &k) noexcept
D DomainType
domain type
Definition common/localbasis.hh:43
traits helper struct
Definition localfiniteelementtraits.hh:13
LB LocalBasisType
Definition localfiniteelementtraits.hh:16
LC LocalCoefficientsType
Definition localfiniteelementtraits.hh:20
LI LocalInterpolationType
Definition localfiniteelementtraits.hh:24
Lagrange finite element for 3d prisms with arbitrary compile-time polynomial order.
Definition lagrangeprism.hh:729
const Traits::LocalInterpolationType & localInterpolation() const
Returns object that evaluates degrees of freedom.
Definition lagrangeprism.hh:778
const Traits::LocalCoefficientsType & localCoefficients() const
Returns the assignment of the degrees of freedom to the element subentities.
Definition lagrangeprism.hh:771
static constexpr GeometryType type()
The reference element that the local finite element is defined on.
Definition lagrangeprism.hh:785
constexpr LagrangePrismLocalFiniteElement()
Constructor for compile-time order.
Definition lagrangeprism.hh:740
const Traits::LocalBasisType & localBasis() const
Returns the local basis, i.e., the set of shape functions.
Definition lagrangeprism.hh:764
constexpr LagrangePrismLocalFiniteElement(int runTimeOrder)
Constructor for run-time order.
Definition lagrangeprism.hh:751