GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/assembly/fvlocalassemblerbase.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 66 80 82.5%
Functions: 1336 3665 36.5%
Branches: 213 356 59.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 Assembly
10 * \copydoc Dumux::FVLocalAssemblerBase
11 */
12 #ifndef DUMUX_FV_LOCAL_ASSEMBLER_BASE_HH
13 #define DUMUX_FV_LOCAL_ASSEMBLER_BASE_HH
14
15 #include <dune/common/reservedvector.hh>
16 #include <dune/grid/common/gridenums.hh> // for GhostEntity
17 #include <dune/istl/matrixindexset.hh>
18
19 #include <dumux/common/reservedblockvector.hh>
20 #include <dumux/common/properties.hh>
21 #include <dumux/common/parameters.hh>
22 #include <dumux/assembly/diffmethod.hh>
23
24 namespace Dumux {
25
26 /*!
27 * \ingroup Assembly
28 * \brief A base class for all local assemblers
29 * \tparam TypeTag The TypeTag
30 * \tparam Assembler The assembler type
31 * \tparam Implementation The assembler implementation
32 * \tparam useImplicitAssembly Specifies whether the time discretization is implicit or not not (i.e. explicit)
33 */
34 template<class TypeTag, class Assembler, class Implementation, bool useImplicitAssembly>
35
4/16
✓ Branch 0 taken 3004014 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 520933 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 261056 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 445231 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
41455990 class FVLocalAssemblerBase
36 {
37 using Problem = GetPropType<TypeTag, Properties::Problem>;
38 using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
39 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
40 using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>;
41 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
42 using SolutionVector = typename Assembler::SolutionVector;
43 using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>;
44 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
45 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
46 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
47 using GridVolumeVariables = GetPropType<TypeTag, Properties::GridVolumeVariables>;
48 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
49 using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
50 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
51 using Element = typename GridView::template Codim<0>::Entity;
52 static constexpr auto numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq();
53
54 public:
55 using LocalResidual = std::decay_t<decltype(std::declval<Assembler>().localResidual())>;
56 using ElementResidualVector = typename LocalResidual::ElementResidualVector;
57
58 /*!
59 * \brief The constructor. Delegates to the general constructor.
60 */
61 42428744 explicit FVLocalAssemblerBase(const Assembler& assembler,
62 const Element& element,
63 const SolutionVector& curSol)
64 : FVLocalAssemblerBase(assembler,
65 element,
66 curSol,
67
1/2
✓ Branch 1 taken 6728 times.
✗ Branch 2 not taken.
84850760 localView(assembler.gridGeometry()),
68
3/12
✓ Branch 1 taken 36208997 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2712600 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2712600 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 not taken.
54182828 localView(assembler.gridVariables().curGridVolVars()),
69
3/12
✓ Branch 1 taken 36208997 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2712600 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2712600 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 not taken.
54182828 localView(assembler.gridVariables().prevGridVolVars()),
70
3/12
✓ Branch 1 taken 36208997 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4888528 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4888528 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 not taken.
61289762 localView(assembler.gridVariables().gridFluxVarsCache()),
71 assembler.localResidual(),
72
38/44
✓ Branch 0 taken 2130338 times.
✓ Branch 1 taken 4726261 times.
✓ Branch 2 taken 30721949 times.
✓ Branch 3 taken 2080882 times.
✓ Branch 4 taken 4721657 times.
✓ Branch 5 taken 30721949 times.
✓ Branch 6 taken 3396373 times.
✓ Branch 7 taken 3406166 times.
✓ Branch 8 taken 31912401 times.
✓ Branch 9 taken 2080882 times.
✓ Branch 10 taken 3406166 times.
✓ Branch 11 taken 30721949 times.
✓ Branch 12 taken 2080882 times.
✓ Branch 13 taken 2480092 times.
✓ Branch 14 taken 30721949 times.
✓ Branch 15 taken 2080882 times.
✓ Branch 16 taken 2480092 times.
✓ Branch 17 taken 30721949 times.
✓ Branch 18 taken 2080882 times.
✓ Branch 19 taken 2480092 times.
✓ Branch 20 taken 30117749 times.
✓ Branch 21 taken 2080882 times.
✓ Branch 22 taken 2480092 times.
✓ Branch 23 taken 28928695 times.
✓ Branch 24 taken 2080882 times.
✓ Branch 25 taken 2480092 times.
✓ Branch 26 taken 26195763 times.
✓ Branch 27 taken 2043142 times.
✓ Branch 28 taken 1295038 times.
✓ Branch 29 taken 26195763 times.
✓ Branch 30 taken 2043142 times.
✓ Branch 31 taken 1295038 times.
✓ Branch 32 taken 2448492 times.
✓ Branch 33 taken 4078854 times.
✓ Branch 34 taken 1826388 times.
✓ Branch 35 taken 4084390 times.
✓ Branch 36 taken 1741788 times.
✓ Branch 37 taken 5536 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
112152550 element.partitionType() == Dune::GhostEntity)
73 41502670 {}
74
75 /*!
76 * \brief The constructor. General version explicitly expecting each argument.
77 */
78 117030020 explicit FVLocalAssemblerBase(const Assembler& assembler,
79 const Element& element,
80 const SolutionVector& curSol,
81 const FVElementGeometry& fvGeometry,
82 const ElementVolumeVariables& curElemVolVars,
83 const ElementVolumeVariables& prevElemVolVars,
84 const ElementFluxVariablesCache& elemFluxVarsCache,
85 const LocalResidual& localResidual,
86 const bool elementIsGhost)
87 : assembler_(assembler)
88 , element_(element)
89 , curSol_(curSol)
90 , fvGeometry_(fvGeometry)
91 , curElemVolVars_(curElemVolVars)
92 , prevElemVolVars_(prevElemVolVars)
93 , elemFluxVarsCache_(elemFluxVarsCache)
94 , localResidual_(localResidual)
95
11/18
✗ Branch 0 not taken.
✓ Branch 1 taken 43222290 times.
✓ Branch 2 taken 31039312 times.
✓ Branch 3 taken 128544 times.
✓ Branch 4 taken 43661866 times.
✓ Branch 5 taken 26238408 times.
✓ Branch 6 taken 31036 times.
✓ Branch 7 taken 10222037 times.
✓ Branch 8 taken 26234892 times.
✓ Branch 9 taken 678720 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 657940 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 20 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
124201132 , elementIsGhost_(elementIsGhost)
96 111680490 {}
97
98 /*!
99 * \brief Returns true if the assembler considers implicit assembly.
100 */
101 static constexpr bool isImplicit()
102 { return useImplicitAssembly; }
103
104 /*!
105 * \brief Convenience function to evaluate the complete local residual for the current element. Automatically chooses the the appropriate
106 * element volume variables.
107 */
108 293240321 ElementResidualVector evalLocalResidual() const
109 {
110 if (!isImplicit())
111
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 5378800 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 3042000 times.
15754800 if (this->assembler().isStationaryProblem())
112 DUNE_THROW(Dune::InvalidStateException, "Using explicit jacobian assembler with stationary local residual");
113
114
12/30
✓ Branch 0 taken 177541 times.
✓ Branch 1 taken 222218772 times.
✓ Branch 2 taken 63360 times.
✓ Branch 3 taken 14916371 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1260475 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1399172 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 762796 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 568104 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 126033 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 252033 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 23 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 46 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
320112008 if (elementIsGhost())
115 246821 return ElementResidualVector(0.0);
116
117
3/5
✓ Branch 1 taken 3991198 times.
✓ Branch 2 taken 109200 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7053 times.
✗ Branch 5 not taken.
594145987 return isImplicit() ? evalLocalResidual(curElemVolVars())
118 293094458 : evalLocalResidual(prevElemVolVars());
119 }
120
121 /*!
122 * \brief Evaluates the complete local residual for the current element.
123 * \param elemVolVars The element volume variables
124 */
125 329309149 ElementResidualVector evalLocalResidual(const ElementVolumeVariables& elemVolVars) const
126 {
127
4/4
✓ Branch 0 taken 205785770 times.
✓ Branch 1 taken 35804563 times.
✓ Branch 2 taken 54179902 times.
✓ Branch 3 taken 29391930 times.
495423277 if (!assembler().isStationaryProblem())
128 {
129 522623306 ElementResidualVector residual = evalLocalFluxAndSourceResidual(elemVolVars);
130 425370758 residual += evalLocalStorageResidual();
131 261311652 return residual;
132 }
133 else
134 67997495 return evalLocalFluxAndSourceResidual(elemVolVars);
135 }
136
137 /*!
138 * \brief Convenience function to evaluate the flux and source terms (i.e, the terms without a time derivative)
139 * of the local residual for the current element. Automatically chooses the the appropriate
140 * element volume variables.
141 */
142 ElementResidualVector evalLocalFluxAndSourceResidual() const
143 {
144 return isImplicit() ? evalLocalFluxAndSourceResidual(curElemVolVars())
145 : evalLocalFluxAndSourceResidual(prevElemVolVars());
146 }
147
148 /*!
149 * \brief Evaluates the flux and source terms (i.e, the terms without a time derivative)
150 * of the local residual for the current element.
151 *
152 * \param elemVolVars The element volume variables
153 */
154 ElementResidualVector evalLocalFluxAndSourceResidual(const ElementVolumeVariables& elemVolVars) const
155 {
156 241590333 return localResidual_.evalFluxAndSource(element_, fvGeometry_, elemVolVars, elemFluxVarsCache_, elemBcTypes_);
157 }
158
159 /*!
160 * \brief Convenience function to evaluate storage term (i.e, the term with a time derivative)
161 * of the local residual for the current element. Automatically chooses the the appropriate
162 * element volume variables.
163 */
164 ElementResidualVector evalLocalStorageResidual() const
165 {
166 209791769 return localResidual_.evalStorage(element_, fvGeometry_, prevElemVolVars_, curElemVolVars_);
167 }
168
169 /*!
170 * \brief Convenience function bind and prepare all relevant variables required for the
171 * evaluation of the local residual.
172 */
173 42428744 void bindLocalViews()
174 {
175 // get some references for convenience
176 42428744 const auto& element = this->element();
177 42428744 const auto& curSol = this->curSol();
178 42428744 const auto& prevSol = this->assembler().prevSol();
179 84857488 auto&& fvGeometry = this->fvGeometry();
180 84857488 auto&& curElemVolVars = this->curElemVolVars();
181 84857488 auto&& prevElemVolVars = this->prevElemVolVars();
182 84857488 auto&& elemFluxVarsCache = this->elemFluxVarsCache();
183
184 // bind the caches
185 84857488 fvGeometry.bind(element);
186
187 if (isImplicit())
188 {
189 38765144 curElemVolVars.bind(element, fvGeometry, curSol);
190 38765144 elemFluxVarsCache.bind(element, fvGeometry, curElemVolVars);
191
2/2
✓ Branch 0 taken 29856169 times.
✓ Branch 1 taken 1394379 times.
38765144 if (!this->assembler().isStationaryProblem())
192 30089641 prevElemVolVars.bindElement(element, fvGeometry, this->assembler().prevSol());
193 }
194 else
195 {
196 3663600 curElemVolVars.bindElement(element, fvGeometry, curSol);
197 3663600 prevElemVolVars.bind(element, fvGeometry, prevSol);
198 3663600 elemFluxVarsCache.bind(element, fvGeometry, prevElemVolVars);
199 }
200 42428744 }
201
202 /*!
203 * \brief Enforces Dirichlet constraints if enabled in the problem
204 */
205 template<typename ApplyFunction, class P = Problem, typename std::enable_if_t<P::enableInternalDirichletConstraints(), int> = 0>
206 718600 void enforceInternalDirichletConstraints(const ApplyFunction& applyDirichlet)
207 {
208 // enforce Dirichlet constraints strongly by overwriting partial derivatives with 1 or 0
209 // and set the residual to (privar - dirichletvalue)
210
5/6
✓ Branch 0 taken 725600 times.
✓ Branch 1 taken 711900 times.
✓ Branch 2 taken 725400 times.
✓ Branch 3 taken 711700 times.
✓ Branch 4 taken 705000 times.
✗ Branch 5 not taken.
1464600 for (const auto& scvI : scvs(this->fvGeometry()))
211 {
212
2/4
✓ Branch 0 taken 705000 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 705000 times.
✗ Branch 3 not taken.
1494600 const auto internalDirichletConstraints = asImp_().problem().hasInternalDirichletConstraint(this->element(), scvI);
213
4/4
✓ Branch 0 taken 124 times.
✓ Branch 1 taken 725476 times.
✓ Branch 2 taken 124 times.
✓ Branch 3 taken 725476 times.
1492000 if (internalDirichletConstraints.any())
214 {
215 250 const auto dirichletValues = asImp_().problem().internalDirichlet(this->element(), scvI);
216 // set the Dirichlet conditions in residual and jacobian
217
2/2
✓ Branch 0 taken 124 times.
✓ Branch 1 taken 124 times.
272 for (int eqIdx = 0; eqIdx < internalDirichletConstraints.size(); ++eqIdx)
218
0/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
136 if (internalDirichletConstraints[eqIdx])
219 136 applyDirichlet(scvI, dirichletValues, eqIdx, eqIdx);
220 }
221 }
222 718600 }
223
224 template<typename ApplyFunction, class P = Problem, typename std::enable_if_t<!P::enableInternalDirichletConstraints(), int> = 0>
225 void enforceInternalDirichletConstraints(const ApplyFunction& applyDirichlet)
226 {}
227
228 //! The problem
229 const Problem& problem() const
230
36/44
✓ Branch 0 taken 175553 times.
✓ Branch 1 taken 138598 times.
✓ Branch 2 taken 175553 times.
✓ Branch 3 taken 138549 times.
✓ Branch 4 taken 103 times.
✓ Branch 5 taken 1045 times.
✓ Branch 6 taken 54 times.
✓ Branch 7 taken 1106 times.
✓ Branch 8 taken 180 times.
✓ Branch 9 taken 134631 times.
✓ Branch 10 taken 241 times.
✓ Branch 11 taken 134544 times.
✓ Branch 12 taken 131 times.
✓ Branch 13 taken 20 times.
✓ Branch 14 taken 44 times.
✓ Branch 15 taken 81 times.
✓ Branch 16 taken 20 times.
✓ Branch 17 taken 44 times.
✓ Branch 18 taken 81 times.
✓ Branch 19 taken 8 times.
✓ Branch 20 taken 44 times.
✓ Branch 21 taken 81 times.
✓ Branch 22 taken 8 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 81 times.
✓ Branch 25 taken 7 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 7 times.
✓ Branch 29 taken 1 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 3 times.
✓ Branch 32 taken 1 times.
✓ Branch 33 taken 69702 times.
✓ Branch 34 taken 3 times.
✓ Branch 35 taken 1 times.
✓ Branch 36 taken 69702 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 1 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✓ Branch 41 taken 1 times.
✗ Branch 42 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
1025787514 { return assembler_.problem(); }
231
232 //! The assembler
233 const Assembler& assembler() const
234 { return assembler_; }
235
236 //! The current element
237 const Element& element() const
238 { return element_; }
239
240 //! Returns if element is a ghost entity
241 bool elementIsGhost() const
242 { return elementIsGhost_; }
243
244 //! The current solution
245 const SolutionVector& curSol() const
246 { return curSol_; }
247
248 //! The global finite volume geometry
249 FVElementGeometry& fvGeometry()
250
13/18
✗ Branch 1 not taken.
✓ Branch 2 taken 180417 times.
✓ Branch 3 taken 504014 times.
✓ Branch 4 taken 1406420 times.
✓ Branch 5 taken 1980 times.
✓ Branch 6 taken 595308 times.
✓ Branch 7 taken 307680 times.
✓ Branch 8 taken 27616 times.
✓ Branch 9 taken 325719 times.
✓ Branch 10 taken 621836 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 325696 times.
✓ Branch 13 taken 621836 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 412912 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 412912 times.
✗ Branch 19 not taken.
549111953 { return fvGeometry_; }
251
252 //! The current element volume variables
253 ElementVolumeVariables& curElemVolVars()
254
6/7
✗ Branch 0 not taken.
✓ Branch 1 taken 963487 times.
✓ Branch 2 taken 20 times.
✓ Branch 3 taken 309416 times.
✓ Branch 4 taken 182396 times.
✓ Branch 5 taken 16 times.
✓ Branch 6 taken 23 times.
491753096 { return curElemVolVars_; }
255
256 //! The element volume variables of the provious time step
257 ElementVolumeVariables& prevElemVolVars()
258 75565574 { return prevElemVolVars_; }
259
260 //! The element flux variables cache
261 ElementFluxVariablesCache& elemFluxVarsCache()
262
5/6
✗ Branch 1 not taken.
✓ Branch 2 taken 966977 times.
✓ Branch 3 taken 1736 times.
✓ Branch 4 taken 8736 times.
✓ Branch 5 taken 307719 times.
✓ Branch 6 taken 173500 times.
691218602 { return elemFluxVarsCache_; }
263
264 //! The local residual for the current element
265 LocalResidual& localResidual()
266 19896093 { return localResidual_; }
267
268 //! The element's boundary types
269 ElementBoundaryTypes& elemBcTypes()
270
19/30
✓ Branch 0 taken 552832 times.
✓ Branch 1 taken 13837480 times.
✓ Branch 2 taken 1360444 times.
✓ Branch 3 taken 9465317 times.
✓ Branch 4 taken 2247679 times.
✓ Branch 5 taken 1360444 times.
✓ Branch 6 taken 49130 times.
✓ Branch 7 taken 1069202 times.
✓ Branch 8 taken 677840 times.
✓ Branch 9 taken 960466 times.
✓ Branch 10 taken 8099176 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 384 times.
✓ Branch 13 taken 261122 times.
✓ Branch 15 taken 21362 times.
✓ Branch 16 taken 247384 times.
✓ Branch 18 taken 2480 times.
✓ Branch 19 taken 5228 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 50000 times.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 972448 times.
✗ Branch 25 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
244526311 { return elemBcTypes_; }
271
272 //! The finite volume geometry
273 const FVElementGeometry& fvGeometry() const
274
9/17
✓ Branch 2 taken 77920 times.
✓ Branch 3 taken 2235 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 3324 times.
✓ Branch 7 taken 19642 times.
✓ Branch 8 taken 71842 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 660 times.
✓ Branch 12 taken 48 times.
✗ Branch 13 not taken.
✓ Branch 17 taken 528 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 528 times.
✗ Branch 28 not taken.
404482809 { return fvGeometry_; }
275
276 //! The current element volume variables
277 const ElementVolumeVariables& curElemVolVars() const
278
17/25
✓ Branch 3 taken 68787264 times.
✓ Branch 4 taken 4312 times.
✓ Branch 5 taken 12432 times.
✓ Branch 6 taken 18796 times.
✓ Branch 7 taken 3984712 times.
✓ Branch 8 taken 7020 times.
✓ Branch 9 taken 4214400 times.
✓ Branch 10 taken 346400 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2767960 times.
✓ Branch 14 taken 162048 times.
✓ Branch 15 taken 528 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1580 times.
✓ Branch 19 taken 1591840 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 947200 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 151680 times.
✓ Branch 25 taken 528 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 126400 times.
✗ Branch 28 not taken.
804191822 { return curElemVolVars_; }
279
280 //! The element volume variables of the provious time step
281 const ElementVolumeVariables& prevElemVolVars() const
282 208297476 { return prevElemVolVars_; }
283
284 //! The element flux variables cache
285 const ElementFluxVariablesCache& elemFluxVarsCache() const
286 428273960 { return elemFluxVarsCache_; }
287
288 //! The element's boundary types
289 const ElementBoundaryTypes& elemBcTypes() const
290
1/2
✓ Branch 1 taken 300 times.
✗ Branch 2 not taken.
264308920 { return elemBcTypes_; }
291
292 //! The local residual for the current element
293 const LocalResidual& localResidual() const
294 45106196 { return localResidual_; }
295
296 protected:
297 Implementation &asImp_()
298 { return *static_cast<Implementation*>(this); }
299
300 const Implementation &asImp_() const
301 { return *static_cast<const Implementation*>(this); }
302
303 template<class T = TypeTag, typename std::enable_if_t<!GetPropType<T, Properties::GridVariables>::GridVolumeVariables::cachingEnabled, int> = 0>
304 VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
305
3/4
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 977900 times.
✓ Branch 3 taken 1740193 times.
✗ Branch 4 not taken.
284199763 { return elemVolVars[scv]; }
306
307 template<class T = TypeTag, typename std::enable_if_t<GetPropType<T, Properties::GridVariables>::GridVolumeVariables::cachingEnabled, int> = 0>
308 VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
309
5/6
✓ Branch 0 taken 85 times.
✓ Branch 1 taken 61915119 times.
✓ Branch 2 taken 85 times.
✓ Branch 3 taken 59551227 times.
✓ Branch 4 taken 2363892 times.
✗ Branch 5 not taken.
399743548 { return gridVolVars.volVars(scv); }
310
311 private:
312
313 const Assembler& assembler_; //!< access pointer to assembler instance
314 const Element& element_; //!< the element whose residual is assembled
315 const SolutionVector& curSol_; //!< the current solution
316
317 FVElementGeometry fvGeometry_;
318 ElementVolumeVariables curElemVolVars_;
319 ElementVolumeVariables prevElemVolVars_;
320 ElementFluxVariablesCache elemFluxVarsCache_;
321 ElementBoundaryTypes elemBcTypes_;
322
323 LocalResidual localResidual_; //!< the local residual evaluating the equations per element
324 bool elementIsGhost_; //!< whether the element's partitionType is ghost
325 };
326
327
328 } // end namespace Dumux
329
330 #endif
331