GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/assembly/fvlocalassemblerbase.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 66 80 82.5%
Functions: 1345 3688 36.5%
Branches: 214 358 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 2979162 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 463037 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 232108 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 387335 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
30813556 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 42418638 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.
84830548 localView(assembler.gridGeometry()),
68
3/12
✓ Branch 1 taken 36194795 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.
54185010 localView(assembler.gridVariables().curGridVolVars()),
69
3/12
✓ Branch 1 taken 36194795 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.
54185010 localView(assembler.gridVariables().prevGridVolVars()),
70
3/12
✓ Branch 1 taken 36194795 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4892624 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4892624 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.
61300136 localView(assembler.gridVariables().gridFluxVarsCache()),
71 assembler.localResidual(),
72
38/44
✓ Branch 0 taken 2130338 times.
✓ Branch 1 taken 4726261 times.
✓ Branch 2 taken 30707747 times.
✓ Branch 3 taken 2080882 times.
✓ Branch 4 taken 4721657 times.
✓ Branch 5 taken 30707747 times.
✓ Branch 6 taken 3396373 times.
✓ Branch 7 taken 3406166 times.
✓ Branch 8 taken 31898199 times.
✓ Branch 9 taken 2080882 times.
✓ Branch 10 taken 3406166 times.
✓ Branch 11 taken 30707747 times.
✓ Branch 12 taken 2080882 times.
✓ Branch 13 taken 2480092 times.
✓ Branch 14 taken 30707747 times.
✓ Branch 15 taken 2080882 times.
✓ Branch 16 taken 2480092 times.
✓ Branch 17 taken 30707747 times.
✓ Branch 18 taken 2080882 times.
✓ Branch 19 taken 2480092 times.
✓ Branch 20 taken 30103547 times.
✓ Branch 21 taken 2080882 times.
✓ Branch 22 taken 2480092 times.
✓ Branch 23 taken 28914493 times.
✓ Branch 24 taken 2080882 times.
✓ Branch 25 taken 2480092 times.
✓ Branch 26 taken 26177465 times.
✓ Branch 27 taken 2043142 times.
✓ Branch 28 taken 1295038 times.
✓ Branch 29 taken 26177465 times.
✓ Branch 30 taken 2043142 times.
✓ Branch 31 taken 1295038 times.
✓ Branch 32 taken 2448492 times.
✓ Branch 33 taken 4074165 times.
✓ Branch 34 taken 1826388 times.
✓ Branch 35 taken 4079701 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.
112142444 element.partitionType() == Dune::GhostEntity)
73 41492564 {}
74
75 /*!
76 * \brief The constructor. General version explicitly expecting each argument.
77 */
78 96289430 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 32919040 times.
✓ Branch 2 taken 31021014 times.
✓ Branch 3 taken 128544 times.
✓ Branch 4 taken 33358616 times.
✓ Branch 5 taken 26220110 times.
✓ Branch 6 taken 31036 times.
✓ Branch 7 taken 10222037 times.
✓ Branch 8 taken 26216594 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.
103295046 , elementIsGhost_(elementIsGhost)
96 91109492 {}
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 259667958 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 205397055 times.
✓ Branch 2 taken 63360 times.
✓ Branch 3 taken 14930983 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1252579 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.
286553667 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.
527008567 return isImplicit() ? evalLocalResidual(curElemVolVars())
118 259522095 : 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 295750808 ElementResidualVector evalLocalResidual(const ElementVolumeVariables& elemVolVars) const
126 {
127
4/4
✓ Branch 0 taken 190303709 times.
✓ Branch 1 taken 34471623 times.
✓ Branch 2 taken 39028702 times.
✓ Branch 3 taken 27799790 times.
428378256 if (!assembler().isStationaryProblem())
128 {
129 461356784 ElementResidualVector residual = evalLocalFluxAndSourceResidual(elemVolVars);
130 394424940 residual += evalLocalStorageResidual();
131 230678391 return residual;
132 }
133 else
134 65072415 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 224775332 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 194309708 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 42418638 void bindLocalViews()
174 {
175 // get some references for convenience
176 42418638 const auto& element = this->element();
177 42418638 const auto& curSol = this->curSol();
178 42418638 const auto& prevSol = this->assembler().prevSol();
179 84837276 auto&& fvGeometry = this->fvGeometry();
180 84837276 auto&& curElemVolVars = this->curElemVolVars();
181 84837276 auto&& prevElemVolVars = this->prevElemVolVars();
182 84837276 auto&& elemFluxVarsCache = this->elemFluxVarsCache();
183
184 // bind the caches
185 84837276 fvGeometry.bind(element);
186
187 if (isImplicit())
188 {
189 38755038 curElemVolVars.bind(element, fvGeometry, curSol);
190 38755038 elemFluxVarsCache.bind(element, fvGeometry, curElemVolVars);
191
2/2
✓ Branch 0 taken 29798767 times.
✓ Branch 1 taken 1437579 times.
38755038 if (!this->assembler().isStationaryProblem())
192 30032239 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 42418638 }
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 175697 times.
✓ Branch 1 taken 138743 times.
✓ Branch 2 taken 175697 times.
✓ Branch 3 taken 138691 times.
✓ Branch 4 taken 104 times.
✓ Branch 5 taken 1044 times.
✓ Branch 6 taken 52 times.
✓ Branch 7 taken 1107 times.
✓ Branch 8 taken 179 times.
✓ Branch 9 taken 134628 times.
✓ Branch 10 taken 242 times.
✓ Branch 11 taken 134543 times.
✓ Branch 12 taken 128 times.
✓ Branch 13 taken 22 times.
✓ Branch 14 taken 43 times.
✓ Branch 15 taken 80 times.
✓ Branch 16 taken 22 times.
✓ Branch 17 taken 43 times.
✓ Branch 18 taken 80 times.
✓ Branch 19 taken 10 times.
✓ Branch 20 taken 43 times.
✓ Branch 21 taken 80 times.
✓ Branch 22 taken 10 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 80 times.
✓ Branch 25 taken 9 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 9 times.
✓ Branch 29 taken 1 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 3 times.
✓ Branch 32 taken 1 times.
✓ Branch 33 taken 69504 times.
✓ Branch 34 taken 3 times.
✓ Branch 35 taken 1 times.
✓ Branch 36 taken 69504 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.
1025670982 { 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 1401420 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 616836 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 325696 times.
✓ Branch 13 taken 616836 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 412912 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 412912 times.
✗ Branch 19 not taken.
518037154 { 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.
471148839 { return curElemVolVars_; }
255
256 //! The element volume variables of the provious time step
257 ElementVolumeVariables& prevElemVolVars()
258 75555468 { 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.
670681927 { 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 551505 times.
✓ Branch 1 taken 13780318 times.
✓ Branch 2 taken 1355444 times.
✓ Branch 3 taken 8766719 times.
✓ Branch 4 taken 2077837 times.
✓ Branch 5 taken 1355444 times.
✓ Branch 6 taken 47206 times.
✓ Branch 7 taken 1013230 times.
✓ Branch 8 taken 677840 times.
✓ Branch 9 taken 929674 times.
✓ Branch 10 taken 7435216 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 384 times.
✓ Branch 13 taken 232174 times.
✓ Branch 15 taken 20079 times.
✓ Branch 16 taken 219719 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.
242587883 { return elemBcTypes_; }
271
272 //! The finite volume geometry
273 const FVElementGeometry& fvGeometry() const
274
10/19
✗ Branch 0 not taken.
✓ Branch 1 taken 531064 times.
✓ Branch 2 taken 92664 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.
344855820 { return fvGeometry_; }
275
276 //! The current element volume variables
277 const ElementVolumeVariables& curElemVolVars() const
278
17/25
✓ Branch 3 taken 68217264 times.
✓ Branch 4 taken 4312 times.
✓ Branch 5 taken 12432 times.
✓ Branch 6 taken 18796 times.
✓ Branch 7 taken 3964712 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.
727012411 { return curElemVolVars_; }
279
280 //! The element volume variables of the provious time step
281 const ElementVolumeVariables& prevElemVolVars() const
282 207119476 { return prevElemVolVars_; }
283
284 //! The element flux variables cache
285 const ElementFluxVariablesCache& elemFluxVarsCache() const
286 375750416 { 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.
263130920 { 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 1736526 times.
✗ Branch 4 not taken.
283720314 { 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 68 times.
✓ Branch 1 taken 61915136 times.
✓ Branch 2 taken 68 times.
✓ Branch 3 taken 59551244 times.
✓ Branch 4 taken 2363892 times.
✗ Branch 5 not taken.
387391296 { 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