GCC Code Coverage Report


Directory: Bembel/src/
File: Bembel/src/DuffyTrick/evaluateBilinearForm.hpp
Date: 2024-09-30 07:01:38
Exec Total Coverage
Lines: 25 31 80.6%
Functions: 4 4 100.0%
Branches: 20 38 52.6%

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_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
12 #define BEMBEL_SRC_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
13
14 namespace Bembel {
15 namespace DuffyTrick {
16 /**
17 * \ingroup DuffyTrick
18 * \brief This function wraps the quadrature routines for the DuffyTrick and
19 *returns all integrals for the given pair of elements.
20 */
21 template <typename Derived, class T, class CubatureVector>
22 39012 void evaluateBilinearForm(
23 const LinearOperatorBase<Derived>& linOp, const T& super_space,
24 const ElementTreeNode& e1, const ElementTreeNode& e2,
25 const CubatureVector& GS, const ElementSurfacePoints& ffield_qnodes1,
26 const ElementSurfacePoints& ffield_qnodes2,
27 Eigen::Matrix<typename LinearOperatorTraits<Derived>::Scalar,
28 Eigen::Dynamic, Eigen::Dynamic>* intval) {
29 //////////////////////////////////////////////////////////////////////////////
30 39012 double dist = 0;
31 int ffield_deg =
32 39012 linOp.get_FarfieldQuadratureDegree(super_space.get_polynomial_degree());
33 39012 int nfield_deg = 0;
34
1/2
✓ Branch 1 taken 39012 times.
✗ Branch 2 not taken.
39012 auto cp = compareElements(e1, e2, &dist);
35 39012 nfield_deg = linOp.getNearfieldQuadratureDegree(
36 39012 super_space.get_polynomial_degree(), dist, e1.level_);
37 // make sure that the quadratur degree is at least the far field degree
38
2/2
✓ Branch 0 taken 13128 times.
✓ Branch 1 taken 25884 times.
39012 nfield_deg = nfield_deg >= ffield_deg ? nfield_deg : ffield_deg;
39
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 39012 times.
39012 assert(nfield_deg < Constants::maximum_quadrature_degree &&
40 "nfield_deg too large, increase maximum_quadrature_degree");
41
2/4
✓ Branch 1 taken 39012 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 39012 times.
✗ Branch 5 not taken.
39012 auto Q = GS[nfield_deg];
42
5/8
✓ Branch 1 taken 39012 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 33750 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 606 times.
✓ Branch 6 taken 2424 times.
✓ Branch 7 taken 2232 times.
✗ Branch 8 not taken.
39012 switch (cp(2)) {
43 33750 case 0:
44
1/2
✓ Branch 0 taken 33750 times.
✗ Branch 1 not taken.
33750 if (nfield_deg == ffield_deg) {
45
1/2
✓ Branch 1 taken 33750 times.
✗ Branch 2 not taken.
33750 integrate0(linOp, super_space, e1, 0, e2, 0, ffield_qnodes1,
46 ffield_qnodes2, Q, intval);
47 33750 return;
48 } else {
49 integrate1(linOp, super_space, e1, 0, e2, 0, ffield_qnodes1,
50 ffield_qnodes2, Q, intval);
51 return;
52 }
53 case 1:
54 assert(!"you should not have ended up here!");
55 606 case 2:
56
1/2
✓ Branch 1 taken 606 times.
✗ Branch 2 not taken.
606 integrate2(linOp, super_space, e1, 0, e2, 0, ffield_qnodes1,
57 ffield_qnodes2, Q, intval);
58 606 return;
59 2424 case 3:
60
3/6
✓ Branch 1 taken 2424 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2424 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2424 times.
✗ Branch 8 not taken.
2424 integrate3(linOp, super_space, e1, cp(0), e2, cp(1), ffield_qnodes1,
61 ffield_qnodes2, Q, intval);
62 2424 return;
63 2232 case 4:
64
3/6
✓ Branch 1 taken 2232 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2232 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2232 times.
✗ Branch 8 not taken.
2232 integrate4(linOp, super_space, e1, cp(0), e2, cp(1), ffield_qnodes1,
65 ffield_qnodes2, Q, intval);
66 2232 return;
67 default:
68 assert(!"you should not have ended up here!");
69 }
70 return;
71 39012 }
72 } // namespace DuffyTrick
73 } // namespace Bembel
74 #endif // BEMBEL_SRC_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
75