GCC Code Coverage Report


Directory: Bembel/src/
File: Bembel/src/Quadrature/QuadratureVector.hpp
Date: 2024-09-30 07:01:38
Exec Total Coverage
Lines: 12 13 92.3%
Functions: 98 102 96.1%
Branches: 17 32 53.1%

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
12 #ifndef BEMBEL_SRC_QUADRATURE_QUADRATUREVECTOR_HPP_
13 #define BEMBEL_SRC_QUADRATURE_QUADRATUREVECTOR_HPP_
14
15 namespace Bembel {
16
17 /**
18 * \ingroup Quadrature
19 * \brief this struct wraps all the defined quadrature Rules in a nice
20 * structure overloading the [] operator such that they can
21 * be accessed within a loop during runtime
22 **/
23 template <template <unsigned int qrOrder> class QuadratureRule,
24 unsigned int Order>
25 struct QuadratureVector {
26
1/2
✓ Branch 2 taken 1400 times.
✗ Branch 3 not taken.
2800 QuadratureVector() {
27
1/2
✓ Branch 1 taken 1400 times.
✗ Branch 2 not taken.
2800 QuadratureRule<Order + 1> QR;
28
3/6
✓ Branch 1 taken 1400 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 1400 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1400 times.
✗ Branch 10 not taken.
2800 Q_.xi_ = Eigen::Map<Eigen::VectorXd>(QR.xi_.data(), QR.xi_.size());
29
3/6
✓ Branch 1 taken 1400 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 1400 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1400 times.
✗ Branch 10 not taken.
2800 Q_.w_ = Eigen::Map<Eigen::VectorXd>(QR.w_.data(), QR.w_.size());
30 2800 }
31 QuadratureVector<QuadratureRule, Order - 1> remainingQuadratures_;
32 2632 const Quadrature<1> &operator[](unsigned int i) const {
33
2/2
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 1288 times.
2632 return (i == Order) ? Q_ : remainingQuadratures_[i];
34 }
35
36 Quadrature<1> Q_;
37 };
38
39 /**
40 * \ingroup Quadrature
41 * \brief this struct wraps all the defined quadrature Rules in a nice
42 * structure overloading the [] operator such that they can
43 * be accessed within a loop during runtime
44 *
45 * Base Case
46 **/
47 template <template <unsigned int qrOrder> class QuadratureRule>
48 struct QuadratureVector<QuadratureRule, 0> {
49 28 QuadratureVector() {
50
1/2
✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
28 QuadratureRule<1> QR;
51
3/6
✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 28 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 28 times.
✗ Branch 10 not taken.
28 Q_.xi_ = Eigen::Map<Eigen::VectorXd>(QR.xi_.data(), QR.xi_.size());
52
3/6
✓ Branch 1 taken 28 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 28 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 28 times.
✗ Branch 10 not taken.
28 Q_.w_ = Eigen::Map<Eigen::VectorXd>(QR.w_.data(), QR.w_.size());
53 28 }
54 Quadrature<1> Q_;
55 const Quadrature<1> &operator[](unsigned int i) const { return Q_; }
56 };
57 } // namespace Bembel
58 #endif // BEMBEL_SRC_QUADRATURE_QUADRATUREVECTOR_HPP_
59