GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/multidomain/facet/cellcentered/mpfa/interactionvolume.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 103 105 98.1%
Functions: 8 8 100.0%
Branches: 218 331 65.9%

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 FacetCoupling
10 * \copydoc Dumux::CCMpfaOFacetCouplingInteractionVolume
11 */
12 #ifndef DUMUX_MULTIDOMAIN_FACET_CC_MPFA_O_INTERACTIONVOLUME_HH
13 #define DUMUX_MULTIDOMAIN_FACET_CC_MPFA_O_INTERACTIONVOLUME_HH
14
15 #include <dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh>
16 #include <dumux/discretization/cellcentered/mpfa/omethod/scvgeometryhelper.hh>
17 #include <dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh>
18 #include <dumux/discretization/cellcentered/mpfa/localfacedata.hh>
19 #include <dumux/discretization/cellcentered/mpfa/methods.hh>
20
21 #include "localassembler.hh"
22 #include "localsubcontrolentities.hh"
23
24 namespace Dumux {
25
26 //! Forward declaration of the facet coupling MPFA-O interaction volume
27 template< class Traits > class CCMpfaOFacetCouplingInteractionVolume;
28
29 /*!
30 * \ingroup FacetCoupling
31 * \brief The default interaction volume traits class for the mpfa-o method
32 * in the context of facet coupling. This uses dynamic types types for
33 * matrices/vectors in order to work on general grids.
34 *
35 * \tparam NodalIndexSet The type used for the dual grid's nodal index sets
36 * \tparam Scalar The Type used for scalar values
37 */
38 template< class NodalIndexSet, class Scalar >
39 struct CCMpfaOFacetCouplingDefaultInteractionVolumeTraits
40 : public CCMpfaODefaultInteractionVolumeTraits< NodalIndexSet, Scalar >
41 {
42 private:
43 //! export the type for the interaction volume index set
44 using IVIndexSet = CCMpfaOInteractionVolumeIndexSet< NodalIndexSet >;
45
46 static constexpr int dim = NodalIndexSet::Traits::GridView::dimension;
47 static constexpr int dimWorld = NodalIndexSet::Traits::GridView::dimensionworld;
48
49 public:
50 //! export the type of interaction-volume local scvs
51 using LocalScvType = CCMpfaOFacetCouplingInteractionVolumeLocalScv< IVIndexSet, Scalar, dim, dimWorld >;
52 //! export the type of interaction-volume local scvfs
53 using LocalScvfType = CCMpfaOFacetCouplingInteractionVolumeLocalScvf< IVIndexSet >;
54
55 //! Use the assembler that considers the coupled domain
56 template<class Problem, class FVElementGeometry, class ElemVolVars>
57 using LocalAssembler = MpfaOFacetCouplingInteractionVolumeAssembler<Problem, FVElementGeometry, ElemVolVars>;
58 };
59
60 /*!
61 * \ingroup FacetCoupling
62 * \brief Class for the interaction volume of the mpfa-o scheme in the
63 * context of models involving coupling to a lower-dimensional
64 * domain across the element facets.
65 */
66 template< class Traits >
67 4022288 class CCMpfaOFacetCouplingInteractionVolume
68 : public CCMpfaInteractionVolumeBase< Traits >
69 {
70 using GridView = typename Traits::GridView;
71 using Element = typename GridView::template Codim<0>::Entity;
72
73 using IndexSet = typename Traits::IndexSet;
74 using GridIndexType = typename IndexSet::GridIndexType;
75 using LocalIndexType = typename IndexSet::LocalIndexType;
76 using Stencil = typename IndexSet::NodalGridStencilType;
77
78 using LocalScvType = typename Traits::LocalScvType;
79 using LocalScvfType = typename Traits::LocalScvfType;
80 using LocalFaceData = typename Traits::LocalFaceData;
81
82 public:
83 //! Reuse standard o-scheme's Dirichlet Data class
84 using DirichletData = typename CCMpfaOInteractionVolume<Traits>::DirichletData;
85
86 //! Define data structure to store which scvfs lie on interior boundaries
87 class InteriorBoundaryData
88 {
89 GridIndexType scvfIdx_;
90
91 public:
92 //! Constructor
93 882602 InteriorBoundaryData(GridIndexType scvfIdx) : scvfIdx_(scvfIdx) {}
94
95 //! Return corresponding scvf index
96 3042014 GridIndexType scvfIndex() const { return scvfIdx_; }
97 };
98
99 //! publicly state the mpfa-scheme this interaction volume is associated with
100 static constexpr MpfaMethods MpfaMethod = MpfaMethods::oMethod;
101
102 //! Sets up the local scope for a given iv index set
103 template< class Problem, class FVElementGeometry >
104 7088624 void bind(const IndexSet& indexSet,
105 const Problem& problem,
106 const FVElementGeometry& fvGeometry)
107 {
108 // for the o-scheme, the stencil is equal to the scv
109 // index set of the dual grid's nodal index set
110 7088624 stencil_ = &indexSet.nodalIndexSet().gridScvIndices();
111
112 // find out how many facet elements appear in this iv
113 7088624 std::size_t numFacetElems = 0;
114 7088624 std::size_t numOutsideFaces = 0;
115 7088624 std::vector<bool> isOnInteriorBoundary(indexSet.numFaces(), false);
116
2/2
✓ Branch 0 taken 22258487 times.
✓ Branch 1 taken 4022288 times.
47826775 for (LocalIndexType fIdx = 0; fIdx < indexSet.numFaces(); ++fIdx)
117 {
118
1/2
✓ Branch 3 taken 22258487 times.
✗ Branch 4 not taken.
40738151 const auto& scvf = fvGeometry.scvf(indexSet.gridScvfIndex(fIdx));
119
3/4
✓ Branch 1 taken 22258487 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 882602 times.
✓ Branch 4 taken 21375885 times.
81476302 const auto element = fvGeometry.gridGeometry().element(scvf.insideScvIdx());
120
2/2
✓ Branch 0 taken 882602 times.
✓ Branch 1 taken 21375885 times.
40738151 if (problem.couplingManager().isOnInteriorBoundary(element, scvf))
121 {
122
2/2
✓ Branch 0 taken 882014 times.
✓ Branch 1 taken 588 times.
1718234 numFacetElems++;
123
2/2
✓ Branch 0 taken 882014 times.
✓ Branch 1 taken 588 times.
1718234 if (!scvf.boundary())
124 1717646 numOutsideFaces += scvf.numOutsideScvs();
125
1/2
✓ Branch 1 taken 882602 times.
✗ Branch 2 not taken.
1718234 isOnInteriorBoundary[fIdx] = true;
126
1/2
✓ Branch 1 taken 882602 times.
✗ Branch 2 not taken.
1718234 interiorBoundaryData_.emplace_back( scvf.index() );
127 }
128 }
129
130 // number of interaction-volume-local scvs(=node-local for o-scheme) and scvfs
131
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
7088624 numFaces_ = indexSet.numFaces() + numOutsideFaces;
132 7088624 const auto numLocalScvs = indexSet.numScvs();
133
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
7088624 const auto numGlobalScvfs = indexSet.nodalIndexSet().numScvfs();
134
135 // reserve memory for local entities
136
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
✓ Branch 3 taken 4022288 times.
✗ Branch 4 not taken.
7088624 elements_.clear(); elements_.reserve(numLocalScvs);
137
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
✓ Branch 3 taken 4022288 times.
✗ Branch 4 not taken.
7088624 scvs_.clear(); scvs_.reserve(numLocalScvs);
138
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
✓ Branch 3 taken 4022288 times.
✗ Branch 4 not taken.
7088624 scvfs_.clear(); scvfs_.reserve(numFaces_);
139
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
✓ Branch 3 taken 4022288 times.
✗ Branch 4 not taken.
7088624 localFaceData_.clear(); localFaceData_.reserve(numGlobalScvfs);
140
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4022288 times.
✓ Branch 3 taken 4022288 times.
✗ Branch 4 not taken.
7088624 dirichletData_.clear(); dirichletData_.reserve(numFaces_);
141
142 // keep track of the number of unknowns etc
143 7088624 numUnknowns_ = 0;
144 7088624 numKnowns_ = numLocalScvs + numFacetElems;
145
146 // index map from grid scvf index to local scvf index
147 7088624 std::unordered_map<GridIndexType, LocalIndexType> scvfIndexMap;
148
149 // set up objects related to sub-control volume faces
150 7088624 LocalIndexType facetElementCounter = 0;
151
2/2
✓ Branch 0 taken 22258487 times.
✓ Branch 1 taken 4022288 times.
47826775 for (LocalIndexType faceIdxLocal = 0; faceIdxLocal < indexSet.numFaces(); ++faceIdxLocal)
152 {
153 40738151 const auto gridScvfIdx = indexSet.gridScvfIndex(faceIdxLocal);
154 40738151 const auto& flipScvfIdxSet = fvGeometry.gridGeometry().flipScvfIndexSet()[gridScvfIdx];
155 40738151 const auto& scvf = fvGeometry.scvf(gridScvfIdx);
156
2/4
✓ Branch 1 taken 22258487 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 22258487 times.
81476302 const auto element = fvGeometry.gridGeometry().element(scvf.insideScvIdx());
157
158 // the neighboring scvs in local indices (order: 0 - inside scv, 1..n - outside scvs)
159
1/2
✓ Branch 1 taken 22258487 times.
✗ Branch 2 not taken.
40738151 const auto& neighborScvIndicesLocal = indexSet.neighboringLocalScvIndices(faceIdxLocal);
160 40738151 const auto numNeighborScvs = neighborScvIndicesLocal.size();
161
162 // the ív-local scvf index of the face about to be created
163
1/2
✓ Branch 1 taken 20207567 times.
✗ Branch 2 not taken.
40738151 const auto curLocalScvfIdx = scvfs_.size();
164
1/2
✓ Branch 1 taken 22258487 times.
✗ Branch 2 not taken.
40738151 scvfIndexMap[gridScvfIdx] = curLocalScvfIdx;
165
1/2
✓ Branch 1 taken 22258487 times.
✗ Branch 2 not taken.
40738151 localFaceData_.emplace_back(curLocalScvfIdx, neighborScvIndicesLocal[0], scvf.index());
166
167 // on interior boundaries, create local scvfs for inside AND all outside scvfs
168
2/2
✓ Branch 0 taken 882602 times.
✓ Branch 1 taken 21375885 times.
40738151 if (isOnInteriorBoundary[faceIdxLocal])
169 {
170
2/2
✓ Branch 0 taken 588 times.
✓ Branch 1 taken 841842 times.
1718234 const LocalIndexType facetLocalDofIdx = numLocalScvs + facetElementCounter++;
171
2/2
✓ Branch 0 taken 588 times.
✓ Branch 1 taken 882014 times.
1718234 const bool isDirichlet = problem.interiorBoundaryTypes(element, scvf).hasOnlyDirichlet();
172
173 // create local scvf
174
2/2
✓ Branch 0 taken 588 times.
✓ Branch 1 taken 882014 times.
1718234 if (isDirichlet)
175
1/2
✓ Branch 1 taken 588 times.
✗ Branch 2 not taken.
588 scvfs_.emplace_back(scvf, neighborScvIndicesLocal, facetLocalDofIdx, /*isDirichlet*/true, facetLocalDofIdx);
176 else
177
1/2
✓ Branch 1 taken 882014 times.
✗ Branch 2 not taken.
1717646 scvfs_.emplace_back(scvf, neighborScvIndicesLocal, numUnknowns_++, /*isDirichlet*/false, facetLocalDofIdx);
178
179 // create "outside" local scvfs
180
2/2
✓ Branch 0 taken 882014 times.
✓ Branch 1 taken 588 times.
1718234 if (!scvf.boundary())
181 {
182
3/3
✓ Branch 0 taken 855044 times.
✓ Branch 1 taken 882014 times.
✓ Branch 2 taken 26970 times.
3435292 for (LocalIndexType i = 1; i < numNeighborScvs; ++i)
183 {
184 1717646 const auto outsideGridScvfIdx = flipScvfIdxSet[i-1];
185
1/2
✓ Branch 2 taken 26970 times.
✗ Branch 3 not taken.
1717646 const auto& flipScvf = fvGeometry.scvf(outsideGridScvfIdx);
186
1/2
✓ Branch 1 taken 26970 times.
✗ Branch 2 not taken.
1717646 const auto& outsideFlipScvfIdxSet = fvGeometry.gridGeometry().flipScvfIndexSet()[outsideGridScvfIdx];
187
188 // rearrange the neighbor scv index vector corresponding to this scvfs flip scvf index set
189 using std::swap;
190
1/2
✓ Branch 1 taken 26970 times.
✗ Branch 2 not taken.
1717646 auto outsideNeighborScvIdxSet = neighborScvIndicesLocal;
191 1717646 outsideNeighborScvIdxSet[0] = outsideNeighborScvIdxSet[i];
192
2/2
✓ Branch 0 taken 882014 times.
✓ Branch 1 taken 882014 times.
3435292 for (LocalIndexType j = 0; j < outsideFlipScvfIdxSet.size(); ++j)
193 {
194
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882014 times.
1717646 const auto flipScvfIdx = outsideFlipScvfIdxSet[j];
195
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882014 times.
1717646 auto it = std::find(flipScvfIdxSet.begin(), flipScvfIdxSet.end(), flipScvfIdx);
196
197 // if we found the index, use corresponding local scv index
198
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882014 times.
1717646 if (it != flipScvfIdxSet.end())
199 outsideNeighborScvIdxSet[j+1] = neighborScvIndicesLocal[std::distance(flipScvfIdxSet.begin(), it)+1];
200
201 // otherwise this must be the "inside" scvf again
202 else
203 {
204
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882014 times.
1717646 assert(flipScvfIdx == gridScvfIdx);
205 1717646 outsideNeighborScvIdxSet[j+1] = neighborScvIndicesLocal[0];
206 }
207 }
208
209
1/2
✓ Branch 1 taken 882014 times.
✗ Branch 2 not taken.
1717646 scvfIndexMap[outsideGridScvfIdx] = curLocalScvfIdx+i;
210
1/2
✓ Branch 1 taken 882014 times.
✗ Branch 2 not taken.
1717646 localFaceData_.emplace_back(curLocalScvfIdx+i, outsideNeighborScvIdxSet[0], flipScvf.index());
211
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882014 times.
1717646 if (isDirichlet)
212 scvfs_.emplace_back(flipScvf, outsideNeighborScvIdxSet, facetLocalDofIdx, /*isDirichlet*/true, facetLocalDofIdx);
213 else
214
1/2
✓ Branch 1 taken 882014 times.
✗ Branch 2 not taken.
1717646 scvfs_.emplace_back(flipScvf, outsideNeighborScvIdxSet, numUnknowns_++, /*isDirichlet*/false, facetLocalDofIdx);
215 }
216 }
217 }
218
219 // otherwise create boundary scvf ...
220
2/2
✓ Branch 0 taken 346388 times.
✓ Branch 1 taken 21029497 times.
39019917 else if (scvf.boundary())
221 {
222
4/4
✓ Branch 0 taken 68824 times.
✓ Branch 1 taken 277564 times.
✓ Branch 2 taken 4140 times.
✓ Branch 3 taken 12780 times.
589100 if (problem.boundaryTypes(element, scvf).hasOnlyDirichlet())
223 {
224
1/2
✓ Branch 1 taken 58114 times.
✗ Branch 2 not taken.
58494 scvfs_.emplace_back(scvf, neighborScvIndicesLocal, numKnowns_++, /*isDirichlet*/true);
225
1/2
✓ Branch 1 taken 58114 times.
✗ Branch 2 not taken.
58494 dirichletData_.emplace_back(scvf.outsideScvIdx());
226 }
227 else
228
1/2
✓ Branch 1 taken 288274 times.
✗ Branch 2 not taken.
513686 scvfs_.emplace_back(scvf, neighborScvIndicesLocal, numUnknowns_++, /*isDirichlet*/false);
229 }
230
231 // ... or interior scvf
232 else
233 {
234
1/2
✓ Branch 1 taken 21029497 times.
✗ Branch 2 not taken.
38447737 scvfs_.emplace_back(scvf, neighborScvIndicesLocal, numUnknowns_++, /*isDirichlet*/false);
235
236 // add local face data objects for the outside faces
237
2/2
✓ Branch 0 taken 21029497 times.
✓ Branch 1 taken 21029497 times.
76895474 for (LocalIndexType i = 1; i < numNeighborScvs; ++i)
238 {
239 // loop over scvfs in outside scv until we find the one coinciding with current scvf
240 38447737 const auto outsideLocalScvIdx = neighborScvIndicesLocal[i];
241 38447737 const auto& flipScvfIndex = fvGeometry.gridGeometry().flipScvfIndexSet()[scvf.index()][i-1];
242 38447737 const auto& flipScvf = fvGeometry.scvf(flipScvfIndex);
243
1/2
✓ Branch 1 taken 21029497 times.
✗ Branch 2 not taken.
38447737 scvfIndexMap[flipScvfIndex] = curLocalScvfIdx;
244
1/2
✓ Branch 1 taken 21029497 times.
✗ Branch 2 not taken.
38447737 localFaceData_.emplace_back(curLocalScvfIdx, // iv-local scvf idx
245 outsideLocalScvIdx, // iv-local scv index
246 76895474 i-1, // scvf-local index in outside faces
247
1/2
✓ Branch 1 taken 21029497 times.
✗ Branch 2 not taken.
38447737 flipScvf.index()); // global scvf index
248 }
249 }
250 }
251
252 // set up stuff related to sub-control volumes
253
2/2
✓ Branch 0 taken 22084999 times.
✓ Branch 1 taken 4022288 times.
47540391 for (LocalIndexType scvIdxLocal = 0; scvIdxLocal < numLocalScvs; scvIdxLocal++)
254 {
255
2/4
✓ Branch 1 taken 22084999 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 22084999 times.
✗ Branch 5 not taken.
80903534 elements_.emplace_back(fvGeometry.gridGeometry().element( stencil()[scvIdxLocal] ));
256
1/2
✓ Branch 1 taken 22084999 times.
✗ Branch 2 not taken.
40451767 scvs_.emplace_back(fvGeometry.gridGeometry().mpfaHelper(),
257 fvGeometry,
258
1/2
✓ Branch 1 taken 22084999 times.
✗ Branch 2 not taken.
40451767 fvGeometry.scv( stencil()[scvIdxLocal] ),
259 scvIdxLocal,
260 indexSet,
261 scvfIndexMap);
262 }
263 7088624 }
264
265 //! returns the number of primary scvfs of this interaction volume
266 152439715 std::size_t numFaces() const
267
32/54
✓ Branch 1 taken 14461342 times.
✓ Branch 2 taken 2931740 times.
✓ Branch 4 taken 2931740 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 9 taken 2209696 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 5141436 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 9499187 times.
✓ Branch 15 taken 5141436 times.
✓ Branch 17 taken 14389558 times.
✓ Branch 18 taken 3068300 times.
✓ Branch 20 taken 11242416 times.
✓ Branch 21 taken 2961980 times.
✓ Branch 22 taken 68280 times.
✓ Branch 23 taken 2683520 times.
✓ Branch 25 taken 1580992 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1580992 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 6617808 times.
✓ Branch 31 taken 4264512 times.
✓ Branch 33 taken 1022544 times.
✓ Branch 34 taken 2683520 times.
✓ Branch 36 taken 11242416 times.
✓ Branch 37 taken 2683520 times.
✗ Branch 38 not taken.
✓ Branch 39 taken 8974686 times.
✓ Branch 41 taken 1022544 times.
✓ Branch 42 taken 2139768 times.
✓ Branch 44 taken 1022544 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 4288788 times.
✓ Branch 47 taken 1022544 times.
✗ Branch 49 not taken.
✓ Branch 50 taken 2139768 times.
✗ Branch 8 not taken.
✗ Branch 16 not taken.
✗ Branch 24 not taken.
✗ Branch 27 not taken.
✗ Branch 32 not taken.
✗ Branch 35 not taken.
✓ Branch 40 taken 2139768 times.
✗ Branch 43 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✓ Branch 53 taken 2139768 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 8974686 times.
✓ Branch 56 taken 2139768 times.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
152439715 { return numFaces_; }
268
269 //! returns the number of intermediate unknowns within this interaction volume
270 63114420 std::size_t numUnknowns() const
271
20/36
✗ Branch 0 not taken.
✓ Branch 1 taken 5141436 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 5141436 times.
✓ Branch 5 taken 5141436 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 5141436 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 4893216 times.
✓ Branch 12 taken 68280 times.
✓ Branch 13 taken 4264512 times.
✓ Branch 15 taken 4264512 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 4264512 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 1102200 times.
✓ Branch 21 taken 3162312 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 3720760 times.
✓ Branch 25 taken 3162312 times.
✓ Branch 26 taken 543752 times.
✓ Branch 28 taken 3162312 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 3162312 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 3162312 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 1022544 times.
✗ Branch 36 not taken.
✗ Branch 24 not taken.
✗ Branch 27 not taken.
✓ Branch 14 taken 248220 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 2139768 times.
✗ Branch 39 not taken.
63114420 { return numUnknowns_; }
272
273 //! returns the number of (in this context) known solution values within this interaction volume
274 69311704 std::size_t numKnowns() const
275
11/26
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 4 taken 2209696 times.
✓ Branch 5 taken 2931740 times.
✓ Branch 7 taken 2209696 times.
✓ Branch 8 taken 2931740 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 13 taken 1580992 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1580992 times.
✗ Branch 17 not taken.
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✓ Branch 15 taken 2683520 times.
✓ Branch 18 taken 2683520 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 22 taken 1022544 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 3162312 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 2139768 times.
✗ Branch 29 not taken.
69311704 { return numKnowns_; }
276
277 //! returns the number of scvs embedded in this interaction volume
278 61715113 std::size_t numScvs() const
279
6/6
✓ Branch 0 taken 20282717 times.
✓ Branch 1 taken 5141436 times.
✓ Branch 2 taken 16572268 times.
✓ Branch 3 taken 4264512 times.
✓ Branch 4 taken 12291868 times.
✓ Branch 5 taken 3162312 times.
61715113 { return scvs_.size(); }
280
281 //! returns the cell-stencil of this interaction volume
282 142463704 const Stencil& stencil() const
283
6/8
✓ Branch 1 taken 21939231 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 3997952 times.
✓ Branch 4 taken 17941279 times.
✓ Branch 6 taken 145768 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 24336 times.
✓ Branch 9 taken 121432 times.
142463704 { return *stencil_; }
284
285 //! returns the grid element corresponding to a given iv-local scv idx
286 52874531 const Element& element(LocalIndexType ivLocalScvIdx) const
287
3/5
✓ Branch 1 taken 9983916 times.
✓ Branch 2 taken 2267730 times.
✓ Branch 5 taken 8974686 times.
✗ Branch 6 not taken.
✗ Branch 3 not taken.
187610237 { return elements_[ivLocalScvIdx]; }
288
289 //! returns the local scvf entity corresponding to a given iv-local scvf idx
290 355346831 const LocalScvfType& localScvf(LocalIndexType ivLocalScvfIdx) const
291
21/23
✓ Branch 1 taken 21034048 times.
✓ Branch 2 taken 9578231 times.
✓ Branch 5 taken 22532557 times.
✓ Branch 6 taken 12251646 times.
✓ Branch 7 taken 10556546 times.
✓ Branch 8 taken 19924650 times.
✓ Branch 10 taken 25333900 times.
✓ Branch 11 taken 7286540 times.
✓ Branch 14 taken 15531204 times.
✓ Branch 15 taken 15531204 times.
✓ Branch 16 taken 13275860 times.
✓ Branch 17 taken 16952964 times.
✓ Branch 19 taken 15258616 times.
✓ Branch 20 taken 61020 times.
✓ Branch 23 taken 8974686 times.
✓ Branch 24 taken 8974686 times.
✓ Branch 25 taken 7659818 times.
✓ Branch 26 taken 9810434 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✓ Branch 3 taken 9499187 times.
✓ Branch 4 taken 8258055 times.
✓ Branch 9 taken 6617808 times.
355346831 { return scvfs_[ivLocalScvfIdx]; }
292
293 //! returns the local scv entity corresponding to a given iv-local scv idx
294 215348023 const LocalScvType& localScv(LocalIndexType ivLocalScvIdx) const
295
28/33
✓ Branch 0 taken 21034048 times.
✓ Branch 1 taken 79044 times.
✓ Branch 2 taken 2447420 times.
✓ Branch 3 taken 7051767 times.
✓ Branch 4 taken 5514402 times.
✓ Branch 5 taken 16006727 times.
✓ Branch 6 taken 2924940 times.
✓ Branch 7 taken 9148346 times.
✓ Branch 8 taken 21354564 times.
✓ Branch 9 taken 5120152 times.
✓ Branch 10 taken 2186456 times.
✓ Branch 11 taken 4935224 times.
✓ Branch 12 taken 3237156 times.
✓ Branch 13 taken 8207840 times.
✓ Branch 14 taken 3829928 times.
✓ Branch 15 taken 11398964 times.
✓ Branch 16 taken 16276840 times.
✓ Branch 17 taken 3217104 times.
✓ Branch 18 taken 147972 times.
✓ Branch 19 taken 410476 times.
✓ Branch 20 taken 2424076 times.
✓ Branch 21 taken 6550610 times.
✓ Branch 22 taken 2274806 times.
✓ Branch 23 taken 7004072 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✓ Branch 31 taken 566017 times.
✓ Branch 32 taken 1573751 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 270486 times.
✓ Branch 26 taken 752058 times.
215348023 { return scvs_[ivLocalScvIdx]; }
296
297 //! returns a reference to the container with the local face data
298 const std::vector<LocalFaceData>& localFaceData() const
299
7/7
✓ Branch 0 taken 33144536 times.
✓ Branch 1 taken 46890826 times.
✓ Branch 3 taken 33144536 times.
✓ Branch 4 taken 5501096 times.
✓ Branch 5 taken 24685760 times.
✓ Branch 6 taken 3162312 times.
✓ Branch 2 taken 3816900 times.
174536146 { return localFaceData_; }
300
301 //! returns a reference to the information container on Dirichlet BCs within this iv
302 const std::vector<DirichletData>& dirichletData() const
303 12568260 { return dirichletData_; }
304
305 //! returns a reference to the data container on interior boundaries
306 const std::vector<InteriorBoundaryData>& interiorBoundaryData() const
307 12568260 { return interiorBoundaryData_; }
308
309 //! returns the geometry of the i-th local scv
310 template< class FVElementGeometry >
311 auto getScvGeometry(LocalIndexType ivLocalScvIdx, const FVElementGeometry& fvGeometry) const
312 { return CCMpfaOScvGeometryHelper<LocalScvType>::computeScvGeometry(ivLocalScvIdx, *this, fvGeometry); }
313
314 //! returns the number of interaction volumes living around a vertex
315 template< class NI >
316 static constexpr std::size_t numIVAtVertex(const NI& nodalIndexSet)
317 { return 1; }
318
319 //! adds the iv index sets living around a vertex to a given container
320 //! and stores the the corresponding index in a map for each scvf
321 template< class IvIndexSetContainer,
322 class ScvfIndexMap,
323 class NodalIndexSet,
324 class FlipScvfIndexSet >
325 26934 static void addIVIndexSets(IvIndexSetContainer& ivIndexSetContainer,
326 ScvfIndexMap& scvfIndexMap,
327 const NodalIndexSet& nodalIndexSet,
328 const FlipScvfIndexSet& flipScvfIndexSet)
329 {
330 // reuse the function of the standard mpfa-o interaction volume
331
1/2
✓ Branch 1 taken 26934 times.
✗ Branch 2 not taken.
26934 CCMpfaOInteractionVolume<Traits>::addIVIndexSets(ivIndexSetContainer,
332 scvfIndexMap,
333 nodalIndexSet,
334 flipScvfIndexSet);
335 26934 }
336
337 private:
338 // pointer to cell stencil (in iv index set)
339 const Stencil* stencil_;
340
341 // Variables defining the local scope
342 std::vector<Element> elements_;
343 std::vector<LocalScvType> scvs_;
344 std::vector<LocalScvfType> scvfs_;
345 std::vector<LocalFaceData> localFaceData_;
346 std::vector<DirichletData> dirichletData_;
347 std::vector<InteriorBoundaryData> interiorBoundaryData_;
348
349 // sizes involved in the local system equations
350 std::size_t numFaces_;
351 std::size_t numUnknowns_;
352 std::size_t numKnowns_;
353 };
354
355 } // end namespace
356
357 #endif
358