GCC Code Coverage Report


Directory: Bembel/src/
File: Bembel/src/DuffyTrick/integrate3.hpp
Date: 2024-09-30 07:01:38
Exec Total Coverage
Lines: 39 39 100.0%
Functions: 5 5 100.0%
Branches: 76 148 51.4%

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_INTEGRATE3_HPP_
12 #define BEMBEL_SRC_DUFFYTRICK_INTEGRATE3_HPP_
13
14 namespace Bembel {
15 namespace DuffyTrick {
16 /**
17 * \ingroup DuffyTrick
18 * \brief quadrature routine for the common edge case
19 * \todo be sure that map2element computes the weight h*Q.w(i) such that the
20 *integrand may then be scaled by qp1.weight * qp2.weight here we just set one
21 *weight to the actual weight, while the other one will be set to 1. This is to
22 *remain conforming to the structure of integrate0/1.
23 *
24 * Information that map2surface has to provide:
25 * xi; w; Chi(xi); dChidx(xi); dChidy(xi);
26 **/
27 template <typename Derived, class T>
28 2472 void integrate3(const LinearOperatorBase<Derived> &LinOp, const T &super_space,
29 const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2,
30 int rot2, const ElementSurfacePoints &ffield_qnodes1,
31 const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q,
32 Eigen::Matrix<typename LinearOperatorTraits<Derived>::Scalar,
33 Eigen::Dynamic, Eigen::Dynamic> *intval) {
34
1/2
✓ Branch 1 taken 2472 times.
✗ Branch 2 not taken.
2472 intval->setZero();
35 2472 double h = e1.get_h();
36 2472 double t1 = 0;
37 2472 double t2 = 0;
38 2472 double t3 = 0;
39 2472 double t4 = 0;
40
2/4
✓ Branch 1 taken 2472 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2472 times.
✗ Branch 5 not taken.
2472 SurfacePoint qp1, qp2;
41 // llc of the element wrt [0,1]^2
42
2/2
✓ Branch 1 taken 43920 times.
✓ Branch 2 taken 2472 times.
46392 for (auto i = 0; i < Q.w_.size(); ++i) {
43
1/2
✓ Branch 1 taken 43920 times.
✗ Branch 2 not taken.
43920 auto xi = Q.xi_.col(i);
44
3/6
✓ Branch 1 taken 43920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 43920 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 43920 times.
✗ Branch 8 not taken.
43920 double w = h * h * Q.w_(i) * xi(1) * xi(1);
45
2/4
✓ Branch 1 taken 43920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 43920 times.
✗ Branch 5 not taken.
43920 t1 = xi(0) * (1 - xi(1));
46
2/4
✓ Branch 1 taken 43920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 43920 times.
✗ Branch 5 not taken.
43920 t2 = (1 - xi(0)) * (1 - xi(1));
47
2/2
✓ Branch 1 taken 4411152 times.
✓ Branch 2 taken 43920 times.
4455072 for (auto j = 0; j < Q.w_.size(); ++j) {
48
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 auto eta = xi(1) * Q.xi_.col(j);
49
2/4
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
4411152 t3 = xi(0) * (1 - eta(0));
50
2/4
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
4411152 t4 = (1 - xi(0)) * (1 - eta(0));
51
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(t1, eta(0), rot1), w, &qp1);
52
5/10
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4411152 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4411152 times.
✗ Branch 14 not taken.
4411152 super_space.map2surface(e2, tau(t2, eta(1), rot2), Q.w_(j) * (1 - xi(1)),
53 &qp2);
54
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
55
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(1 - t1, eta(0), rot1), w, &qp1);
56
2/4
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
4411152 super_space.map2surface(e2, tau(1 - t2, eta(1), rot2),
57
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 Q.w_(j) * (1 - xi(1)), &qp2);
58
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
59
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(t3, xi(1), rot1), w, &qp1);
60
5/10
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4411152 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4411152 times.
✗ Branch 14 not taken.
4411152 super_space.map2surface(e2, tau(t4, eta(1), rot2), Q.w_(j) * (1 - eta(0)),
61 &qp2);
62
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
63
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(1 - t3, xi(1), rot1), w, &qp1);
64
2/4
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
4411152 super_space.map2surface(e2, tau(1 - t4, eta(1), rot2),
65
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 Q.w_(j) * (1 - eta(0)), &qp2);
66
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
67
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(t4, eta(1), rot1), w, &qp1);
68
5/10
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4411152 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4411152 times.
✗ Branch 14 not taken.
4411152 super_space.map2surface(e2, tau(t3, xi(1), rot2), Q.w_(j) * (1 - eta(0)),
69 &qp2);
70
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
71
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 super_space.map2surface(e1, tau(1 - t4, eta(1), rot1), w, &qp1);
72
2/4
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
4411152 super_space.map2surface(e2, tau(1 - t3, xi(1), rot2),
73
3/6
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4411152 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4411152 times.
✗ Branch 8 not taken.
4411152 Q.w_(j) * (1 - eta(0)), &qp2);
74
1/2
✓ Branch 1 taken 4411152 times.
✗ Branch 2 not taken.
4411152 LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
75 }
76 }
77 BEMBEL_UNUSED_(ffield_qnodes1);
78 BEMBEL_UNUSED_(ffield_qnodes2);
79 4944 return;
80 }
81 } // namespace DuffyTrick
82 } // namespace Bembel
83
84 #endif // BEMBEL_SRC_DUFFYTRICK_INTEGRATE3_HPP_
85