GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/common/boundaryflag.hh
Date: 2025-06-14 19:21:29
Exec Total Coverage
Lines: 10 10 100.0%
Functions: 15 16 93.8%
Branches: 20 26 76.9%

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-FileCopyrightText: 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 53548549 BoundarySegmentIndexFlag()
29 52862881 : flag_(std::numeric_limits<std::size_t>::max()) {}
30
31 template<class Intersection>
32 167589091 BoundarySegmentIndexFlag(const Intersection& i)
33
2/2
✓ Branch 0 taken 9025823 times.
✓ Branch 1 taken 87715855 times.
165305397 : flag_(std::numeric_limits<std::size_t>::max())
34 {
35
6/6
✓ Branch 0 taken 7357755 times.
✓ Branch 1 taken 131509822 times.
✓ Branch 2 taken 365628 times.
✓ Branch 3 taken 13031444 times.
✓ Branch 4 taken 2112 times.
✓ Branch 5 taken 5920 times.
165934848 if (i.boundary())
36 9689466 flag_ = i.boundarySegmentIndex();
37 165204596 }
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 2 taken 1563352 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 115290 times.
✗ Branch 6 not taken.
✓ Branch 1 taken 13935087 times.
53391389 class BoundaryFlag : public BoundarySegmentIndexFlag
55
7/9
✓ Branch 0 taken 80769 times.
✓ Branch 1 taken 6027828 times.
✓ Branch 2 taken 3256 times.
✓ Branch 3 taken 5565624 times.
✓ Branch 5 taken 7616 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 31320 times.
✗ Branch 9 not taken.
✓ Branch 4 taken 969092 times.
155483641 { using BoundarySegmentIndexFlag::BoundarySegmentIndexFlag; };
56
57 } // end namespace Dumux
58
59 #endif
60