GCC Code Coverage Report


Directory: Bembel/src/
File: Bembel/src/DuffyTrick/farFieldQuadratureNodes.hpp
Date: 2024-03-19 14:38:05
Exec Total Coverage
Lines: 15 16 93.8%
Functions: 5 5 100.0%
Branches: 11 18 61.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_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
13 #define BEMBEL_SRC_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
14
15 namespace Bembel {
16 namespace DuffyTrick {
17 /**
18 * \ingroup DuffyTrick
19 * \brief evaluates a given quadrature on all surface panels storage format is
20 *qNodes.col(k) = [xi, w, Chi(xi); dsChi(xi); dtChi(xi)]
21 */
22 template <class T>
23 9 std::vector<ElementSurfacePoints> computeFfieldQnodes(const T &super_space,
24 const Cubature &Q) {
25 9 std::vector<ElementSurfacePoints> ffield_qnodes;
26 9 int next = 0;
27 // assume isotropic mesh width h!
28 9 double h = (super_space.get_mesh().get_element_tree().cpbegin())->get_h();
29 9 auto nE = super_space.get_mesh().get_number_of_elements();
30 9 auto pbegin = super_space.get_mesh().get_element_tree().cpbegin();
31 9 auto pend = super_space.get_mesh().get_element_tree().cpend();
32
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 ffield_qnodes.reserve(nE);
33
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 SurfacePoint surfpt;
34
35
2/2
✓ Branch 2 taken 622 times.
✓ Branch 3 taken 9 times.
631 for (auto it = pbegin; it != pend; ++it) {
36
1/2
✓ Branch 2 taken 622 times.
✗ Branch 3 not taken.
622 ffield_qnodes.emplace_back(Q.xi_.cols());
37
2/2
✓ Branch 1 taken 12136 times.
✓ Branch 2 taken 622 times.
12758 for (auto k = 0; k < Q.xi_.cols(); ++k) {
38 // the quadrature weight is scaled by mesh width
39 // this corresponds to a scaling of the basis functions
40 // with respect to the L^2 norm!
41
4/8
✓ Branch 1 taken 12136 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12136 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12136 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 12136 times.
✗ Branch 12 not taken.
12136 super_space.map2surface(*it, Q.xi_.col(k), h * Q.w_(k),
42 12136 &ffield_qnodes[it->id_][k]);
43 }
44 }
45 18 return ffield_qnodes;
46 }
47 } // namespace DuffyTrick
48 } // namespace Bembel
49 #endif // BEMBEL_SRC_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
50