GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/assembly/fvlocalassemblerbase.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 100 101 99.0%
Functions: 1446 1465 98.7%
Branches: 213 351 60.7%

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 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 3195813 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 520162 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 261128 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 261056 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
34240928 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
2/5
✓ Branch 1 taken 5453400 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 0 taken 4604 times.
42737024 explicit FVLocalAssemblerBase(const Assembler& assembler,
62 const Element& element,
63 const SolutionVector& curSol)
64 : FVLocalAssemblerBase(assembler,
65 element,
66 curSol,
67
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
42737024 localView(assembler.gridGeometry()),
68
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
42737024 localView(assembler.gridVariables().curGridVolVars()),
69
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
42737024 localView(assembler.gridVariables().prevGridVolVars()),
70
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
42862063 localView(assembler.gridVariables().gridFluxVarsCache()),
71
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
42737024 assembler.localResidual(),
72
1/4
✓ Branch 1 taken 35967049 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
49115318 element.partitionType() == Dune::GhostEntity)
73 41810950 {}
74
75 /*!
76 * \brief The constructor. General version explicitly expecting each argument.
77 */
78 118168342 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 118168342 : assembler_(assembler)
88 118168342 , element_(element)
89 118168342 , curSol_(curSol)
90
2/6
✗ Branch 0 not taken.
✓ Branch 1 taken 43483084 times.
✓ Branch 3 taken 20 times.
✗ Branch 4 not taken.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
117735061 , fvGeometry_(fvGeometry)
91
1/2
✓ Branch 1 taken 26092236 times.
✗ Branch 2 not taken.
117083980 , curElemVolVars_(curElemVolVars)
92
1/2
✓ Branch 1 taken 71411023 times.
✗ Branch 2 not taken.
117083980 , prevElemVolVars_(prevElemVolVars)
93
1/2
✓ Branch 1 taken 37181551 times.
✗ Branch 2 not taken.
118168342 , elemFluxVarsCache_(elemFluxVarsCache)
94
1/4
✓ Branch 1 taken 926114 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
118153483 , localResidual_(localResidual)
95
1/4
✓ Branch 1 taken 926114 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
118153483 , elementIsGhost_(elementIsGhost)
96 112265755 {}
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 336239095 ElementResidualVector evalLocalResidual() const
109 {
110 if (!isImplicit())
111 9747600 if (this->assembler().isStationaryProblem())
112 DUNE_THROW(Dune::InvalidStateException, "Using explicit jacobian assembler with stationary local residual");
113
114 336239095 if (elementIsGhost())
115 240901 return ElementResidualVector(0.0);
116
117 326250594 return isImplicit() ? evalLocalResidual(curElemVolVars())
118 335998092 : 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 335998194 ElementResidualVector evalLocalResidual(const ElementVolumeVariables& elemVolVars) const
126 {
127 335998194 if (!assembler().isStationaryProblem())
128 {
129 266695187 ElementResidualVector residual = evalLocalFluxAndSourceResidual(elemVolVars);
130
2/2
✓ Branch 0 taken 412262590 times.
✓ Branch 1 taken 154053398 times.
713723377 residual += evalLocalStorageResidual();
131 266695187 return residual;
132 }
133 else
134 69303005 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 245807108 ElementResidualVector evalLocalFluxAndSourceResidual(const ElementVolumeVariables& elemVolVars) const
155 {
156 245807108 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 213283589 ElementResidualVector evalLocalStorageResidual() const
165 {
166 213283589 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 42737024 void bindLocalViews()
174 {
175 // get some references for convenience
176 42737024 const auto& element = this->element();
177 42737024 const auto& curSol = this->curSol();
178 42737024 const auto& prevSol = this->assembler().prevSol();
179 42737024 auto&& fvGeometry = this->fvGeometry();
180 42737024 auto&& curElemVolVars = this->curElemVolVars();
181 42737024 auto&& prevElemVolVars = this->prevElemVolVars();
182 42737024 auto&& elemFluxVarsCache = this->elemFluxVarsCache();
183
184 // bind the caches
185 42737024 fvGeometry.bind(element);
186
187 if (isImplicit())
188 {
189 39073424 curElemVolVars.bind(element, fvGeometry, curSol);
190 39073424 elemFluxVarsCache.bind(element, fvGeometry, curElemVolVars);
191
2/2
✓ Branch 0 taken 2152402 times.
✓ Branch 1 taken 49152 times.
39073424 if (!this->assembler().isStationaryProblem())
192 30357345 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 658600 elemFluxVarsCache.bind(element, fvGeometry, prevElemVolVars);
199 }
200 42737024 }
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
2/2
✓ Branch 0 taken 725600 times.
✓ Branch 1 taken 711900 times.
2169600 for (const auto& scvI : scvs(this->fvGeometry()))
211 {
212
4/4
✓ Branch 0 taken 705014 times.
✓ Branch 1 taken 20586 times.
✓ Branch 2 taken 110 times.
✓ Branch 3 taken 704890 times.
1451000 const auto internalDirichletConstraints = asImp_().problem().hasInternalDirichletConstraint(this->element(), scvI);
213
2/2
✓ Branch 0 taken 124 times.
✓ Branch 1 taken 725476 times.
746000 if (internalDirichletConstraints.any())
214 {
215
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
152 const auto dirichletValues = asImp_().problem().internalDirichlet(this->element(), scvI);
216 // set the Dirichlet conditions in residual and jacobian
217
2/2
✓ Branch 0 taken 116 times.
✓ Branch 1 taken 116 times.
288 for (int eqIdx = 0; eqIdx < internalDirichletConstraints.size(); ++eqIdx)
218
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
136 if (internalDirichletConstraints[eqIdx])
219
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
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 507890358 const Problem& problem() const
230
16/18
✓ Branch 1 taken 261540 times.
✓ Branch 2 taken 4 times.
✓ Branch 4 taken 314 times.
✓ Branch 5 taken 46 times.
✓ Branch 7 taken 39 times.
✓ Branch 8 taken 46 times.
✓ Branch 11 taken 47 times.
✓ Branch 12 taken 3 times.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 3 taken 559 times.
✓ Branch 6 taken 66 times.
✓ Branch 9 taken 66 times.
✓ Branch 10 taken 25 times.
✓ Branch 13 taken 25 times.
✓ Branch 0 taken 167924 times.
141460495 { return assembler_.problem(); }
231
232 //! The assembler
233 1259248789 const Assembler& assembler() const
234
62/68
✓ Branch 0 taken 152645431 times.
✓ Branch 1 taken 58817882 times.
✓ Branch 2 taken 25040250 times.
✓ Branch 3 taken 29581125 times.
✓ Branch 4 taken 5259716 times.
✓ Branch 5 taken 51935875 times.
✓ Branch 6 taken 5754886 times.
✓ Branch 7 taken 12420475 times.
✓ Branch 9 taken 1884839 times.
✓ Branch 10 taken 42318972 times.
✓ Branch 12 taken 5570690 times.
✓ Branch 13 taken 27368803 times.
✓ Branch 14 taken 10358298 times.
✓ Branch 15 taken 14908412 times.
✓ Branch 17 taken 16362944 times.
✓ Branch 18 taken 14679432 times.
✓ Branch 20 taken 1801849 times.
✓ Branch 21 taken 28870578 times.
✓ Branch 22 taken 9969351 times.
✓ Branch 23 taken 1926227 times.
✓ Branch 24 taken 860385 times.
✓ Branch 25 taken 645317 times.
✓ Branch 27 taken 495610 times.
✓ Branch 28 taken 12678002 times.
✓ Branch 30 taken 1449692 times.
✓ Branch 31 taken 732082 times.
✓ Branch 34 taken 520855 times.
✓ Branch 35 taken 5991976 times.
✓ Branch 37 taken 2411081 times.
✓ Branch 38 taken 3163717 times.
✓ Branch 40 taken 1418112 times.
✓ Branch 41 taken 426317 times.
✓ Branch 45 taken 6420 times.
✓ Branch 46 taken 18695 times.
✓ Branch 8 taken 99889126 times.
✓ Branch 16 taken 30284020 times.
✓ Branch 19 taken 24939439 times.
✓ Branch 26 taken 329260 times.
✓ Branch 29 taken 3876048 times.
✓ Branch 32 taken 2226545 times.
✓ Branch 33 taken 2667244 times.
✓ Branch 36 taken 944149 times.
✓ Branch 39 taken 264166 times.
✓ Branch 11 taken 9943584 times.
✓ Branch 44 taken 516827 times.
✓ Branch 43 taken 7 times.
✓ Branch 42 taken 7845 times.
✓ Branch 49 taken 50019 times.
✓ Branch 50 taken 1933782 times.
✓ Branch 52 taken 964020 times.
✓ Branch 53 taken 4 times.
✓ Branch 47 taken 371235 times.
✓ Branch 54 taken 16 times.
✓ Branch 56 taken 3 times.
✗ Branch 57 not taken.
✓ Branch 48 taken 413040 times.
✓ Branch 51 taken 413040 times.
✓ Branch 58 taken 7212 times.
✗ Branch 61 not taken.
✓ Branch 62 taken 57708 times.
✓ Branch 55 taken 3 times.
✗ Branch 59 not taken.
✓ Branch 67 taken 1 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✗ Branch 73 not taken.
✓ Branch 74 taken 964000 times.
1282964146 { return assembler_; }
235
236 //! The current element
237 338722340 const Element& element() const
238
19/33
✓ Branch 3 taken 2887204 times.
✓ Branch 4 taken 1235725 times.
✓ Branch 5 taken 129690 times.
✓ Branch 6 taken 1045569 times.
✓ Branch 7 taken 313471 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 755203 times.
✓ Branch 11 taken 649701 times.
✓ Branch 12 taken 21038 times.
✓ Branch 13 taken 4512 times.
✓ Branch 16 taken 2161 times.
✓ Branch 17 taken 200655 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 2 taken 1909984 times.
✓ Branch 9 taken 507318 times.
✓ Branch 1 taken 267435 times.
✓ Branch 15 taken 12736 times.
✓ Branch 14 taken 36972 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 18 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✓ Branch 25 taken 528 times.
✓ Branch 28 taken 24 times.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✓ Branch 0 taken 167924 times.
536089552 { return element_; }
239
240 //! Returns if element is a ghost entity
241 517955642 bool elementIsGhost() const
242
20/28
✓ Branch 0 taken 68969819 times.
✓ Branch 1 taken 171320069 times.
✓ Branch 2 taken 11451235 times.
✓ Branch 3 taken 148680483 times.
✓ Branch 4 taken 10804654 times.
✓ Branch 5 taken 5443992 times.
✓ Branch 6 taken 56767710 times.
✓ Branch 7 taken 14103125 times.
✓ Branch 8 taken 351904 times.
✓ Branch 9 taken 1158906 times.
✓ Branch 10 taken 5532318 times.
✓ Branch 11 taken 3182147 times.
✓ Branch 12 taken 728560 times.
✓ Branch 13 taken 582880 times.
✓ Branch 14 taken 7377440 times.
✓ Branch 15 taken 300000 times.
✓ Branch 16 taken 268400 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 1327520 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 1073600 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 8530880 times.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
517955642 { return elementIsGhost_; }
243
244 //! The current solution
245 150029014 const SolutionVector& curSol() const
246
4/9
✗ Branch 0 not taken.
✓ Branch 1 taken 4275518 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 329166 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 621836 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 413040 times.
✗ Branch 8 not taken.
159473127 { return curSol_; }
247
248 //! The global finite volume geometry
249 522425580 FVElementGeometry& fvGeometry()
250
6/11
✗ Branch 3 not taken.
✓ Branch 4 taken 435590 times.
✓ Branch 6 taken 533424 times.
✓ Branch 7 taken 289512 times.
✗ Branch 5 not taken.
✓ Branch 1 taken 27956 times.
✓ Branch 2 taken 2171388 times.
✓ Branch 8 taken 426950 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 9 not taken.
534001601 { return fvGeometry_; }
251
252 //! The current element volume variables
253 507611939 ElementVolumeVariables& curElemVolVars()
254
1/2
✗ Branch 3 not taken.
✓ Branch 4 taken 173500 times.
493752309 { return curElemVolVars_; }
255
256 //! The element volume variables of the provious time step
257 67570029 ElementVolumeVariables& prevElemVolVars()
258 79974589 { return prevElemVolVars_; }
259
260 //! The element flux variables cache
261 672168882 ElementFluxVariablesCache& elemFluxVarsCache()
262
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 173500 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3470 times.
510365451 { return elemFluxVarsCache_; }
263
264 //! The local residual for the current element
265 27406235 LocalResidual& localResidual()
266
6/7
✓ Branch 3 taken 31580 times.
✓ Branch 4 taken 4576 times.
✓ Branch 6 taken 100 times.
✓ Branch 7 taken 38094 times.
✓ Branch 2 taken 6688 times.
✓ Branch 5 taken 252 times.
✗ Branch 8 not taken.
36907479 { return localResidual_; }
267
268 //! The element's boundary types
269 222792665 ElementBoundaryTypes& elemBcTypes()
270
19/28
✓ Branch 0 taken 977689 times.
✓ Branch 1 taken 22136977 times.
✓ Branch 3 taken 710926 times.
✓ Branch 4 taken 11123708 times.
✓ Branch 6 taken 43555 times.
✓ Branch 7 taken 1854618 times.
✓ Branch 9 taken 79616 times.
✓ Branch 10 taken 575691 times.
✓ Branch 12 taken 134 times.
✓ Branch 13 taken 261111 times.
✓ Branch 15 taken 21098 times.
✓ Branch 16 taken 321960 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 16 times.
✓ Branch 21 taken 50000 times.
✓ Branch 22 taken 352 times.
✓ Branch 24 taken 966480 times.
✓ Branch 25 taken 5228 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✓ Branch 2 taken 1360680 times.
✓ Branch 5 taken 1360572 times.
✗ Branch 20 not taken.
✗ Branch 23 not taken.
263500037 { return elemBcTypes_; }
271
272 //! The finite volume geometry
273 274133908 const FVElementGeometry& fvGeometry() const
274
7/11
✓ Branch 3 taken 96 times.
✓ Branch 4 taken 4596160 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 28344 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 21160 times.
✓ Branch 0 taken 531064 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 91096 times.
✓ Branch 5 taken 4273 times.
✗ Branch 8 not taken.
251103176 { return fvGeometry_; }
275
276 //! The current element volume variables
277 827114598 const ElementVolumeVariables& curElemVolVars() const
278
7/13
✓ Branch 1 taken 68787264 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 3984712 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 346352 times.
✓ Branch 9 taken 578560 times.
✓ Branch 3 taken 6983296 times.
✗ Branch 4 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 1327520 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1073600 times.
✗ Branch 15 not taken.
647665666 { return curElemVolVars_; }
279
280 //! The element volume variables of the provious time step
281 211602608 const ElementVolumeVariables& prevElemVolVars() const
282 211602608 { return prevElemVolVars_; }
283
284 //! The element flux variables cache
285 444538552 const ElementFluxVariablesCache& elemFluxVarsCache() const
286
1/2
✓ Branch 1 taken 96 times.
✗ Branch 2 not taken.
336663808 { return elemFluxVarsCache_; }
287
288 //! The element's boundary types
289 274432536 const ElementBoundaryTypes& elemBcTypes() const
290
1/2
✓ Branch 1 taken 300 times.
✗ Branch 2 not taken.
274432536 { return elemBcTypes_; }
291
292 //! The local residual for the current element
293 21652372 const LocalResidual& localResidual() const
294
1/2
✓ Branch 1 taken 96 times.
✗ Branch 2 not taken.
48427248 { 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 144317290 VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
305
2/3
✓ Branch 1 taken 2716026 times.
✗ Branch 2 not taken.
✓ Branch 0 taken 4 times.
144317290 { return elemVolVars[scv]; }
306
307 template<class T = TypeTag, typename std::enable_if_t<GetPropType<T, Properties::GridVariables>::GridVolumeVariables::cachingEnabled, int> = 0>
308
2/2
✓ Branch 0 taken 71 times.
✓ Branch 1 taken 64553893 times.
211203023 VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
309
2/3
✓ Branch 0 taken 71 times.
✓ Branch 1 taken 66917785 times.
✗ Branch 2 not taken.
213467504 { 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