GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/common/fvproblemwithspatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 335 363 92.3%
Branches: 182 234 77.8%

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 Base class for all finite volume problems that are parameterized.
11 */
12 #ifndef DUMUX_COMMON_FV_PROBLEM_WITH_SPATIAL_PARAMS_HH
13 #define DUMUX_COMMON_FV_PROBLEM_WITH_SPATIAL_PARAMS_HH
14
15 #include <memory>
16
17 #include <dumux/common/properties.hh>
18 #include <dumux/common/fvproblem.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup Core
24 * \brief Base class for all finite-volume problems using spatial parameters.
25 */
26 template<class TypeTag>
27 class FVProblemWithSpatialParams
28 : public FVProblem<TypeTag>
29 {
30 using ParentType = FVProblem<TypeTag>;
31 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
32
33 public:
34 using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>;
35
36 /*!
37 * \brief Constructor
38 * \param gridGeometry The finite volume grid geometry
39 * \param paramGroup The parameter group in which to look for runtime parameters first (default is "")
40 * \note This constructor assumes the spatial parameters to be constructible from a grid geometry
41 */
42 753 FVProblemWithSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
43 const std::string& paramGroup = "")
44 : ParentType(gridGeometry, paramGroup)
45
3/8
✓ Branch 2 taken 548 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 548 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 548 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
1506 , spatialParams_(std::make_shared<SpatialParams>(gridGeometry))
46 753 {}
47
48 /*!
49 * \brief Constructor
50 * \param gridGeometry The finite volume grid geometry
51 * \param spatialParams The spatially varying parameters
52 * \param paramGroup The parameter group in which to look for runtime parameters first (default is "")
53 */
54 317 FVProblemWithSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
55 std::shared_ptr<SpatialParams> spatialParams,
56 const std::string& paramGroup = "")
57 : ParentType(gridGeometry, paramGroup)
58
2/6
✓ Branch 2 taken 185 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 185 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
634 , spatialParams_(spatialParams)
59 317 {}
60
61 //! Return a reference to the underlying spatial parameters
62 const SpatialParams& spatialParams() const
63
149/178
✓ Branch 0 taken 7002016 times.
✓ Branch 1 taken 24134592 times.
✓ Branch 2 taken 20237680 times.
✓ Branch 3 taken 79664198 times.
✓ Branch 4 taken 16128493 times.
✓ Branch 5 taken 88317304 times.
✓ Branch 6 taken 23441660 times.
✓ Branch 7 taken 48830243 times.
✓ Branch 8 taken 24225214 times.
✓ Branch 9 taken 77874132 times.
✓ Branch 10 taken 7435395 times.
✓ Branch 11 taken 74097531 times.
✓ Branch 12 taken 4939211 times.
✓ Branch 13 taken 16832996 times.
✓ Branch 14 taken 30298745 times.
✓ Branch 15 taken 21385242 times.
✓ Branch 16 taken 34839717 times.
✓ Branch 17 taken 53295506 times.
✓ Branch 18 taken 30664218 times.
✓ Branch 19 taken 45909031 times.
✓ Branch 20 taken 55669928 times.
✓ Branch 21 taken 10360194 times.
✓ Branch 22 taken 41206262 times.
✓ Branch 23 taken 8814681 times.
✓ Branch 24 taken 12148076 times.
✓ Branch 25 taken 37228497 times.
✓ Branch 26 taken 12047489 times.
✓ Branch 27 taken 37148660 times.
✓ Branch 28 taken 9157352 times.
✓ Branch 29 taken 6589308 times.
✓ Branch 30 taken 9081508 times.
✓ Branch 31 taken 9230472 times.
✓ Branch 32 taken 9085893 times.
✓ Branch 33 taken 6438473 times.
✓ Branch 34 taken 2808311 times.
✓ Branch 35 taken 6132 times.
✓ Branch 36 taken 16312 times.
✓ Branch 37 taken 1168312 times.
✓ Branch 38 taken 7387 times.
✓ Branch 39 taken 9120 times.
✓ Branch 40 taken 1170389 times.
✓ Branch 41 taken 5330 times.
✓ Branch 42 taken 16210 times.
✓ Branch 43 taken 6026 times.
✓ Branch 44 taken 8514 times.
✓ Branch 45 taken 26402 times.
✓ Branch 46 taken 8250 times.
✓ Branch 47 taken 36295 times.
✓ Branch 48 taken 28152 times.
✓ Branch 49 taken 3105 times.
✓ Branch 50 taken 32737 times.
✓ Branch 51 taken 4402 times.
✓ Branch 52 taken 1766 times.
✓ Branch 53 taken 142057 times.
✓ Branch 54 taken 1467 times.
✓ Branch 55 taken 143176 times.
✓ Branch 56 taken 822 times.
✓ Branch 57 taken 2182 times.
✓ Branch 58 taken 1941 times.
✓ Branch 59 taken 303894 times.
✓ Branch 60 taken 586 times.
✓ Branch 61 taken 2613 times.
✓ Branch 62 taken 303222 times.
✓ Branch 63 taken 1258 times.
✓ Branch 64 taken 1413 times.
✓ Branch 65 taken 5400 times.
✓ Branch 66 taken 58 times.
✓ Branch 67 taken 80 times.
✓ Branch 68 taken 4728 times.
✓ Branch 69 taken 117864 times.
✓ Branch 70 taken 80 times.
✓ Branch 71 taken 403056 times.
✓ Branch 72 taken 117864 times.
✓ Branch 73 taken 22824 times.
✓ Branch 74 taken 403056 times.
✓ Branch 75 taken 528 times.
✓ Branch 76 taken 22296 times.
✓ Branch 77 taken 528 times.
✗ Branch 78 not taken.
✓ Branch 79 taken 608 times.
✗ Branch 80 not taken.
✓ Branch 81 taken 1056 times.
✓ Branch 82 taken 80 times.
✗ Branch 83 not taken.
✓ Branch 84 taken 1056 times.
✓ Branch 85 taken 1797 times.
✗ Branch 86 not taken.
✓ Branch 87 taken 3022 times.
✓ Branch 88 taken 1209 times.
✓ Branch 89 taken 3254 times.
✗ Branch 90 not taken.
✓ Branch 91 taken 4579 times.
✗ Branch 92 not taken.
✓ Branch 93 taken 2782 times.
✓ Branch 94 taken 1209 times.
✓ Branch 95 taken 1386 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 3759 times.
✓ Branch 98 taken 1038 times.
✓ Branch 99 taken 244 times.
✓ Branch 100 taken 3643 times.
✓ Branch 101 taken 1154 times.
✓ Branch 102 taken 244 times.
✓ Branch 103 taken 2434 times.
✓ Branch 104 taken 1154 times.
✓ Branch 105 taken 244 times.
✓ Branch 106 taken 2434 times.
✓ Branch 107 taken 1154 times.
✓ Branch 108 taken 244 times.
✓ Branch 109 taken 2434 times.
✓ Branch 110 taken 1154 times.
✓ Branch 111 taken 358531 times.
✓ Branch 112 taken 2434 times.
✓ Branch 113 taken 116 times.
✓ Branch 114 taken 358531 times.
✗ Branch 115 not taken.
✓ Branch 116 taken 116 times.
✓ Branch 117 taken 358287 times.
✗ Branch 118 not taken.
✓ Branch 120 taken 358287 times.
✓ Branch 121 taken 119664 times.
✗ Branch 122 not taken.
✓ Branch 123 taken 358335 times.
✓ Branch 124 taken 119664 times.
✗ Branch 125 not taken.
✓ Branch 126 taken 358335 times.
✓ Branch 127 taken 119664 times.
✗ Branch 128 not taken.
✓ Branch 129 taken 48 times.
✓ Branch 130 taken 119664 times.
✗ Branch 131 not taken.
✓ Branch 132 taken 48 times.
✓ Branch 133 taken 120486 times.
✗ Branch 134 not taken.
✓ Branch 135 taken 870 times.
✓ Branch 136 taken 119664 times.
✓ Branch 137 taken 822 times.
✓ Branch 138 taken 48 times.
✓ Branch 139 taken 822 times.
✗ Branch 142 not taken.
✓ Branch 143 taken 2712 times.
✗ Branch 144 not taken.
✓ Branch 145 taken 22296 times.
✓ Branch 146 taken 2364 times.
✓ Branch 147 taken 348 times.
✓ Branch 148 taken 21948 times.
✓ Branch 149 taken 2712 times.
✗ Branch 150 not taken.
✓ Branch 152 taken 2364 times.
✓ Branch 153 taken 1020 times.
✗ Branch 154 not taken.
✓ Branch 155 taken 2364 times.
✓ Branch 156 taken 1020 times.
✗ Branch 157 not taken.
✓ Branch 158 taken 2364 times.
✓ Branch 159 taken 1020 times.
✗ Branch 160 not taken.
✓ Branch 161 taken 24 times.
✓ Branch 162 taken 1020 times.
✓ Branch 163 taken 24 times.
✗ Branch 164 not taken.
✓ Branch 165 taken 1044 times.
✗ Branch 166 not taken.
✓ Branch 167 taken 24 times.
✓ Branch 168 taken 1020 times.
✗ Branch 169 not taken.
✓ Branch 173 taken 528 times.
✗ Branch 174 not taken.
✓ Branch 176 taken 528 times.
✗ Branch 177 not taken.
✓ Branch 179 taken 528 times.
✗ Branch 180 not taken.
✓ Branch 182 taken 528 times.
✗ Branch 183 not taken.
✓ Branch 185 taken 528 times.
✗ Branch 186 not taken.
✓ Branch 188 taken 528 times.
✗ Branch 189 not taken.
9024165388 { return *spatialParams_; }
64
65 //! Return a reference to the underlying spatial parameters
66 SpatialParams& spatialParams()
67
28/42
✓ Branch 1 taken 7919 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 7919 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 3471 times.
✓ Branch 7 taken 40420 times.
✓ Branch 8 taken 3470 times.
✓ Branch 9 taken 33201 times.
✓ Branch 10 taken 10690 times.
✓ Branch 11 taken 33200 times.
✓ Branch 12 taken 3471 times.
✓ Branch 13 taken 33201 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
✓ Branch 19 taken 50 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
✓ Branch 22 taken 50 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 51 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
✓ Branch 28 taken 51 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 1 times.
✓ Branch 31 taken 51 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 51 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 1 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 1 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
281930 { return *spatialParams_; }
68
69 private:
70 //! Spatially varying parameters
71 std::shared_ptr<SpatialParams> spatialParams_;
72 };
73
74 } // end namespace Dumux
75
76 #endif
77