GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/common/boundaryflag.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 15 17 88.2%
Branches: 19 32 59.4%

Line Branch Exec Source
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 //
4 // SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup Core
10 * \brief Boundary flag to store e.g. in sub control volume faces
11 */
12 #ifndef DUMUX_BOUNDARY_FLAG_HH
13 #define DUMUX_BOUNDARY_FLAG_HH
14
15 #include <cstddef>
16 #include <limits>
17
18 namespace Dumux {
19
20 /*!
21 * \ingroup Core
22 * \brief Class for accessing boundary flags
23 * \note this works for all grid managers with gmsh meshes.
24 */
25 class BoundarySegmentIndexFlag
26 {
27 public:
28 BoundarySegmentIndexFlag()
29 50482819 : flag_(std::numeric_limits<std::size_t>::max()) {}
30
31 template<class Intersection>
32 163911105 BoundarySegmentIndexFlag(const Intersection& i)
33 163911105 : flag_(std::numeric_limits<std::size_t>::max())
34 {
35
7/7
✓ Branch 0 taken 94680475 times.
✓ Branch 1 taken 1558981 times.
✓ Branch 2 taken 44317333 times.
✓ Branch 3 taken 369392 times.
✓ Branch 4 taken 11441584 times.
✓ Branch 5 taken 2112 times.
✓ Branch 6 taken 5920 times.
163911105 if (i.boundary())
36
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
9156681 flag_ = i.boundarySegmentIndex();
37 161553702 }
38
39 using value_type = std::size_t;
40
41
2/4
✓ Branch 1 taken 816 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2448 times.
✗ Branch 5 not taken.
736932 value_type get() const { return flag_; }
42
43 private:
44 value_type flag_;
45 };
46
47 /*!
48 * \ingroup Core
49 * \brief Boundary flag to store e.g. in sub control volume faces
50 * \note Can be specialized for each grid manager (in the gridmanager headers)
51 * \tparam Grid the type of the grid
52 */
53 template<class Grid>
54
3/5
✓ Branch 1 taken 13070583 times.
✓ Branch 2 taken 1563352 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 115290 times.
✗ Branch 6 not taken.
50837639 class BoundaryFlag : public BoundarySegmentIndexFlag
55
7/14
✓ Branch 0 taken 79274 times.
✓ Branch 1 taken 5918275 times.
✓ Branch 2 taken 2574 times.
✓ Branch 3 taken 3962932 times.
✓ Branch 4 taken 517704 times.
✓ Branch 5 taken 7616 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 31320 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
152290935 { using BoundarySegmentIndexFlag::BoundarySegmentIndexFlag; };
56
57 } // end namespace Dumux
58
59 #endif
60