GCC Code Coverage Report


Directory: Bembel/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 46 / 0 / 46
Functions: 100.0% 9 / 0 / 9
Branches: 50.0% 82 / 0 / 164

AnsatzSpace/FunctionEvaluatorEval.hpp
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
3/6
Bembel::FunctionEvaluatorEval<double, 0u, Bembel::LaplaceBeltramiOperator>::eval(Bembel::SuperSpace<Bembel::LaplaceBeltramiOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 150 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<double, 0u, Bembel::MassMatrixScalarCont>::eval(Bembel::SuperSpace<Bembel::MassMatrixScalarCont> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 150 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<double, 0u, TestOperatorC>::eval(Bembel::SuperSpace<TestOperatorC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
2220 auto s = p.segment<2>(0);
33
18/36
Bembel::FunctionEvaluatorEval<double, 0u, Bembel::LaplaceBeltramiOperator>::eval(Bembel::SuperSpace<Bembel::LaplaceBeltramiOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 150 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 150 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 150 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 150 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 150 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 150 times.
✗ Branch 18 not taken.
Bembel::FunctionEvaluatorEval<double, 0u, Bembel::MassMatrixScalarCont>::eval(Bembel::SuperSpace<Bembel::MassMatrixScalarCont> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 150 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 150 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 150 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 150 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 150 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 150 times.
✗ Branch 18 not taken.
Bembel::FunctionEvaluatorEval<double, 0u, TestOperatorC>::eval(Bembel::SuperSpace<TestOperatorC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 1920 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1920 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1920 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1920 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1920 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1920 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
2/4
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
93720 auto s = p.segment<2>(0);
51 93720 auto h = element.get_h();
52
2/4
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
93720 auto x_f_dx = p.segment<3>(6);
53
2/4
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 91800 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
10/20
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1920 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1920 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1920 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1920 times.
✗ Branch 14 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ 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.
93720 tangential_coefficients = coeff.transpose() * super_space.basis(s);
57
2/4
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
93720 return (x_f_dx * tangential_coefficients(0) +
58
2/4
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 91800 times.
✗ Branch 2 not taken.
93720 x_f_dy * tangential_coefficients(1)) /
59
10/20
Bembel::FunctionEvaluatorEval<double, 1u, TestOperatorDivC>::eval(Bembel::SuperSpace<TestOperatorDivC> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 2, 0, -1, 2> const&) const:
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1920 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1920 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1920 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1920 times.
✗ Branch 14 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 1u, Bembel::MaxwellSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::MaxwellSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2> const&) const:
✓ 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.
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
3/6
Bembel::FunctionEvaluatorEval<double, 2u, Bembel::HomogenisedLaplaceSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::HomogenisedLaplaceSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 480000 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<double, 2u, Bembel::LaplaceSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::LaplaceSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 384001 times.
✗ Branch 2 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 2u, Bembel::HelmholtzSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::HelmholtzSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 1, 0, -1, 1> const&) const:
✓ Branch 1 taken 38401 times.
✗ Branch 2 not taken.
902402 auto s = p.segment<2>(0);
97
18/36
Bembel::FunctionEvaluatorEval<double, 2u, Bembel::HomogenisedLaplaceSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::HomogenisedLaplaceSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 480000 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 480000 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 480000 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 480000 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 480000 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 480000 times.
✗ Branch 18 not taken.
Bembel::FunctionEvaluatorEval<double, 2u, Bembel::LaplaceSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::LaplaceSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 384001 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 384001 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 384001 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 384001 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 384001 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 384001 times.
✗ Branch 18 not taken.
Bembel::FunctionEvaluatorEval<std::complex<double>, 2u, Bembel::HelmholtzSingleLayerOperator>::eval(Bembel::SuperSpace<Bembel::HelmholtzSingleLayerOperator> const&, int, Bembel::ElementTreeNode const&, Eigen::Matrix<double, 12, 1, 0, 12, 1> const&, Eigen::Matrix<std::complex<double>, -1, 1, 0, -1, 1> const&) const:
✓ Branch 2 taken 38401 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 38401 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 38401 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 38401 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 38401 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 38401 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