GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/discretization/cvfe/elementvolumevariables.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 24 35 68.6%
Functions: 109 349 31.2%
Branches: 464 623 74.5%

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 CVFEDiscretization
10 * \brief The local volume variables class
11 */
12 #ifndef DUMUX_DISCRETIZATION_CVFE_ELEMENT_VOLUMEVARIABLES_HH
13 #define DUMUX_DISCRETIZATION_CVFE_ELEMENT_VOLUMEVARIABLES_HH
14
15 #include <type_traits>
16 #include <utility>
17 #include <vector>
18
19 #include <dumux/discretization/elementsolution.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup CVFEDiscretization
25 * \brief The local (stencil) volume variables class for control-volume finite element
26 * \note The class is specialized for versions with and without caching
27 * \tparam GVV the grid volume variables type
28 * \tparam cachingEnabled if the cache is enabled
29 */
30 template<class GVV, bool cachingEnabled>
31 class CVFEElementVolumeVariables;
32
33 /*!
34 * \ingroup CVFEDiscretization
35 * \brief The local (stencil) volume variables class for control-volume finite element with caching
36 * \note the volume variables are stored for the whole grid view in the corresponding GridVolumeVariables class
37 */
38 template<class GVV>
39 class CVFEElementVolumeVariables<GVV, /*cachingEnabled*/true>
40 {
41 public:
42 //! export type of the grid volume variables
43 using GridVolumeVariables = GVV;
44
45 //! export type of the volume variables
46 using VolumeVariables = typename GridVolumeVariables::VolumeVariables;
47
48 //! Constructor
49 CVFEElementVolumeVariables(const GridVolumeVariables& gridVolVars)
50 : gridVolVarsPtr_(&gridVolVars) {}
51
52 const VolumeVariables& operator [](std::size_t scvIdx) const
53
35/36
✓ Branch 0 taken 5019673 times.
✓ Branch 1 taken 49872607 times.
✓ Branch 2 taken 5019673 times.
✓ Branch 3 taken 49872607 times.
✓ Branch 4 taken 26136510 times.
✓ Branch 5 taken 28755770 times.
✓ Branch 6 taken 26136510 times.
✓ Branch 7 taken 28755770 times.
✓ Branch 8 taken 6968304 times.
✓ Branch 9 taken 289079032 times.
✓ Branch 10 taken 6968304 times.
✓ Branch 11 taken 314455432 times.
✓ Branch 12 taken 145066819 times.
✓ Branch 13 taken 176356917 times.
✓ Branch 14 taken 145071607 times.
✓ Branch 15 taken 176352129 times.
✓ Branch 16 taken 11432638 times.
✓ Branch 17 taken 255602498 times.
✓ Branch 18 taken 11427850 times.
✓ Branch 19 taken 238689686 times.
✓ Branch 20 taken 51957782 times.
✓ Branch 21 taken 111496772 times.
✓ Branch 22 taken 52000076 times.
✓ Branch 23 taken 103080266 times.
✓ Branch 24 taken 42294 times.
✓ Branch 25 taken 64556438 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 64514144 times.
✓ Branch 28 taken 25800 times.
✓ Branch 29 taken 55560 times.
✓ Branch 30 taken 25800 times.
✓ Branch 31 taken 55560 times.
✓ Branch 32 taken 5000 times.
✓ Branch 33 taken 5000 times.
✓ Branch 34 taken 5000 times.
✓ Branch 35 taken 5000 times.
1620937292 { return gridVolVars().volVars(eIdx_, scvIdx); }
54
55 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value, int> = 0>
56 const VolumeVariables& operator [](const SubControlVolume& scv) const
57
31/44
✓ Branch 0 taken 188938572 times.
✓ Branch 1 taken 3345600 times.
✓ Branch 2 taken 188938572 times.
✓ Branch 3 taken 3345600 times.
✓ Branch 4 taken 205856172 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 205856172 times.
✓ Branch 7 taken 15840 times.
✓ Branch 8 taken 538780076 times.
✓ Branch 9 taken 168475168 times.
✓ Branch 10 taken 539416556 times.
✓ Branch 11 taken 169150528 times.
✓ Branch 12 taken 65765980 times.
✓ Branch 13 taken 691200 times.
✓ Branch 14 taken 65765980 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 258046948 times.
✓ Branch 17 taken 6656000 times.
✓ Branch 18 taken 257410468 times.
✓ Branch 19 taken 9332888 times.
✓ Branch 20 taken 3977616 times.
✓ Branch 21 taken 8603064 times.
✓ Branch 22 taken 3977616 times.
✓ Branch 23 taken 5926176 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 40 times.
✓ Branch 28 taken 14744 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 14784 times.
✗ Branch 31 not taken.
✓ Branch 36 taken 120 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 120 times.
✗ Branch 39 not taken.
✓ Branch 44 taken 493848 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 493848 times.
✗ Branch 47 not taken.
✓ Branch 53 taken 40 times.
✗ Branch 54 not taken.
✓ Branch 56 taken 40 times.
✗ Branch 57 not taken.
7445644142 { return gridVolVars().volVars(eIdx_, scv.indexInElement()); }
58
59 /*!
60 * \brief bind the local view (r-value overload)
61 * This overload is called when an instance of this class is a temporary in the usage context
62 * This allows a usage like this: `const auto view = localView(...).bind(element);`
63 */
64 template<class FVElementGeometry, class SolutionVector>
65 CVFEElementVolumeVariables bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
66 const FVElementGeometry& fvGeometry,
67 const SolutionVector& sol) &&
68 {
69 537278 this->bindElement(element, fvGeometry, sol);
70 268639 return std::move(*this);
71 }
72
73 // For compatibility reasons with the case of not storing the vol vars.
74 // function to be called before assembling an element, preparing the vol vars within the stencil
75 template<class FVElementGeometry, class SolutionVector>
76 void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
77 const FVElementGeometry& fvGeometry,
78 const SolutionVector& sol) &
79 {
80 15048582 bindElement(element, fvGeometry, sol);
81 }
82
83 /*!
84 * \brief bind the local view (r-value overload)
85 * This overload is called when an instance of this class is a temporary in the usage context
86 * This allows a usage like this: `const auto view = localView(...).bind(element);`
87 */
88 template<class FVElementGeometry, class SolutionVector>
89 CVFEElementVolumeVariables bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
90 const FVElementGeometry& fvGeometry,
91 const SolutionVector& sol) &&
92 {
93 78060 this->bindElement(element, fvGeometry, sol);
94 39030 return std::move(*this);
95 }
96
97 // function to prepare the vol vars within the element
98 template<class FVElementGeometry, class SolutionVector>
99 void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
100 const FVElementGeometry& fvGeometry,
101 const SolutionVector& sol) &
102 {
103
46/81
✓ Branch 1 taken 55304 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 55304 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 55304 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 15078 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 80320 times.
✓ Branch 20 taken 15078 times.
✓ Branch 21 taken 10487 times.
✓ Branch 22 taken 80320 times.
✓ Branch 23 taken 15078 times.
✓ Branch 24 taken 10487 times.
✓ Branch 25 taken 80320 times.
✓ Branch 26 taken 15078 times.
✓ Branch 27 taken 10487 times.
✓ Branch 28 taken 284772 times.
✓ Branch 29 taken 30156 times.
✓ Branch 30 taken 10487 times.
✓ Branch 31 taken 284772 times.
✓ Branch 32 taken 634356 times.
✗ Branch 33 not taken.
✓ Branch 34 taken 284772 times.
✓ Branch 35 taken 30156 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 2 times.
✓ Branch 38 taken 30156 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 2 times.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 2 times.
✗ Branch 47 not taken.
✓ Branch 48 taken 232104 times.
✗ Branch 49 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 1191312 times.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✓ Branch 56 taken 1191312 times.
✗ Branch 57 not taken.
✓ Branch 59 taken 1191312 times.
✓ Branch 60 taken 20798 times.
✓ Branch 62 taken 1191312 times.
✗ Branch 63 not taken.
✓ Branch 65 taken 71568 times.
✗ Branch 66 not taken.
✓ Branch 68 taken 71568 times.
✗ Branch 69 not taken.
✓ Branch 71 taken 71568 times.
✗ Branch 72 not taken.
✓ Branch 87 taken 4416 times.
✗ Branch 88 not taken.
✓ Branch 90 taken 4416 times.
✓ Branch 91 taken 10400 times.
✗ Branch 92 not taken.
✓ Branch 93 taken 4416 times.
✓ Branch 94 taken 10400 times.
✗ Branch 95 not taken.
✓ Branch 96 taken 4412 times.
✓ Branch 97 taken 10400 times.
✗ Branch 98 not taken.
✓ Branch 100 taken 10400 times.
✗ Branch 101 not taken.
✓ Branch 103 taken 10400 times.
✗ Branch 104 not taken.
✓ Branch 106 taken 10400 times.
✗ Branch 107 not taken.
✓ Branch 109 taken 10400 times.
✗ Branch 110 not taken.
✓ Branch 112 taken 10400 times.
✗ Branch 113 not taken.
47602374 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
104 }
105
106 //! The global volume variables object we are a restriction of
107 const GridVolumeVariables& gridVolVars() const
108 { return *gridVolVarsPtr_; }
109
110 private:
111 const GridVolumeVariables* gridVolVarsPtr_;
112 std::size_t eIdx_;
113 };
114
115
116 /*!
117 * \ingroup CVFEDiscretization
118 * \brief The local (stencil) volume variables class for control-volume finite element without caching
119 */
120 template<class GVV>
121
100/152
✓ Branch 0 taken 292 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 244 times.
✓ Branch 5 taken 1213 times.
✓ Branch 6 taken 42900 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 51 times.
✓ Branch 10 taken 140879 times.
✓ Branch 11 taken 5768265 times.
✓ Branch 12 taken 54 times.
✓ Branch 13 taken 42900 times.
✓ Branch 14 taken 5763529 times.
✓ Branch 15 taken 45199 times.
✓ Branch 16 taken 62096 times.
✓ Branch 17 taken 183688 times.
✓ Branch 18 taken 788612 times.
✓ Branch 19 taken 198148 times.
✓ Branch 20 taken 34 times.
✓ Branch 21 taken 5904317 times.
✓ Branch 22 taken 605 times.
✓ Branch 23 taken 5874809 times.
✓ Branch 24 taken 5071 times.
✓ Branch 25 taken 5763531 times.
✓ Branch 26 taken 373776 times.
✓ Branch 27 taken 23 times.
✓ Branch 28 taken 71034 times.
✓ Branch 29 taken 129665 times.
✓ Branch 30 taken 57360 times.
✓ Branch 31 taken 330903 times.
✓ Branch 32 taken 4466 times.
✓ Branch 33 taken 788772 times.
✓ Branch 34 taken 126138 times.
✓ Branch 35 taken 788623 times.
✓ Branch 36 taken 164432 times.
✓ Branch 37 taken 788612 times.
✓ Branch 38 taken 125694 times.
✓ Branch 39 taken 1048720 times.
✓ Branch 40 taken 655 times.
✓ Branch 41 taken 404 times.
✓ Branch 42 taken 260112 times.
✓ Branch 43 taken 970 times.
✓ Branch 44 taken 412 times.
✓ Branch 45 taken 316432 times.
✓ Branch 46 taken 12 times.
✓ Branch 47 taken 316908 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 321282 times.
✓ Branch 50 taken 16 times.
✓ Branch 51 taken 320882 times.
✓ Branch 52 taken 400 times.
✓ Branch 53 taken 4495 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 4 times.
✗ Branch 56 not taken.
✓ Branch 57 taken 154192 times.
✗ Branch 58 not taken.
✓ Branch 59 taken 161552 times.
✓ Branch 60 taken 260448 times.
✓ Branch 61 taken 153840 times.
✓ Branch 62 taken 421648 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 413936 times.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✓ Branch 67 taken 7708 times.
✗ Branch 68 not taken.
✓ Branch 69 taken 50000 times.
✓ Branch 70 taken 7708 times.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✓ Branch 74 taken 154240 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 1387584 times.
✓ Branch 77 taken 16 times.
✓ Branch 78 taken 154240 times.
✓ Branch 79 taken 160408 times.
✗ Branch 80 not taken.
✓ Branch 81 taken 160408 times.
✗ Branch 82 not taken.
✓ Branch 83 taken 6552 times.
✓ Branch 84 taken 6552 times.
✓ Branch 85 taken 7712 times.
✓ Branch 86 taken 6552 times.
✓ Branch 87 taken 7712 times.
✓ Branch 88 taken 352 times.
✓ Branch 89 taken 7712 times.
✓ Branch 90 taken 353 times.
✗ Branch 91 not taken.
✓ Branch 92 taken 352 times.
✗ Branch 93 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 96 taken 53021 times.
✗ Branch 97 not taken.
✓ Branch 98 taken 3021 times.
✓ Branch 99 taken 57708 times.
✓ Branch 100 taken 3021 times.
✓ Branch 101 taken 10729 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 10729 times.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✓ Branch 106 taken 964000 times.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✓ Branch 109 taken 964000 times.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✓ Branch 112 taken 326574 times.
✓ Branch 113 taken 12168 times.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 50000 times.
✓ Branch 117 taken 175910 times.
✓ Branch 118 taken 56920 times.
✗ Branch 119 not taken.
✓ Branch 120 taken 50000 times.
✗ Branch 121 not taken.
✓ Branch 122 taken 2 times.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✓ Branch 126 taken 2 times.
✓ Branch 127 taken 964000 times.
✗ Branch 128 not taken.
✓ Branch 129 taken 964000 times.
✓ Branch 130 taken 1 times.
✓ Branch 131 taken 964000 times.
✓ Branch 132 taken 1 times.
✗ Branch 133 not taken.
✓ Branch 134 taken 1 times.
✗ Branch 135 not taken.
✓ Branch 136 taken 1 times.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✓ Branch 141 taken 100 times.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✓ Branch 145 taken 1 times.
✗ Branch 146 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✓ Branch 150 taken 1 times.
✗ Branch 151 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
23978740 class CVFEElementVolumeVariables<GVV, /*cachingEnabled*/false>
122 {
123 public:
124 //! export type of the grid volume variables
125 using GridVolumeVariables = GVV;
126
127 //! export type of the volume variables
128 using VolumeVariables = typename GridVolumeVariables::VolumeVariables;
129
130 //! Constructor
131 CVFEElementVolumeVariables(const GridVolumeVariables& gridVolVars)
132
53/70
✓ Branch 1 taken 292 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 292 times.
✓ Branch 5 taken 16329 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 44101 times.
✓ Branch 8 taken 16329 times.
✓ Branch 9 taken 153840 times.
✓ Branch 10 taken 44101 times.
✓ Branch 11 taken 16766 times.
✓ Branch 12 taken 153840 times.
✓ Branch 13 taken 5839062 times.
✓ Branch 14 taken 16024 times.
✓ Branch 15 taken 153840 times.
✓ Branch 16 taken 5838320 times.
✓ Branch 17 taken 158329 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 6002415 times.
✓ Branch 20 taken 4477 times.
✓ Branch 21 taken 16 times.
✓ Branch 22 taken 6002403 times.
✓ Branch 23 taken 4466 times.
✓ Branch 24 taken 16 times.
✓ Branch 25 taken 234876 times.
✓ Branch 26 taken 4466 times.
✓ Branch 27 taken 153856 times.
✓ Branch 28 taken 81036 times.
✓ Branch 29 taken 260096 times.
✓ Branch 30 taken 16 times.
✓ Branch 31 taken 45203 times.
✓ Branch 32 taken 260096 times.
✓ Branch 33 taken 7304 times.
✓ Branch 34 taken 38651 times.
✓ Branch 35 taken 263117 times.
✓ Branch 36 taken 752 times.
✓ Branch 37 taken 442 times.
✓ Branch 38 taken 263117 times.
✓ Branch 39 taken 752 times.
✓ Branch 40 taken 442 times.
✓ Branch 41 taken 3021 times.
✓ Branch 42 taken 752 times.
✓ Branch 43 taken 3021 times.
✓ Branch 45 taken 354162 times.
✗ Branch 46 not taken.
✓ Branch 48 taken 354162 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 198250 times.
✗ Branch 52 not taken.
✓ Branch 54 taken 198250 times.
✗ Branch 55 not taken.
✓ Branch 57 taken 50002 times.
✗ Branch 58 not taken.
✓ Branch 60 taken 50002 times.
✗ Branch 61 not taken.
✓ Branch 63 taken 50002 times.
✗ Branch 64 not taken.
✓ Branch 66 taken 50002 times.
✗ Branch 67 not taken.
✓ Branch 69 taken 964001 times.
✗ Branch 70 not taken.
✓ Branch 72 taken 964001 times.
✗ Branch 73 not taken.
✓ Branch 75 taken 964001 times.
✗ Branch 76 not taken.
✓ Branch 78 taken 964001 times.
✗ Branch 79 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
36695828 : gridVolVarsPtr_(&gridVolVars) {}
133
134 /*!
135 * \brief bind the local view (r-value overload)
136 * This overload is called when an instance of this class is a temporary in the usage context
137 * This allows a usage like this: `const auto view = localView(...).bind(element);`
138 */
139 template<class FVElementGeometry, class SolutionVector>
140 CVFEElementVolumeVariables bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
141 const FVElementGeometry& fvGeometry,
142 const SolutionVector& sol) &&
143 {
144
2/4
✓ Branch 1 taken 161146 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 156861 times.
✗ Branch 5 not taken.
318007 this->bindElement(element, fvGeometry, sol);
145
4/8
✗ Branch 0 not taken.
✓ Branch 1 taken 161146 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 161146 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 156861 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 156861 times.
636014 return std::move(*this);
146 }
147
148 // specialization for control-volume finite element, simply forwards to the bindElement method
149 template<class FVElementGeometry, class SolutionVector>
150 void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
151 const FVElementGeometry& fvGeometry,
152 const SolutionVector& sol) &
153 {
154
21/39
✓ Branch 1 taken 57360 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 281185 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 14291 times.
✓ Branch 8 taken 61038 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 31352 times.
✓ Branch 11 taken 22 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 8788 times.
✓ Branch 14 taken 31352 times.
✓ Branch 15 taken 19752 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 17398 times.
✓ Branch 19 taken 704 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 1007 times.
✓ Branch 22 taken 64 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 2184 times.
✓ Branch 25 taken 800 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 2184 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 101007 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1007 times.
✗ Branch 34 not taken.
✓ Branch 35 taken 200 times.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✓ Branch 38 taken 100 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✓ Branch 41 taken 1928 times.
✗ Branch 42 not taken.
9188528 bindElement(element, fvGeometry, sol);
155 }
156
157 /*!
158 * \brief bind the local view (r-value overload)
159 * This overload is called when an instance of this class is a temporary in the usage context
160 * This allows a usage like this: `const auto view = localView(...).bind(element);`
161 */
162 template<class FVElementGeometry, class SolutionVector>
163 CVFEElementVolumeVariables bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
164 const FVElementGeometry& fvGeometry,
165 const SolutionVector& sol) &&
166 {
167
1/2
✓ Branch 1 taken 40042 times.
✗ Branch 2 not taken.
40042 this->bindElement(element, fvGeometry, sol);
168 80084 return std::move(*this);
169 }
170
171 // specialization for control-volume finite element
172 template<class FVElementGeometry, class SolutionVector>
173 26418300 void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
174 const FVElementGeometry& fvGeometry,
175 const SolutionVector& sol) &
176 {
177 // get the solution at the dofs of the element
178 36025319 auto elemSol = elementSolution(element, sol, fvGeometry.gridGeometry());
179
180 // resize volume variables to the required size
181 52836600 volumeVariables_.resize(fvGeometry.numScv());
182
4/4
✓ Branch 0 taken 69660152 times.
✓ Branch 1 taken 20887850 times.
✓ Branch 2 taken 62735058 times.
✓ Branch 3 taken 17425316 times.
139411010 for (auto&& scv : scvs(fvGeometry))
183 169283338 volumeVariables_[scv.indexInElement()].update(elemSol, gridVolVars().problem(), element, scv);
184 26418282 }
185
186 const VolumeVariables& operator [](std::size_t scvIdx) const
187
64/64
✓ Branch 0 taken 43678 times.
✓ Branch 1 taken 135219711 times.
✓ Branch 2 taken 43678 times.
✓ Branch 3 taken 135219711 times.
✓ Branch 4 taken 65267635 times.
✓ Branch 5 taken 69995754 times.
✓ Branch 6 taken 65267635 times.
✓ Branch 7 taken 69995754 times.
✓ Branch 8 taken 306284 times.
✓ Branch 9 taken 280824637 times.
✓ Branch 10 taken 306284 times.
✓ Branch 11 taken 317426031 times.
✓ Branch 12 taken 135873992 times.
✓ Branch 13 taken 183419752 times.
✓ Branch 14 taken 135944269 times.
✓ Branch 15 taken 183341565 times.
✓ Branch 16 taken 2142349 times.
✓ Branch 17 taken 519503163 times.
✓ Branch 18 taken 2072072 times.
✓ Branch 19 taken 487103108 times.
✓ Branch 20 taken 228492499 times.
✓ Branch 21 taken 251103783 times.
✓ Branch 22 taken 228492819 times.
✓ Branch 23 taken 247032711 times.
✓ Branch 24 taken 971163 times.
✓ Branch 25 taken 219730718 times.
✓ Branch 26 taken 971498 times.
✓ Branch 27 taken 219678638 times.
✓ Branch 28 taken 6288962 times.
✓ Branch 29 taken 9228766 times.
✓ Branch 30 taken 6288307 times.
✓ Branch 31 taken 12947166 times.
✓ Branch 32 taken 46353 times.
✓ Branch 33 taken 5931068 times.
✓ Branch 34 taken 44346 times.
✓ Branch 35 taken 5930198 times.
✓ Branch 36 taken 370976 times.
✓ Branch 37 taken 3852242 times.
✓ Branch 38 taken 370976 times.
✓ Branch 39 taken 2015442 times.
✓ Branch 40 taken 377839 times.
✓ Branch 41 taken 1947642 times.
✓ Branch 42 taken 356825 times.
✓ Branch 43 taken 1939886 times.
✓ Branch 44 taken 727054 times.
✓ Branch 45 taken 2176655 times.
✓ Branch 46 taken 727054 times.
✓ Branch 47 taken 295055 times.
✓ Branch 48 taken 12028624 times.
✓ Branch 49 taken 23070071 times.
✓ Branch 50 taken 12028624 times.
✓ Branch 51 taken 23070071 times.
✓ Branch 52 taken 11567609 times.
✓ Branch 53 taken 23531017 times.
✓ Branch 54 taken 11567609 times.
✓ Branch 55 taken 23531017 times.
✓ Branch 56 taken 932612 times.
✓ Branch 57 taken 33539038 times.
✓ Branch 58 taken 1 times.
✓ Branch 59 taken 31948673 times.
✓ Branch 60 taken 1 times.
✓ Branch 61 taken 31948673 times.
✓ Branch 62 taken 1 times.
✓ Branch 63 taken 31948673 times.
2760412757 { return volumeVariables_[scvIdx]; }
188
189 VolumeVariables& operator [](std::size_t scvIdx)
190 { return volumeVariables_[scvIdx]; }
191
192 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value, int> = 0>
193 const VolumeVariables& operator [](const SubControlVolume& scv) const
194
92/96
✓ Branch 0 taken 325195156 times.
✓ Branch 1 taken 4056944 times.
✓ Branch 2 taken 326792356 times.
✓ Branch 3 taken 4056944 times.
✓ Branch 4 taken 304563632 times.
✓ Branch 5 taken 3094457 times.
✓ Branch 6 taken 304563632 times.
✓ Branch 7 taken 8205955 times.
✓ Branch 8 taken 349224469 times.
✓ Branch 9 taken 516790045 times.
✓ Branch 10 taken 414461862 times.
✓ Branch 11 taken 512046083 times.
✓ Branch 12 taken 257067626 times.
✓ Branch 13 taken 14965789 times.
✓ Branch 14 taken 250820578 times.
✓ Branch 15 taken 14632613 times.
✓ Branch 16 taken 649339069 times.
✓ Branch 17 taken 32621563 times.
✓ Branch 18 taken 814851130 times.
✓ Branch 19 taken 51819493 times.
✓ Branch 20 taken 248370823 times.
✓ Branch 21 taken 26927993 times.
✓ Branch 22 taken 22466803 times.
✓ Branch 23 taken 7695703 times.
✓ Branch 24 taken 10447979 times.
✓ Branch 25 taken 6709575 times.
✓ Branch 26 taken 11423461 times.
✓ Branch 27 taken 10511987 times.
✓ Branch 28 taken 6577172 times.
✓ Branch 29 taken 5830844 times.
✓ Branch 30 taken 9497886 times.
✓ Branch 31 taken 2113202 times.
✓ Branch 32 taken 4860446 times.
✓ Branch 33 taken 7197730 times.
✓ Branch 34 taken 4791326 times.
✓ Branch 35 taken 7242618 times.
✓ Branch 36 taken 3449064 times.
✓ Branch 37 taken 19573520 times.
✓ Branch 38 taken 3449064 times.
✓ Branch 39 taken 19480976 times.
✓ Branch 40 taken 1128803 times.
✓ Branch 41 taken 5827197 times.
✓ Branch 42 taken 1139779 times.
✓ Branch 43 taken 5827197 times.
✓ Branch 44 taken 1537622 times.
✓ Branch 45 taken 2937610 times.
✓ Branch 46 taken 410977 times.
✓ Branch 47 taken 4479 times.
✓ Branch 48 taken 472032 times.
✓ Branch 49 taken 231240 times.
✓ Branch 50 taken 461056 times.
✓ Branch 51 taken 484744 times.
✓ Branch 52 taken 14575719 times.
✓ Branch 53 taken 369025 times.
✓ Branch 54 taken 14575719 times.
✓ Branch 55 taken 115521 times.
✓ Branch 56 taken 15205473 times.
✓ Branch 57 taken 40599361 times.
✓ Branch 58 taken 15205473 times.
✓ Branch 59 taken 40599361 times.
✓ Branch 60 taken 4799176 times.
✓ Branch 61 taken 35837458 times.
✓ Branch 62 taken 4799176 times.
✓ Branch 63 taken 35837458 times.
✓ Branch 64 taken 98329 times.
✓ Branch 65 taken 39040 times.
✓ Branch 66 taken 98329 times.
✓ Branch 67 taken 39040 times.
✗ Branch 68 not taken.
✓ Branch 69 taken 294984 times.
✓ Branch 70 taken 1 times.
✓ Branch 71 taken 370259 times.
✓ Branch 72 taken 1301 times.
✓ Branch 73 taken 75275 times.
✓ Branch 74 taken 1301 times.
✓ Branch 75 taken 82759 times.
✓ Branch 76 taken 1301 times.
✓ Branch 77 taken 82759 times.
✓ Branch 78 taken 1300 times.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✓ Branch 81 taken 2600 times.
✗ Branch 82 not taken.
✓ Branch 83 taken 156760 times.
✓ Branch 84 taken 400 times.
✓ Branch 85 taken 159944 times.
✓ Branch 86 taken 400 times.
✓ Branch 87 taken 5784 times.
✓ Branch 88 taken 2913 times.
✓ Branch 89 taken 2871 times.
✓ Branch 90 taken 2913 times.
✓ Branch 91 taken 2871 times.
✓ Branch 92 taken 1 times.
✓ Branch 93 taken 37039 times.
✓ Branch 94 taken 1 times.
✓ Branch 95 taken 37039 times.
12557349812 { return volumeVariables_[scv.indexInElement()]; }
195
196 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value, int> = 0>
197 VolumeVariables& operator [](const SubControlVolume& scv)
198
11/19
✗ Branch 0 not taken.
✓ Branch 1 taken 1489044 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1489044 times.
✓ Branch 4 taken 1057616 times.
✓ Branch 5 taken 4834504 times.
✓ Branch 6 taken 1057616 times.
✓ Branch 7 taken 2803548 times.
✓ Branch 8 taken 2030956 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 13 taken 2202 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2202 times.
✓ Branch 17 taken 57 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 57 times.
✗ Branch 21 not taken.
294707116 { return volumeVariables_[scv.indexInElement()]; }
199
200 //! The global volume variables object we are a restriction of
201 const GridVolumeVariables& gridVolVars() const
202 { return *gridVolVarsPtr_; }
203
204 private:
205 const GridVolumeVariables* gridVolVarsPtr_;
206 std::vector<VolumeVariables> volumeVariables_;
207 };
208
209 } // end namespace Dumux
210
211 #endif
212