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 | 49937313 | BoundarySegmentIndexFlag() | |
29 | 49251645 | : flag_(std::numeric_limits<std::size_t>::max()) {} | |
30 | |||
31 | template<class Intersection> | ||
32 | 167032463 | BoundarySegmentIndexFlag(const Intersection& i) | |
33 |
2/2✓ Branch 0 taken 8669690 times.
✓ Branch 1 taken 87643784 times.
|
164748769 | : flag_(std::numeric_limits<std::size_t>::max()) |
34 | { | ||
35 |
6/6✓ Branch 0 taken 7247457 times.
✓ Branch 1 taken 131491696 times.
✓ Branch 2 taken 365628 times.
✓ Branch 3 taken 13031444 times.
✓ Branch 4 taken 2112 times.
✓ Branch 5 taken 5920 times.
|
165467306 | if (i.boundary()) |
36 | 9240050 | flag_ = i.boundarySegmentIndex(); | |
37 | 164647968 | } | |
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 11844375 times.
|
49780153 | class BoundaryFlag : public BoundarySegmentIndexFlag |
55 |
7/9✓ Branch 0 taken 80769 times.
✓ Branch 1 taken 5950056 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 490236 times.
|
154927013 | { using BoundarySegmentIndexFlag::BoundarySegmentIndexFlag; }; |
56 | |||
57 | } // end namespace Dumux | ||
58 | |||
59 | #endif | ||
60 |