Line | Branch | Exec | Source |
---|---|---|---|
1 | // This file is part of Bembel, the higher order C++ boundary element library. | ||
2 | // | ||
3 | // Copyright (C) 2022 see <http://www.bembel.eu> | ||
4 | // | ||
5 | // It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz, | ||
6 | // M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt, | ||
7 | // Universitaet Basel, and Universita della Svizzera italiana, Lugano. This | ||
8 | // source code is subject to the GNU General Public License version 3 and | ||
9 | // provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further | ||
10 | // information. | ||
11 | #ifndef BEMBEL_SRC_ANSATZSPACE_FUNCTIONEVALUATOREVAL_HPP_ | ||
12 | #define BEMBEL_SRC_ANSATZSPACE_FUNCTIONEVALUATOREVAL_HPP_ | ||
13 | |||
14 | namespace Bembel { | ||
15 | |||
16 | template <typename Scalar, unsigned int DF, typename LinOp> | ||
17 | struct FunctionEvaluatorEval {}; | ||
18 | |||
19 | // continuous | ||
20 | template <typename Scalar, typename LinOp> | ||
21 | struct FunctionEvaluatorEval<Scalar, DifferentialForm::Continuous, LinOp> { | ||
22 | Eigen::Matrix<Scalar, | ||
23 | getFunctionSpaceOutputDimension<DifferentialForm::Continuous>(), | ||
24 | 1> | ||
25 | 2220 | eval(const SuperSpace<LinOp> &super_space, | |
26 | const int polynomial_degree_plus_one_squared, | ||
27 | const ElementTreeNode &element, const SurfacePoint &p, | ||
28 | const Eigen::Matrix< | ||
29 | Scalar, Eigen::Dynamic, | ||
30 | getFunctionSpaceVectorDimension<DifferentialForm::Continuous>()> | ||
31 | &coeff) const { | ||
32 |
1/2✓ Branch 1 taken 2220 times.
✗ Branch 2 not taken.
|
2220 | auto s = p.segment<2>(0); |
33 |
6/12✓ Branch 2 taken 2220 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2220 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 2220 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 2220 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2220 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2220 times.
✗ Branch 18 not taken.
|
2220 | return coeff.transpose() * super_space.basis(s) / element.get_h(); |
34 | } | ||
35 | }; | ||
36 | |||
37 | // div-conforming | ||
38 | template <typename Scalar, typename LinOp> | ||
39 | struct FunctionEvaluatorEval<Scalar, DifferentialForm::DivConforming, LinOp> { | ||
40 | Eigen::Matrix< | ||
41 | Scalar, | ||
42 | getFunctionSpaceOutputDimension<DifferentialForm::DivConforming>(), 1> | ||
43 | 93720 | eval(const SuperSpace<LinOp> &super_space, | |
44 | const int polynomial_degree_plus_one_squared, | ||
45 | const ElementTreeNode &element, const SurfacePoint &p, | ||
46 | const Eigen::Matrix< | ||
47 | Scalar, Eigen::Dynamic, | ||
48 | getFunctionSpaceVectorDimension<DifferentialForm::DivConforming>()> | ||
49 | &coeff) const { | ||
50 |
1/2✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
|
93720 | auto s = p.segment<2>(0); |
51 | 93720 | auto h = element.get_h(); | |
52 |
1/2✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
|
93720 | auto x_f_dx = p.segment<3>(6); |
53 |
1/2✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
|
93720 | auto x_f_dy = p.segment<3>(9); |
54 | Eigen::Matrix<typename LinearOperatorTraits<LinOp>::Scalar, Eigen::Dynamic, | ||
55 | 1> | ||
56 |
5/10✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 93720 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 93720 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 93720 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 93720 times.
✗ Branch 14 not taken.
|
93720 | tangential_coefficients = coeff.transpose() * super_space.basis(s); |
57 |
1/2✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
|
93720 | return (x_f_dx * tangential_coefficients(0) + |
58 |
1/2✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
|
93720 | x_f_dy * tangential_coefficients(1)) / |
59 |
5/10✓ Branch 1 taken 93720 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 93720 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 93720 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 93720 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 93720 times.
✗ Branch 14 not taken.
|
281160 | h; |
60 | 93720 | } | |
61 | |||
62 | 91800 | Scalar evalDiv( | |
63 | const SuperSpace<LinOp> &super_space, | ||
64 | const int polynomial_degree_plus_one_squared, | ||
65 | const ElementTreeNode &element, const SurfacePoint &p, | ||
66 | const Eigen::Matrix< | ||
67 | Scalar, Eigen::Dynamic, | ||
68 | getFunctionSpaceVectorDimension<DifferentialForm::DivConforming>()> | ||
69 | &coeff) const { | ||
70 |
1/2✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
|
91800 | auto s = p.segment<2>(0); |
71 | 91800 | auto h = element.get_h(); | |
72 | Eigen::Matrix<typename LinearOperatorTraits<LinOp>::Scalar, Eigen::Dynamic, | ||
73 | 1> | ||
74 |
2/4✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 91800 times.
✗ Branch 5 not taken.
|
91800 | phiPhiVec_dx = super_space.basisDx(s); |
75 | Eigen::Matrix<typename LinearOperatorTraits<LinOp>::Scalar, Eigen::Dynamic, | ||
76 | 1> | ||
77 |
2/4✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 91800 times.
✗ Branch 5 not taken.
|
91800 | phiPhiVec_dy = super_space.basisDy(s); |
78 |
5/10✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 91800 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 91800 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 91800 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 91800 times.
✗ Branch 14 not taken.
|
91800 | return (phiPhiVec_dx.dot(coeff.col(0)) + phiPhiVec_dy.dot(coeff.col(1))) / |
79 | 183600 | h / h; | |
80 | 91800 | } | |
81 | }; | ||
82 | |||
83 | // discontinuous | ||
84 | template <typename Scalar, typename LinOp> | ||
85 | struct FunctionEvaluatorEval<Scalar, DifferentialForm::Discontinuous, LinOp> { | ||
86 | Eigen::Matrix< | ||
87 | Scalar, | ||
88 | getFunctionSpaceOutputDimension<DifferentialForm::Discontinuous>(), 1> | ||
89 | 902402 | eval(const SuperSpace<LinOp> &super_space, | |
90 | const int polynomial_degree_plus_one_squared, | ||
91 | const ElementTreeNode &element, const SurfacePoint &p, | ||
92 | const Eigen::Matrix< | ||
93 | Scalar, Eigen::Dynamic, | ||
94 | getFunctionSpaceVectorDimension<DifferentialForm::Discontinuous>()> | ||
95 | &coeff) const { | ||
96 |
1/2✓ Branch 1 taken 902402 times.
✗ Branch 2 not taken.
|
902402 | auto s = p.segment<2>(0); |
97 |
6/12✓ Branch 2 taken 902402 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 902402 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 902402 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 902402 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 902402 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 902402 times.
✗ Branch 18 not taken.
|
902402 | return coeff.transpose() * super_space.basis(s) / element.get_h(); |
98 | } | ||
99 | }; | ||
100 | } // namespace Bembel | ||
101 | #endif // BEMBEL_SRC_ANSATZSPACE_FUNCTIONEVALUATOREVAL_HPP_ | ||
102 |