FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
evaluator.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/trafo/evaluator_base.hpp>
10
11namespace FEAT
12{
13 namespace Trafo
14 {
15 namespace IsoSphere
16 {
18 namespace Intern
19 {
20 // p0, p1 and p2 are the 1D basis functions on the reference interval [-1,+1].
21 // These are used for the tensor-product approach in the Hypercube evaluators.
22
23 // basis function for left vertex
24 template<typename T_>
25 inline T_ p0(T_ x)
26 {
27 return T_(0.5) * x * (x - T_(1));
28 }
29
30 // basis function for right vertex
31 template<typename T_>
32 inline T_ p1(T_ x)
33 {
34 return T_(0.5) * x * (x + T_(1));
35 }
36
37 // basis function for edge midpoint
38 template<typename T_>
39 inline T_ p2(T_ x)
40 {
41 return (T_(1) - x) * (T_(1) + x);
42 }
43
44 // first order derivatives
45
46 template<typename T_>
47 inline T_ d1p0(T_ x)
48 {
49 return x - T_(0.5);
50 }
51
52 template<typename T_>
53 inline T_ d1p1(T_ x)
54 {
55 return x + T_(0.5);
56 }
57
58 template<typename T_>
59 inline T_ d1p2(T_ x)
60 {
61 return -T_(2) * x;
62 }
63
64 // second order derivatives
65
66 template<typename T_>
67 inline T_ d2p0(T_)
68 {
69 return T_(1);
70 }
71
72 template<typename T_>
73 inline T_ d2p1(T_)
74 {
75 return T_(1);
76 }
77
78 template<typename T_>
79 inline T_ d2p2(T_)
80 {
81 return -T_(2);
82 }
83 } // namespace Intern
85
91 template<
92 typename Trafo_,
93 typename EvalPolicy_,
94 typename Shape_ = typename EvalPolicy_::ShapeType>
95 class Evaluator DOXY({});
96
97 /* ************************************************************************************* */
98
104 template<
105 typename Trafo_,
106 typename EvalPolicy_>
107 class Evaluator<Trafo_, EvalPolicy_, Shape::Vertex > :
108 public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, Shape::Vertex >, EvalPolicy_>
109 {
110 public:
116 typedef Trafo_ TrafoType;
118 typedef EvalPolicy_ EvalPolicy;
119
121 typedef typename TrafoType::MeshType MeshType;
122
124 typedef typename EvalPolicy::DataType DataType;
126 typedef typename EvalPolicy::DomainPointType DomainPointType;
128 typedef typename EvalPolicy::ImagePointType ImagePointType;
130 typedef typename EvalPolicy::JacobianMatrixType JacobianMatrixType;
132 typedef typename EvalPolicy::JacobianInverseType JacobianInverseType;
134 typedef typename EvalPolicy::JacobianDeterminantType JacobianDeterminantType;
136 typedef typename EvalPolicy::HessianTensorType HessianTensorType;
138 typedef typename EvalPolicy::HessianInverseType HessianInverseType;
139
141 static constexpr int domain_dim = EvalPolicy::domain_dim;
143 static constexpr int image_dim = EvalPolicy::image_dim;
144
147
148 protected:
151
152 public:
159 explicit Evaluator(const TrafoType& trafo) :
160 BaseClass(trafo)
161 {
162 }
163
170 void prepare(Index cell_index)
171 {
172 // prepare base-class
173 BaseClass::prepare(cell_index);
174
175 // fetch the vertex and normalize
176 _coeff = this->_trafo.get_mesh().get_vertex_set()[cell_index];
177 _coeff.normalize();
178 }
179
190 {
191 img_point = _coeff;
192 }
193 }; // class Evaluator<Vertex,...>
194
195
196 /* ************************************************************************************* */
197
203 template<
204 typename Trafo_,
205 typename EvalPolicy_>
206 class Evaluator<Trafo_, EvalPolicy_, Shape::Simplex<1> > :
207 public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, Shape::Simplex<1> >, EvalPolicy_>
208 {
209 public:
215 typedef Trafo_ TrafoType;
217 typedef EvalPolicy_ EvalPolicy;
218
220 typedef typename TrafoType::MeshType MeshType;
221
223 typedef typename EvalPolicy::DataType DataType;
225 typedef typename EvalPolicy::DomainPointType DomainPointType;
227 typedef typename EvalPolicy::ImagePointType ImagePointType;
229 typedef typename EvalPolicy::JacobianMatrixType JacobianMatrixType;
231 typedef typename EvalPolicy::JacobianInverseType JacobianInverseType;
233 typedef typename EvalPolicy::JacobianDeterminantType JacobianDeterminantType;
235 typedef typename EvalPolicy::HessianTensorType HessianTensorType;
237 typedef typename EvalPolicy::HessianInverseType HessianInverseType;
238
240 static constexpr int domain_dim = EvalPolicy::domain_dim;
242 static constexpr int image_dim = EvalPolicy::image_dim;
243
244 static_assert(domain_dim < image_dim, "this trafo is for surfaces only");
245
248 static constexpr TrafoTags eval_caps =
251
252 protected:
255
256 public:
263 explicit Evaluator(const TrafoType& trafo) :
264 BaseClass(trafo)
265 {
266 }
267
274 void prepare(Index cell_index)
275 {
276 // prepare base-class
277 BaseClass::prepare(cell_index);
278
279 // fetch the mesh from the trafo
280 const MeshType& mesh = this->_trafo.get_mesh();
281
282 // fetch the vertex set from the mesh
283 typedef typename MeshType::VertexSetType VertexSetType;
284 const VertexSetType& vertex_set = mesh.get_vertex_set();
285
286 // fetch the index set
287 typedef typename MeshType::template IndexSet<domain_dim, 0>::Type IndexSetType;
288 const IndexSetType& index_set = mesh.template get_index_set<domain_dim, 0>();
289
290 // get vertex coords
291 _coeffs[0] = vertex_set[index_set(cell_index, 0)];
292 _coeffs[1] = vertex_set[index_set(cell_index, 1)];
293
294 // get edge midpoint
295 _coeffs[2] = _coeffs[0] + _coeffs[1];
296
297 // normalize all coefficients
298 for(int i(0); i < 3; ++i)
299 _coeffs[i].normalize();
300 }
301
312 {
313 const DataType x = dom_point[0];
314
315 for(int i(0); i < image_dim; ++i)
316 {
317 img_point[i] =
318 _coeffs[0][i] * DataType(0.5) * x * (x - DataType(1)) +
319 _coeffs[1][i] * DataType(0.5) * x * (x + DataType(1)) +
320 _coeffs[2][i] * (DataType(1) - x) * (DataType(1) - x);
321 }
322 }
323
334 {
335 const DataType x = dom_point[0];
336
337 for(int i(0); i < image_dim; ++i)
338 {
339 jac_mat[i][0] =
340 _coeffs[0][i] * (x - DataType(0.5)) +
341 _coeffs[1][i] * (x + DataType(0.5)) -
342 _coeffs[2][i] * DataType(2) * x;
343 }
344 }
345
356 {
357 for(int i(0); i < image_dim; ++i)
358 {
359 hess_ten[i][0] = _coeffs[0][i] + _coeffs[1][i] - DataType(2) *_coeffs[2][i];
360 }
361 }
362 }; // class Evaluator<Simplex<1>,...>
363
364 /* ************************************************************************************* */
365
371 template<
372 typename Trafo_,
373 typename EvalPolicy_>
374 class Evaluator<Trafo_, EvalPolicy_, Shape::Simplex<2> > :
375 public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, Shape::Simplex<2> >, EvalPolicy_>
376 {
377 public:
383 typedef Trafo_ TrafoType;
385 typedef EvalPolicy_ EvalPolicy;
386
388 typedef typename TrafoType::MeshType MeshType;
389
391 typedef typename EvalPolicy::DataType DataType;
393 typedef typename EvalPolicy::DomainPointType DomainPointType;
395 typedef typename EvalPolicy::ImagePointType ImagePointType;
397 typedef typename EvalPolicy::JacobianMatrixType JacobianMatrixType;
399 typedef typename EvalPolicy::JacobianInverseType JacobianInverseType;
401 typedef typename EvalPolicy::JacobianDeterminantType JacobianDeterminantType;
403 typedef typename EvalPolicy::HessianTensorType HessianTensorType;
405 typedef typename EvalPolicy::HessianInverseType HessianInverseType;
406
408 static constexpr int domain_dim = EvalPolicy::domain_dim;
410 static constexpr int image_dim = EvalPolicy::image_dim;
411
412 static_assert(domain_dim < image_dim, "this trafo is for surfaces only");
413
416 static constexpr TrafoTags eval_caps =
419
420 protected:
423
424 public:
431 explicit Evaluator(const TrafoType& trafo) :
432 BaseClass(trafo)
433 {
434 }
435
442 void prepare(Index cell_index)
443 {
444 // prepare base-class
445 BaseClass::prepare(cell_index);
446
447 // fetch the mesh from the trafo
448 const MeshType& mesh = this->_trafo.get_mesh();
449
450 // fetch the vertex set from the mesh
451 typedef typename MeshType::VertexSetType VertexSetType;
452 const VertexSetType& vertex_set = mesh.get_vertex_set();
453
454 // fetch the index set
455 typedef typename MeshType::template IndexSet<domain_dim, 0>::Type IndexSetType;
456 const IndexSetType& index_set = mesh.template get_index_set<domain_dim, 0>();
457
458 // get vertex coords
459 _coeffs[0] = vertex_set[index_set(cell_index, 0)];
460 _coeffs[1] = vertex_set[index_set(cell_index, 1)];
461 _coeffs[2] = vertex_set[index_set(cell_index, 2)];
462
463 // get edge midpoints
464 _coeffs[3] = _coeffs[1] + _coeffs[2];
465 _coeffs[4] = _coeffs[0] + _coeffs[2];
466 _coeffs[5] = _coeffs[0] + _coeffs[1];
467
468 // normalize all coefficients
469 for(int i(0); i < 6; ++i)
470 _coeffs[i].normalize();
471 }
472
483 {
484 const DataType x = dom_point[0];
485 const DataType y = dom_point[1];
486
487 for(int i(0); i < image_dim; ++i)
488 {
489 img_point[i] =
490 _coeffs[0][i] * (DataType(2) * (x + y - DataType(0.5)) * (x + y - DataType(1))) +
491 _coeffs[1][i] * (DataType(2) * x * (x - DataType(0.5))) +
492 _coeffs[2][i] * (DataType(2) * y * (y - DataType(0.5))) +
493 _coeffs[3][i] * (DataType(4) * x * y) +
494 _coeffs[4][i] * (DataType(4) * y * (DataType(1) - x - y)) +
495 _coeffs[5][i] * (DataType(4) * x * (DataType(1) - x - y));
496 }
497 }
498
509 {
510 const DataType x = dom_point[0];
511 const DataType y = dom_point[1];
512
513 for(int i(0); i < image_dim; ++i)
514 {
515 jac_mat[i][0] =
516 _coeffs[0][i] * (DataType(4) * (x + y) - DataType(3)) +
517 _coeffs[1][i] * (DataType(4) * x - DataType(1)) +
518 //_coeffs[2][i] * (DataType(0)) +
519 _coeffs[3][i] * (DataType(4) * y) -
520 _coeffs[4][i] * (DataType(4) * y) -
521 _coeffs[5][i] * (DataType(4) * (DataType(2)*x + y - DataType(1)));
522 jac_mat[i][1] =
523 _coeffs[0][i] * (DataType(4) * (x + y) - DataType(3)) +
524 //_coeffs[1][i] * (DataType(0)) +
525 _coeffs[2][i] * (DataType(4) * y - DataType(1)) +
526 _coeffs[3][i] * (DataType(4) * x) -
527 _coeffs[4][i] * (DataType(4) * (DataType(2)*y + x - DataType(1))) -
528 _coeffs[5][i] * (DataType(4) * x);
529 }
530 }
531
542 {
543 for(int i(0); i < image_dim; ++i)
544 {
545 hess_ten[i][0][0] = DataType(4) * (_coeffs[0][i] + _coeffs[1][i] - DataType(2) * _coeffs[5][i]);
546 hess_ten[i][1][1] = DataType(4) * (_coeffs[0][i] + _coeffs[2][i] - DataType(2) * _coeffs[4][i]);
547 hess_ten[i][0][1] =
548 hess_ten[i][1][0] = DataType(4) * (_coeffs[0][i] + _coeffs[3][i] + _coeffs[4][i] + _coeffs[5][i]);
549 }
550 }
551 }; // class Evaluator<Simplex<2>,...>
552
553
554 /* ************************************************************************************* */
555
561 template<
562 typename Trafo_,
563 typename EvalPolicy_>
564 class Evaluator<Trafo_, EvalPolicy_, Shape::Hypercube<1> > :
565 public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, Shape::Hypercube<1> >, EvalPolicy_>
566 {
567 public:
573 typedef Trafo_ TrafoType;
575 typedef EvalPolicy_ EvalPolicy;
576
578 typedef typename TrafoType::MeshType MeshType;
579
581 typedef typename EvalPolicy::DataType DataType;
583 typedef typename EvalPolicy::DomainPointType DomainPointType;
585 typedef typename EvalPolicy::ImagePointType ImagePointType;
587 typedef typename EvalPolicy::JacobianMatrixType JacobianMatrixType;
589 typedef typename EvalPolicy::JacobianInverseType JacobianInverseType;
591 typedef typename EvalPolicy::JacobianDeterminantType JacobianDeterminantType;
593 typedef typename EvalPolicy::HessianTensorType HessianTensorType;
595 typedef typename EvalPolicy::HessianInverseType HessianInverseType;
596
598 static constexpr int domain_dim = EvalPolicy::domain_dim;
600 static constexpr int image_dim = EvalPolicy::image_dim;
601
602 static_assert(domain_dim < image_dim, "this trafo is for surfaces only");
603
606 static constexpr TrafoTags eval_caps =
609
610 protected:
613
614 public:
621 explicit Evaluator(const TrafoType& trafo) :
622 BaseClass(trafo)
623 {
624 }
625
632 void prepare(Index cell_index)
633 {
634 // prepare base-class
635 BaseClass::prepare(cell_index);
636
637 // fetch the mesh from the trafo
638 const MeshType& mesh = this->_trafo.get_mesh();
639
640 // fetch the vertex set from the mesh
641 typedef typename MeshType::VertexSetType VertexSetType;
642 const VertexSetType& vertex_set = mesh.get_vertex_set();
643
644 // fetch the index set
645 typedef typename MeshType::template IndexSet<domain_dim, 0>::Type IndexSetType;
646 const IndexSetType& index_set = mesh.template get_index_set<domain_dim, 0>();
647
648 // get vertex coords
649 _coeffs[0] = vertex_set[index_set(cell_index, 0)];
650 _coeffs[1] = vertex_set[index_set(cell_index, 1)];
651
652 // compute edge midpoints
653 _coeffs[2] = _coeffs[0] + _coeffs[1];
654
655 // normalize all coefficients
656 for(int i(0); i < 3; ++i)
657 _coeffs[i].normalize();
658 }
659
670 {
671 for(int i(0); i < image_dim; ++i)
672 {
673 img_point[i] =
674 _coeffs[0][i] * Intern::p0(dom_point[0]) +
675 _coeffs[1][i] * Intern::p1(dom_point[0]) +
676 _coeffs[2][i] * Intern::p2(dom_point[0]);
677 }
678 }
679
690 {
691 for(int i(0); i < image_dim; ++i)
692 {
693 jac_mat[i][0] =
694 _coeffs[0][i] * Intern::d1p0(dom_point[0]) +
695 _coeffs[1][i] * Intern::d1p1(dom_point[0]) +
696 _coeffs[2][i] * Intern::d1p2(dom_point[0]);
697 }
698 }
699
710 {
711 for(int i(0); i < image_dim; ++i)
712 {
713 hess_ten[i][0][0] =
714 _coeffs[0][i] * Intern::d2p0(dom_point[0]) +
715 _coeffs[1][i] * Intern::d2p1(dom_point[0]) +
716 _coeffs[2][i] * Intern::d2p2(dom_point[0]);
717 }
718 }
719 }; // class Evaluator<Hypercube<1>,...>
720
721 /* ************************************************************************************* */
722
728 template<
729 typename Trafo_,
730 typename EvalPolicy_>
731 class Evaluator<Trafo_, EvalPolicy_, Shape::Hypercube<2> > :
732 public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, Shape::Hypercube<2> >, EvalPolicy_>
733 {
734 public:
740 typedef Trafo_ TrafoType;
742 typedef EvalPolicy_ EvalPolicy;
743
745 typedef typename TrafoType::MeshType MeshType;
746
748 typedef typename EvalPolicy::DataType DataType;
750 typedef typename EvalPolicy::DomainPointType DomainPointType;
752 typedef typename EvalPolicy::ImagePointType ImagePointType;
754 typedef typename EvalPolicy::JacobianMatrixType JacobianMatrixType;
756 typedef typename EvalPolicy::JacobianInverseType JacobianInverseType;
758 typedef typename EvalPolicy::JacobianDeterminantType JacobianDeterminantType;
760 typedef typename EvalPolicy::HessianTensorType HessianTensorType;
762 typedef typename EvalPolicy::HessianInverseType HessianInverseType;
763
765 static constexpr int domain_dim = EvalPolicy::domain_dim;
767 static constexpr int image_dim = EvalPolicy::image_dim;
768
769 static_assert(domain_dim < image_dim, "this trafo is for surfaces only");
770
773 static constexpr TrafoTags eval_caps =
776
777 protected:
780
781 public:
788 explicit Evaluator(const TrafoType& trafo) :
789 BaseClass(trafo)
790 {
791 }
792
799 void prepare(Index cell_index)
800 {
801 // prepare base-class
802 BaseClass::prepare(cell_index);
803
804 // fetch the mesh from the trafo
805 const MeshType& mesh = this->_trafo.get_mesh();
806
807 // fetch the vertex set from the mesh
808 typedef typename MeshType::VertexSetType VertexSetType;
809 const VertexSetType& vertex_set = mesh.get_vertex_set();
810
811 // fetch the index set
812 typedef typename MeshType::template IndexSet<domain_dim, 0>::Type IndexSetType;
813 const IndexSetType& index_set = mesh.template get_index_set<domain_dim, 0>();
814
815 // get vertex coords
816 _coeffs[0] = vertex_set[index_set(cell_index, 0)];
817 _coeffs[1] = vertex_set[index_set(cell_index, 1)];
818 _coeffs[2] = vertex_set[index_set(cell_index, 2)];
819 _coeffs[3] = vertex_set[index_set(cell_index, 3)];
820
821 // compute edge midpoints
822 _coeffs[4] = _coeffs[0] + _coeffs[1];
823 _coeffs[5] = _coeffs[2] + _coeffs[3];
824 _coeffs[6] = _coeffs[0] + _coeffs[2];
825 _coeffs[7] = _coeffs[1] + _coeffs[3];
826
827 // compute quad midpoint
828 _coeffs[8] = _coeffs[0] + _coeffs[1] + _coeffs[2] + _coeffs[3];
829
830 // normalize all coefficients
831 for(int i(0); i < 9; ++i)
832 _coeffs[i].normalize();
833 }
834
845 {
846 for(int i(0); i < image_dim; ++i)
847 {
848 img_point[i] =
849 _coeffs[0][i] * Intern::p0(dom_point[0]) * Intern::p0(dom_point[1]) +
850 _coeffs[1][i] * Intern::p1(dom_point[0]) * Intern::p0(dom_point[1]) +
851 _coeffs[2][i] * Intern::p0(dom_point[0]) * Intern::p1(dom_point[1]) +
852 _coeffs[3][i] * Intern::p1(dom_point[0]) * Intern::p1(dom_point[1]) +
853 _coeffs[4][i] * Intern::p2(dom_point[0]) * Intern::p0(dom_point[1]) +
854 _coeffs[5][i] * Intern::p2(dom_point[0]) * Intern::p1(dom_point[1]) +
855 _coeffs[6][i] * Intern::p0(dom_point[0]) * Intern::p2(dom_point[1]) +
856 _coeffs[7][i] * Intern::p1(dom_point[0]) * Intern::p2(dom_point[1]) +
857 _coeffs[8][i] * Intern::p2(dom_point[0]) * Intern::p2(dom_point[1]);
858 }
859 }
860
871 {
872 for(int i(0); i < image_dim; ++i)
873 {
874 jac_mat[i][0] =
875 _coeffs[0][i] * Intern::d1p0(dom_point[0]) * Intern::p0(dom_point[1]) +
876 _coeffs[1][i] * Intern::d1p1(dom_point[0]) * Intern::p0(dom_point[1]) +
877 _coeffs[2][i] * Intern::d1p0(dom_point[0]) * Intern::p1(dom_point[1]) +
878 _coeffs[3][i] * Intern::d1p1(dom_point[0]) * Intern::p1(dom_point[1]) +
879 _coeffs[4][i] * Intern::d1p2(dom_point[0]) * Intern::p0(dom_point[1]) +
880 _coeffs[5][i] * Intern::d1p2(dom_point[0]) * Intern::p1(dom_point[1]) +
881 _coeffs[6][i] * Intern::d1p0(dom_point[0]) * Intern::p2(dom_point[1]) +
882 _coeffs[7][i] * Intern::d1p1(dom_point[0]) * Intern::p2(dom_point[1]) +
883 _coeffs[8][i] * Intern::d1p2(dom_point[0]) * Intern::p2(dom_point[1]);
884 jac_mat[i][1] =
885 _coeffs[0][i] * Intern::p0(dom_point[0]) * Intern::d1p0(dom_point[1]) +
886 _coeffs[1][i] * Intern::p1(dom_point[0]) * Intern::d1p0(dom_point[1]) +
887 _coeffs[2][i] * Intern::p0(dom_point[0]) * Intern::d1p1(dom_point[1]) +
888 _coeffs[3][i] * Intern::p1(dom_point[0]) * Intern::d1p1(dom_point[1]) +
889 _coeffs[4][i] * Intern::p2(dom_point[0]) * Intern::d1p0(dom_point[1]) +
890 _coeffs[5][i] * Intern::p2(dom_point[0]) * Intern::d1p1(dom_point[1]) +
891 _coeffs[6][i] * Intern::p0(dom_point[0]) * Intern::d1p2(dom_point[1]) +
892 _coeffs[7][i] * Intern::p1(dom_point[0]) * Intern::d1p2(dom_point[1]) +
893 _coeffs[8][i] * Intern::p2(dom_point[0]) * Intern::d1p2(dom_point[1]);
894 }
895 }
896
907 {
908 for(int i(0); i < image_dim; ++i)
909 {
910 hess_ten[i][0][0] =
911 _coeffs[0][i] * Intern::d2p0(dom_point[0]) * Intern::p0(dom_point[1]) +
912 _coeffs[1][i] * Intern::d2p1(dom_point[0]) * Intern::p0(dom_point[1]) +
913 _coeffs[2][i] * Intern::d2p0(dom_point[0]) * Intern::p1(dom_point[1]) +
914 _coeffs[3][i] * Intern::d2p1(dom_point[0]) * Intern::p1(dom_point[1]) +
915 _coeffs[4][i] * Intern::d2p2(dom_point[0]) * Intern::p0(dom_point[1]) +
916 _coeffs[5][i] * Intern::d2p2(dom_point[0]) * Intern::p1(dom_point[1]) +
917 _coeffs[6][i] * Intern::d2p0(dom_point[0]) * Intern::p2(dom_point[1]) +
918 _coeffs[7][i] * Intern::d2p1(dom_point[0]) * Intern::p2(dom_point[1]) +
919 _coeffs[8][i] * Intern::d2p2(dom_point[0]) * Intern::p2(dom_point[1]);
920 hess_ten[i][1][1] =
921 _coeffs[0][i] * Intern::p0(dom_point[0]) * Intern::d2p0(dom_point[1]) +
922 _coeffs[1][i] * Intern::p1(dom_point[0]) * Intern::d2p0(dom_point[1]) +
923 _coeffs[2][i] * Intern::p0(dom_point[0]) * Intern::d2p1(dom_point[1]) +
924 _coeffs[3][i] * Intern::p1(dom_point[0]) * Intern::d2p1(dom_point[1]) +
925 _coeffs[4][i] * Intern::p2(dom_point[0]) * Intern::d2p0(dom_point[1]) +
926 _coeffs[5][i] * Intern::p2(dom_point[0]) * Intern::d2p1(dom_point[1]) +
927 _coeffs[6][i] * Intern::p0(dom_point[0]) * Intern::d2p2(dom_point[1]) +
928 _coeffs[7][i] * Intern::p1(dom_point[0]) * Intern::d2p2(dom_point[1]) +
929 _coeffs[8][i] * Intern::p2(dom_point[0]) * Intern::d2p2(dom_point[1]);
930 hess_ten[i][0][1] =
931 hess_ten[i][1][0] =
932 _coeffs[0][i] * Intern::d1p0(dom_point[0]) * Intern::d1p0(dom_point[1]) +
933 _coeffs[1][i] * Intern::d1p1(dom_point[0]) * Intern::d1p0(dom_point[1]) +
934 _coeffs[2][i] * Intern::d1p0(dom_point[0]) * Intern::d1p1(dom_point[1]) +
935 _coeffs[3][i] * Intern::d1p1(dom_point[0]) * Intern::d1p1(dom_point[1]) +
936 _coeffs[4][i] * Intern::d1p2(dom_point[0]) * Intern::d1p0(dom_point[1]) +
937 _coeffs[5][i] * Intern::d1p2(dom_point[0]) * Intern::d1p1(dom_point[1]) +
938 _coeffs[6][i] * Intern::d1p0(dom_point[0]) * Intern::d1p2(dom_point[1]) +
939 _coeffs[7][i] * Intern::d1p1(dom_point[0]) * Intern::d1p2(dom_point[1]) +
940 _coeffs[8][i] * Intern::d1p2(dom_point[0]) * Intern::d1p2(dom_point[1]);
941 }
942 }
943 }; // class Evaluator<Hypercube<2>,...>
944 } // namespace IsoSphere
945 } // namespace Trafo
946} // namespace FEAT
Tiny Matrix class template.
Tiny Vector class template.
CUDA_HOST_DEVICE Vector & normalize()
Normalizes this vector.
Trafo Evaluator CRTP base-class template.
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
Definition: evaluator.hpp:689
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
Definition: evaluator.hpp:587
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Definition: evaluator.hpp:593
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
Definition: evaluator.hpp:589
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:632
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Definition: evaluator.hpp:669
Tiny::Matrix< DataType, 3, image_dim > _coeffs
the coefficients of the trafo
Definition: evaluator.hpp:612
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Definition: evaluator.hpp:569
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
Definition: evaluator.hpp:591
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Definition: evaluator.hpp:595
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
Definition: evaluator.hpp:709
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
Definition: evaluator.hpp:758
Tiny::Matrix< DataType, 9, image_dim > _coeffs
the coefficients of the trafo
Definition: evaluator.hpp:779
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
Definition: evaluator.hpp:870
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
Definition: evaluator.hpp:756
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Definition: evaluator.hpp:844
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
Definition: evaluator.hpp:754
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:799
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Definition: evaluator.hpp:760
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
Definition: evaluator.hpp:906
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Definition: evaluator.hpp:762
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Definition: evaluator.hpp:736
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
Definition: evaluator.hpp:355
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Definition: evaluator.hpp:311
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Definition: evaluator.hpp:237
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
Definition: evaluator.hpp:229
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
Definition: evaluator.hpp:233
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
Definition: evaluator.hpp:333
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Definition: evaluator.hpp:235
Tiny::Matrix< DataType, 3, image_dim > _coeffs
the coefficients of the trafo
Definition: evaluator.hpp:254
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
Definition: evaluator.hpp:231
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Definition: evaluator.hpp:211
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:274
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Definition: evaluator.hpp:482
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Definition: evaluator.hpp:379
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:442
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
Definition: evaluator.hpp:508
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
Definition: evaluator.hpp:541
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Definition: evaluator.hpp:403
Tiny::Matrix< DataType, 6, image_dim > _coeffs
the coefficients of the trafo
Definition: evaluator.hpp:422
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Definition: evaluator.hpp:405
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
Definition: evaluator.hpp:401
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
Definition: evaluator.hpp:399
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
Definition: evaluator.hpp:397
TrafoType::MeshType MeshType
type of the underlying mesh
Definition: evaluator.hpp:121
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Definition: evaluator.hpp:189
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:170
Tiny::Vector< DataType, image_dim > _coeff
the coefficients of the trafo
Definition: evaluator.hpp:150
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Definition: evaluator.hpp:112
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
Definition: evaluator.hpp:132
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Definition: evaluator.hpp:138
EvalPolicy::DomainPointType DomainPointType
domain point type
Definition: evaluator.hpp:126
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
Definition: evaluator.hpp:134
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Definition: evaluator.hpp:136
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
Definition: evaluator.hpp:130
Iso-Sphere trafo evaluator class template.
Definition: evaluator.hpp:95
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.
TrafoTags
Trafo configuration tags enum.
Definition: eval_tags.hpp:22
@ img_point
specifies whether the trafo should supply image point coordinates
@ dom_point
specifies whether the trafo should supply domain point coordinates
@ hess_ten
specifies whether the trafo should supply hessian tensors
@ jac_mat
specifies whether the trafo should supply jacobian matrices
@ jac_det
specifies whether the trafo should supply jacobian determinants
Hypercube shape tag struct template.
Definition: shape.hpp:64
Simplex shape tag struct template.
Definition: shape.hpp:44
Vertex shape tag struct.
Definition: shape.hpp:26