GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/common/boundaryflag.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 15 17 88.2%
Branches: 15 27 55.6%

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 50908949 : flag_(std::numeric_limits<std::size_t>::max()) {}
30
31 template<class Intersection>
32 164088191 BoundarySegmentIndexFlag(const Intersection& i)
33 164088191 : flag_(std::numeric_limits<std::size_t>::max())
34 {
35
7/7
✓ Branch 0 taken 94770423 times.
✓ Branch 1 taken 1643779 times.
✓ Branch 2 taken 44317366 times.
✓ Branch 3 taken 371699 times.
✓ Branch 4 taken 11441584 times.
✓ Branch 5 taken 2112 times.
✓ Branch 6 taken 5920 times.
164088191 if (i.boundary())
36
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
9163437 flag_ = i.boundarySegmentIndex();
37 161728448 }
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 51437457 class BoundaryFlag : public BoundarySegmentIndexFlag
55
6/14
✓ Branch 0 taken 79307 times.
✓ Branch 1 taken 5923396 times.
✓ Branch 2 taken 3256 times.
✓ Branch 3 taken 3962932 times.
✓ Branch 4 taken 519068 times.
✓ Branch 5 taken 36472 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
152468021 { using BoundarySegmentIndexFlag::BoundarySegmentIndexFlag; };
56
57 } // end namespace Dumux
58
59 #endif
60