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 CCTpfaDiscretization | ||
10 | * \brief Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models | ||
11 | * This builds up the sub control volumes and sub control volume faces | ||
12 | * for each element in the local scope we are restricting to, e.g. stencil or element. | ||
13 | */ | ||
14 | #ifndef DUMUX_DISCRETIZATION_CCTPFA_FV_ELEMENT_GEOMETRY_HH | ||
15 | #define DUMUX_DISCRETIZATION_CCTPFA_FV_ELEMENT_GEOMETRY_HH | ||
16 | |||
17 | #include <optional> | ||
18 | #include <algorithm> | ||
19 | #include <array> | ||
20 | #include <vector> | ||
21 | #include <utility> | ||
22 | |||
23 | #include <dune/common/exceptions.hh> | ||
24 | #include <dumux/common/indextraits.hh> | ||
25 | #include <dune/common/iteratorrange.hh> | ||
26 | #include <dumux/discretization/scvandscvfiterators.hh> | ||
27 | |||
28 | namespace Dumux { | ||
29 | |||
30 | namespace Detail::Tpfa { | ||
31 | |||
32 | template<class GridIndexType> | ||
33 | 749895496 | auto findLocalIndex(const GridIndexType idx, | |
34 | const std::vector<GridIndexType>& indices) | ||
35 | { | ||
36 | 2249686488 | auto it = std::find(indices.begin(), indices.end(), idx); | |
37 |
3/6✗ Branch 0 not taken.
✓ Branch 1 taken 749895496 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 749895496 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 749895496 times.
|
2249686488 | assert(it != indices.end() && "Could not find the scv/scvf! Make sure to properly bind this class!"); |
38 | 2249686488 | return std::distance(indices.begin(), it); | |
39 | } | ||
40 | |||
41 | } // end namespace Detail::Tpfa | ||
42 | |||
43 | /*! | ||
44 | * \ingroup CCTpfaDiscretization | ||
45 | * \brief Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models | ||
46 | * This builds up the sub control volumes and sub control volume faces | ||
47 | * for each element in the local scope we are restricting to, e.g. stencil or element. | ||
48 | * \tparam GG the finite volume grid geometry type | ||
49 | * \tparam enableGridGeometryCache if the grid geometry is cached or not | ||
50 | * \note This class is specialized for versions with and without caching the fv geometries on the grid view | ||
51 | */ | ||
52 | template<class GG, bool enableGridGeometryCache> | ||
53 | class CCTpfaFVElementGeometry; | ||
54 | |||
55 | /*! | ||
56 | * \ingroup CCTpfaDiscretization | ||
57 | * \brief Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models | ||
58 | * Specialization for grid caching enabled | ||
59 | * \note The finite volume geometries are stored in the corresponding GridGeometry | ||
60 | */ | ||
61 | template<class GG> | ||
62 |
26/53✓ Branch 0 taken 14297 times.
✓ Branch 1 taken 18128239 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 14199 times.
✓ Branch 4 taken 16643294 times.
✓ Branch 5 taken 5440 times.
✓ Branch 6 taken 2912197 times.
✓ Branch 7 taken 800000 times.
✓ Branch 8 taken 5448 times.
✓ Branch 9 taken 412912 times.
✓ Branch 10 taken 3 times.
✓ Branch 11 taken 371200 times.
✓ Branch 12 taken 31313 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1205120 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 485584 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 482048 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 6 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 3 times.
✓ Branch 28 taken 480 times.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 1212652 times.
✓ Branch 33 taken 1768 times.
✓ Branch 34 taken 1212652 times.
✗ Branch 35 not taken.
✓ Branch 36 taken 1768 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 1768 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✓ Branch 41 taken 3 times.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✓ Branch 45 taken 5304 times.
✗ Branch 46 not taken.
✓ Branch 47 taken 5304 times.
✗ Branch 48 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
|
47387084 | class CCTpfaFVElementGeometry<GG, true> |
63 | { | ||
64 | using ThisType = CCTpfaFVElementGeometry<GG, true>; | ||
65 | using GridView = typename GG::GridView; | ||
66 | using GridIndexType = typename IndexTraits<GridView>::GridIndex; | ||
67 | using LocalIndexType = typename IndexTraits<GridView>::LocalIndex; | ||
68 | |||
69 | public: | ||
70 | //! export type of the element | ||
71 | using Element = typename GridView::template Codim<0>::Entity; | ||
72 | //! export type of subcontrol volume | ||
73 | using SubControlVolume = typename GG::SubControlVolume; | ||
74 | //! export type of subcontrol volume face | ||
75 | using SubControlVolumeFace = typename GG::SubControlVolumeFace; | ||
76 | //! export type of finite volume grid geometry | ||
77 | using GridGeometry = GG; | ||
78 | |||
79 | //! the maximum number of scvs per element | ||
80 | static constexpr std::size_t maxNumElementScvs = 1; | ||
81 | //! the maximum number of scvfs per element (use cubes for maximum) | ||
82 | static constexpr std::size_t maxNumElementScvfs = 2*GridView::dimension; | ||
83 | |||
84 | //! Constructor | ||
85 | CCTpfaFVElementGeometry(const GridGeometry& gridGeometry) | ||
86 |
60/69✓ Branch 1 taken 1911 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 180103 times.
✓ Branch 4 taken 1911 times.
✓ Branch 5 taken 1233769 times.
✓ Branch 6 taken 180103 times.
✓ Branch 7 taken 228 times.
✓ Branch 8 taken 1233769 times.
✓ Branch 9 taken 15596603 times.
✓ Branch 10 taken 228 times.
✓ Branch 11 taken 2117079 times.
✓ Branch 12 taken 15596603 times.
✓ Branch 13 taken 1561996 times.
✓ Branch 14 taken 2117079 times.
✓ Branch 15 taken 1735263 times.
✓ Branch 16 taken 1561996 times.
✓ Branch 17 taken 489192 times.
✓ Branch 18 taken 1735263 times.
✓ Branch 19 taken 10791997 times.
✓ Branch 20 taken 489192 times.
✓ Branch 21 taken 355 times.
✓ Branch 22 taken 10791997 times.
✓ Branch 23 taken 173501 times.
✓ Branch 24 taken 355 times.
✓ Branch 25 taken 485584 times.
✓ Branch 26 taken 173501 times.
✓ Branch 27 taken 909550 times.
✓ Branch 28 taken 485584 times.
✓ Branch 29 taken 800003 times.
✓ Branch 30 taken 909550 times.
✓ Branch 31 taken 486 times.
✓ Branch 32 taken 800003 times.
✓ Branch 33 taken 50 times.
✓ Branch 34 taken 486 times.
✓ Branch 35 taken 1747 times.
✓ Branch 36 taken 50 times.
✓ Branch 37 taken 1212655 times.
✓ Branch 38 taken 1747 times.
✓ Branch 39 taken 50 times.
✓ Branch 40 taken 1212655 times.
✓ Branch 41 taken 1736 times.
✓ Branch 42 taken 50 times.
✓ Branch 43 taken 1771 times.
✓ Branch 44 taken 1736 times.
✓ Branch 45 taken 23 times.
✓ Branch 46 taken 1771 times.
✓ Branch 47 taken 7 times.
✓ Branch 48 taken 23 times.
✓ Branch 49 taken 5304 times.
✓ Branch 50 taken 7 times.
✓ Branch 51 taken 17 times.
✓ Branch 52 taken 5304 times.
✓ Branch 53 taken 102 times.
✓ Branch 54 taken 17 times.
✓ Branch 55 taken 79 times.
✓ Branch 56 taken 102 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 79 times.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✓ Branch 61 taken 79 times.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✓ Branch 64 taken 79 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 63 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 63 times.
✗ Branch 71 not taken.
|
147740722 | : gridGeometryPtr_(&gridGeometry) {} |
87 | |||
88 | //! Get an element sub control volume with a global scv index | ||
89 | //! We separate element and neighbor scvs to speed up mapping | ||
90 | ✗ | const SubControlVolume& scv(GridIndexType scvIdx) const | |
91 | { | ||
92 |
74/80✗ Branch 0 not taken.
✓ Branch 1 taken 256 times.
✓ Branch 2 taken 2508832 times.
✓ Branch 3 taken 220420588 times.
✓ Branch 4 taken 2519136 times.
✓ Branch 5 taken 239369324 times.
✓ Branch 6 taken 22552 times.
✓ Branch 7 taken 18949064 times.
✓ Branch 8 taken 210746 times.
✓ Branch 9 taken 104673296 times.
✓ Branch 10 taken 198498 times.
✓ Branch 11 taken 241748465 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 191718705 times.
✓ Branch 14 taken 1066644 times.
✓ Branch 15 taken 196865106 times.
✓ Branch 16 taken 352672 times.
✓ Branch 17 taken 139374218 times.
✓ Branch 18 taken 4617440 times.
✓ Branch 19 taken 17283344 times.
✓ Branch 20 taken 52339288 times.
✓ Branch 21 taken 142853888 times.
✓ Branch 22 taken 51166084 times.
✓ Branch 23 taken 130219928 times.
✓ Branch 24 taken 1928840 times.
✓ Branch 25 taken 2333280 times.
✓ Branch 26 taken 4195280 times.
✓ Branch 27 taken 1829488 times.
✓ Branch 28 taken 432320 times.
✓ Branch 29 taken 2003508 times.
✓ Branch 30 taken 250048 times.
✓ Branch 31 taken 58746 times.
✓ Branch 32 taken 2003578 times.
✓ Branch 33 taken 45274 times.
✓ Branch 34 taken 59210 times.
✓ Branch 35 taken 1440814 times.
✓ Branch 36 taken 3123830 times.
✓ Branch 37 taken 1778576 times.
✓ Branch 38 taken 5221692 times.
✓ Branch 39 taken 1817098 times.
✓ Branch 40 taken 4052146 times.
✓ Branch 41 taken 3763038 times.
✓ Branch 42 taken 2800798 times.
✓ Branch 43 taken 4714302 times.
✓ Branch 44 taken 719258 times.
✓ Branch 45 taken 5434264 times.
✓ Branch 46 taken 2043014 times.
✓ Branch 47 taken 5114994 times.
✓ Branch 48 taken 125248 times.
✓ Branch 49 taken 160 times.
✓ Branch 50 taken 22689 times.
✓ Branch 51 taken 444243 times.
✓ Branch 52 taken 2049 times.
✓ Branch 53 taken 438651 times.
✓ Branch 54 taken 13632 times.
✓ Branch 55 taken 17652 times.
✗ Branch 56 not taken.
✓ Branch 57 taken 21448 times.
✗ Branch 58 not taken.
✓ Branch 59 taken 17146 times.
✓ Branch 60 taken 634 times.
✓ Branch 61 taken 21410 times.
✓ Branch 62 taken 38 times.
✓ Branch 63 taken 11498 times.
✓ Branch 64 taken 12166 times.
✓ Branch 65 taken 5324 times.
✓ Branch 66 taken 8000 times.
✓ Branch 67 taken 281196 times.
✓ Branch 68 taken 5324 times.
✓ Branch 69 taken 285 times.
✓ Branch 70 taken 281196 times.
✓ Branch 71 taken 8000 times.
✓ Branch 72 taken 285 times.
✓ Branch 73 taken 1766400 times.
✓ Branch 74 taken 8000 times.
✓ Branch 75 taken 901500 times.
✓ Branch 76 taken 1766400 times.
✗ Branch 77 not taken.
✓ Branch 78 taken 901500 times.
✗ Branch 79 not taken.
|
7457251177 | return gridGeometry().scv(scvIdx); |
93 | } | ||
94 | |||
95 | //! Get an element sub control volume face with a global scvf index | ||
96 | //! We separate element and neighbor scvfs to speed up mapping | ||
97 | const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const | ||
98 | { | ||
99 |
58/60✓ Branch 2 taken 36298 times.
✓ Branch 3 taken 717458 times.
✓ Branch 4 taken 4973278 times.
✓ Branch 5 taken 1670806 times.
✓ Branch 6 taken 6296056 times.
✓ Branch 7 taken 954980 times.
✓ Branch 8 taken 1717552 times.
✓ Branch 9 taken 2475054 times.
✓ Branch 10 taken 1497486 times.
✓ Branch 11 taken 1760758 times.
✓ Branch 12 taken 4135258 times.
✓ Branch 13 taken 780028 times.
✓ Branch 14 taken 4432963 times.
✓ Branch 15 taken 531338 times.
✓ Branch 16 taken 2779535 times.
✓ Branch 17 taken 371158 times.
✓ Branch 18 taken 2274070 times.
✓ Branch 19 taken 3021456 times.
✓ Branch 20 taken 16668851 times.
✓ Branch 21 taken 9610721 times.
✓ Branch 22 taken 25552573 times.
✓ Branch 23 taken 17558237 times.
✓ Branch 24 taken 9487851 times.
✓ Branch 25 taken 9840667 times.
✓ Branch 26 taken 26905 times.
✓ Branch 27 taken 5163245 times.
✓ Branch 28 taken 5575053 times.
✓ Branch 29 taken 323939 times.
✓ Branch 30 taken 11195509 times.
✓ Branch 31 taken 419223 times.
✓ Branch 32 taken 1913964 times.
✓ Branch 33 taken 599612 times.
✓ Branch 34 taken 641506 times.
✓ Branch 35 taken 570074 times.
✓ Branch 36 taken 1107324 times.
✓ Branch 37 taken 885332 times.
✓ Branch 38 taken 1090680 times.
✓ Branch 39 taken 492312 times.
✓ Branch 40 taken 327144 times.
✓ Branch 41 taken 556200 times.
✓ Branch 42 taken 388032 times.
✓ Branch 43 taken 437152 times.
✓ Branch 44 taken 416501 times.
✓ Branch 45 taken 174649 times.
✓ Branch 46 taken 52901 times.
✓ Branch 47 taken 58393 times.
✓ Branch 48 taken 6526 times.
✓ Branch 49 taken 281168 times.
✓ Branch 50 taken 37346 times.
✓ Branch 51 taken 407500 times.
✓ Branch 52 taken 79636 times.
✓ Branch 53 taken 140940 times.
✓ Branch 54 taken 70120 times.
✓ Branch 55 taken 18328 times.
✓ Branch 56 taken 25464 times.
✓ Branch 57 taken 18454 times.
✓ Branch 58 taken 3344 times.
✓ Branch 59 taken 126 times.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
|
2251734246 | return gridGeometry().scvf(scvfIdx); |
100 | } | ||
101 | |||
102 | //! Get the scvf on the same face but from the other side | ||
103 | //! Note that e.g. the normals might be different in the case of surface grids | ||
104 | const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const | ||
105 | { | ||
106 | 83145814 | return gridGeometry().flipScvf(scvfIdx, outsideScvIdx); | |
107 | } | ||
108 | |||
109 | //! iterator range for sub control volumes. Iterates over | ||
110 | //! all scvs of the bound element (not including neighbor scvs) | ||
111 | //! This is a free function found by means of ADL | ||
112 | //! To iterate over all sub control volumes of this FVElementGeometry use | ||
113 | //! for (auto&& scv : scvs(fvGeometry)) | ||
114 | friend inline Dune::IteratorRange< ScvIterator<SubControlVolume, std::array<GridIndexType, 1>, ThisType> > | ||
115 | scvs(const CCTpfaFVElementGeometry& fvGeometry) | ||
116 | { | ||
117 | using ScvIterator = Dumux::ScvIterator<SubControlVolume, std::array<GridIndexType, 1>, ThisType>; | ||
118 | 945315072 | return Dune::IteratorRange<ScvIterator>(ScvIterator(fvGeometry.scvIndices_.begin(), fvGeometry), | |
119 |
12/16✓ Branch 0 taken 50476768 times.
✓ Branch 1 taken 144396030 times.
✓ Branch 2 taken 50476768 times.
✓ Branch 3 taken 144396030 times.
✓ Branch 4 taken 50476768 times.
✓ Branch 5 taken 144396030 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 53796 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 48356 times.
✓ Branch 10 taken 5440 times.
✓ Branch 11 taken 48356 times.
✓ Branch 13 taken 5440 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 5440 times.
✗ Branch 17 not taken.
|
1417978050 | ScvIterator(fvGeometry.scvIndices_.end(), fvGeometry)); |
120 | } | ||
121 | |||
122 | //! iterator range for sub control volumes faces. Iterates over | ||
123 | //! all scvfs of the bound element (not including neighbor scvfs) | ||
124 | //! This is a free function found by means of ADL | ||
125 | //! To iterate over all sub control volume faces of this FVElementGeometry use | ||
126 | //! for (auto&& scvf : scvfs(fvGeometry)) | ||
127 | friend inline Dune::IteratorRange< ScvfIterator<SubControlVolumeFace, std::vector<GridIndexType>, ThisType> > | ||
128 | scvfs(const CCTpfaFVElementGeometry& fvGeometry) | ||
129 | { | ||
130 | 211583652 | const auto& g = fvGeometry.gridGeometry(); | |
131 |
1/2✓ Branch 1 taken 7000 times.
✗ Branch 2 not taken.
|
211583652 | const auto scvIdx = fvGeometry.scvIndices_[0]; |
132 | using ScvfIterator = Dumux::ScvfIterator<SubControlVolumeFace, std::vector<GridIndexType>, ThisType>; | ||
133 |
1/2✓ Branch 1 taken 7000 times.
✗ Branch 2 not taken.
|
211583652 | return Dune::IteratorRange<ScvfIterator>(ScvfIterator(g.scvfIndicesOfScv(scvIdx).begin(), fvGeometry), |
134 |
4/8✓ Branch 1 taken 7000 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 7000 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 7000 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 7000 times.
✗ Branch 11 not taken.
|
846334622 | ScvfIterator(g.scvfIndicesOfScv(scvIdx).end(), fvGeometry)); |
135 | } | ||
136 | |||
137 | //! number of sub control volumes in this fv element geometry | ||
138 | ✗ | std::size_t numScv() const | |
139 | { | ||
140 |
3/4✓ Branch 0 taken 5033024 times.
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 10033024 times.
✗ Branch 3 not taken.
|
163545725 | return scvIndices_.size(); |
141 | } | ||
142 | |||
143 | //! number of sub control volumes in this fv element geometry | ||
144 | std::size_t numScvf() const | ||
145 | { | ||
146 |
7/14✗ Branch 0 not taken.
✓ Branch 1 taken 1520444 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 165000 times.
✓ Branch 4 taken 1355444 times.
✓ Branch 5 taken 165000 times.
✓ Branch 7 taken 1520444 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 165000 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 165000 times.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
45185736 | return gridGeometry().scvfIndicesOfScv(scvIndices_[0]).size(); |
147 | } | ||
148 | |||
149 | /*! | ||
150 | * \brief bind the local view (r-value overload) | ||
151 | * This overload is called when an instance of this class is a temporary in the usage context | ||
152 | * This allows a usage like this: `const auto view = localView(...).bind(element);` | ||
153 | */ | ||
154 | 100 | CCTpfaFVElementGeometry bind(const Element& element) && | |
155 | { | ||
156 |
1/2✓ Branch 1 taken 1768 times.
✗ Branch 2 not taken.
|
7012194 | this->bindElement(element); |
157 |
10/14✓ Branch 0 taken 5740702 times.
✓ Branch 1 taken 1831 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 5740698 times.
✓ Branch 4 taken 1735 times.
✓ Branch 5 taken 1244898 times.
✓ Branch 6 taken 8000 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1244898 times.
✓ Branch 9 taken 8000 times.
✓ Branch 10 taken 15642 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 15642 times.
✗ Branch 14 not taken.
|
14024998 | return std::move(*this); |
158 | } | ||
159 | |||
160 | void bind(const Element& element) & | ||
161 | { | ||
162 |
3/8✓ Branch 1 taken 99385 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 259 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 7000 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
|
39873003 | this->bindElement(element); |
163 | } | ||
164 | |||
165 | /*! | ||
166 | * \brief bind the local view (r-value overload) | ||
167 | * This overload is called when an instance of this class is a temporary in the usage context | ||
168 | * This allows a usage like this: `const auto view = localView(...).bindElement(element);` | ||
169 | */ | ||
170 | 300 | CCTpfaFVElementGeometry bindElement(const Element& element) && | |
171 | { | ||
172 |
3/5✓ Branch 1 taken 487352 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1212652 times.
✗ Branch 5 not taken.
|
28413007 | this->bindElement(element); |
173 |
8/12✓ Branch 0 taken 12477287 times.
✓ Branch 1 taken 559872 times.
✓ Branch 2 taken 12173424 times.
✓ Branch 3 taken 565312 times.
✓ Branch 4 taken 1013980 times.
✓ Branch 5 taken 1374 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 17394 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 506400 times.
✗ Branch 11 not taken.
|
55472415 | return std::move(*this); |
174 | } | ||
175 | |||
176 | //! Bind only element-local | ||
177 | 123957439 | void bindElement(const Element& element) & | |
178 | { | ||
179 |
16/24✓ Branch 0 taken 15214949 times.
✓ Branch 1 taken 68255019 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 175134 times.
✓ Branch 7 taken 101 times.
✓ Branch 8 taken 1734 times.
✓ Branch 9 taken 1 times.
✓ Branch 10 taken 1734 times.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 3470 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 173500 times.
✓ Branch 17 taken 1735 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1623797 times.
✓ Branch 20 taken 2408203 times.
✓ Branch 22 taken 1735 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 1734 times.
✓ Branch 25 taken 1 times.
|
124670524 | element_ = element; |
180 |
15/50✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ 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.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✓ Branch 46 taken 1735 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 1735 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 1735 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1735 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1735 times.
✗ Branch 59 not taken.
✓ Branch 64 taken 1735 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 1735 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1735 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 1735 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1735 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 1735 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 1735 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 1735 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 1735 times.
✗ Branch 89 not taken.
✓ Branch 91 taken 1735 times.
✗ Branch 92 not taken.
|
375437742 | scvIndices_[0] = gridGeometry().elementMapper().index(*element_); |
181 | 123957439 | } | |
182 | |||
183 | //! Returns true if bind/bindElement has already been called | ||
184 | bool isBound() const | ||
185 |
2/4✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
|
24 | { return static_cast<bool>(element_); } |
186 | |||
187 | //! The bound element | ||
188 | const Element& element() const | ||
189 |
2/4✓ Branch 3 taken 78870 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 78870 times.
✗ Branch 7 not taken.
|
16476798 | { return *element_; } |
190 | |||
191 | //! The global finite volume geometry we are a restriction of | ||
192 | ✗ | const GridGeometry& gridGeometry() const | |
193 | ✗ | { return *gridGeometryPtr_; } | |
194 | |||
195 | //! Returns whether one of the geometry's scvfs lies on a boundary | ||
196 | bool hasBoundaryScvf() const | ||
197 |
36/36✓ Branch 0 taken 2796607 times.
✓ Branch 1 taken 30788924 times.
✓ Branch 2 taken 2796607 times.
✓ Branch 3 taken 30788924 times.
✓ Branch 4 taken 2796607 times.
✓ Branch 5 taken 30788924 times.
✓ Branch 6 taken 3716792 times.
✓ Branch 7 taken 10850579 times.
✓ Branch 8 taken 3716792 times.
✓ Branch 9 taken 10850579 times.
✓ Branch 10 taken 3716792 times.
✓ Branch 11 taken 10850579 times.
✓ Branch 12 taken 2308 times.
✓ Branch 13 taken 13214 times.
✓ Branch 14 taken 2308 times.
✓ Branch 15 taken 13214 times.
✓ Branch 16 taken 2308 times.
✓ Branch 17 taken 13214 times.
✓ Branch 18 taken 28 times.
✓ Branch 19 taken 36 times.
✓ Branch 20 taken 28 times.
✓ Branch 21 taken 36 times.
✓ Branch 22 taken 28 times.
✓ Branch 23 taken 36 times.
✓ Branch 24 taken 592 times.
✓ Branch 25 taken 432 times.
✓ Branch 26 taken 592 times.
✓ Branch 27 taken 432 times.
✓ Branch 28 taken 592 times.
✓ Branch 29 taken 432 times.
✓ Branch 30 taken 1804 times.
✓ Branch 31 taken 6778 times.
✓ Branch 32 taken 1804 times.
✓ Branch 33 taken 6778 times.
✓ Branch 34 taken 1804 times.
✓ Branch 35 taken 6778 times.
|
144534282 | { return gridGeometry().hasBoundaryScvf(scvIndices_[0]); } |
198 | |||
199 | ✗ | typename Element::Geometry geometry(const SubControlVolume& scv) const | |
200 |
6/18✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 10 taken 325 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 325 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 325 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 325 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 325 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 325 times.
✗ Branch 26 not taken.
|
1950 | { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); } |
201 | |||
202 | 115582 | typename GridView::Intersection::Geometry geometry(const SubControlVolumeFace& scvf) const | |
203 | { | ||
204 | 234888 | const auto element = gridGeometryPtr_->element(scvf.insideScvIdx()); | |
205 | 231164 | const auto& scvfIndices = gridGeometryPtr_->scvfIndicesOfScv(scvf.insideScvIdx()); | |
206 | 115582 | const LocalIndexType localScvfIdx = Detail::Tpfa::findLocalIndex(scvf.index(), scvfIndices); | |
207 | 115582 | LocalIndexType localIdx = 0; | |
208 |
5/11✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 606785 times.
✓ Branch 4 taken 104 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 280 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 14 taken 176 times.
✗ Branch 15 not taken.
|
742159 | for (const auto& intersection : intersections(gridGeometryPtr_->gridView(), element)) |
209 | { | ||
210 |
4/6✓ Branch 0 taken 547006 times.
✓ Branch 1 taken 59843 times.
✓ Branch 2 taken 119634 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 64 times.
✗ Branch 5 not taken.
|
679150 | if (intersection.neighbor() || intersection.boundary()) |
211 | { | ||
212 |
2/2✓ Branch 0 taken 110634 times.
✓ Branch 1 taken 496431 times.
|
618717 | if (localIdx == localScvfIdx) |
213 |
1/2✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
|
119306 | return intersection.geometry(); |
214 | else | ||
215 | 503135 | ++localIdx; | |
216 | } | ||
217 | } | ||
218 | |||
219 | ✗ | DUNE_THROW(Dune::InvalidStateException, "Could not find scvf geometry"); | |
220 | } | ||
221 | |||
222 | private: | ||
223 | |||
224 | std::optional<Element> element_; | ||
225 | std::array<GridIndexType, 1> scvIndices_; | ||
226 | const GridGeometry* gridGeometryPtr_; | ||
227 | }; | ||
228 | |||
229 | /*! | ||
230 | * \ingroup CCTpfaDiscretization | ||
231 | * \brief Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models | ||
232 | * Specialization for grid caching disabled | ||
233 | */ | ||
234 | template<class GG> | ||
235 | class CCTpfaFVElementGeometry<GG, false> | ||
236 | { | ||
237 | using ThisType = CCTpfaFVElementGeometry<GG, false>; | ||
238 | using GridView = typename GG::GridView; | ||
239 | using GridIndexType = typename IndexTraits<GridView>::GridIndex; | ||
240 | using LocalIndexType = typename IndexTraits<GridView>::LocalIndex; | ||
241 | |||
242 | static const int dim = GridView::dimension; | ||
243 | static const int dimWorld = GridView::dimensionworld; | ||
244 | |||
245 | public: | ||
246 | //! export type of the element | ||
247 | using Element = typename GridView::template Codim<0>::Entity; | ||
248 | //! export type of subcontrol volume | ||
249 | using SubControlVolume = typename GG::SubControlVolume; | ||
250 | //! export type of subcontrol volume face | ||
251 | using SubControlVolumeFace = typename GG::SubControlVolumeFace; | ||
252 | //! export type of finite volume grid geometry | ||
253 | using GridGeometry = GG; | ||
254 | //! the maximum number of scvs per element | ||
255 | static constexpr std::size_t maxNumElementScvs = 1; | ||
256 | //! the maximum number of scvfs per element (use cubes for maximum) | ||
257 | static constexpr std::size_t maxNumElementScvfs = 2*dim; | ||
258 | |||
259 | //! Constructor | ||
260 | CCTpfaFVElementGeometry(const GridGeometry& gridGeometry) | ||
261 |
271/356✗ Branch 0 not taken.
✓ Branch 1 taken 1682 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 11 times.
✓ Branch 4 taken 1671 times.
✓ Branch 5 taken 11 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1682 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 11 times.
✓ Branch 10 taken 1671 times.
✓ Branch 11 taken 11 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 1682 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 11 times.
✓ Branch 16 taken 1671 times.
✓ Branch 17 taken 11 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1682 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 11 times.
✓ Branch 22 taken 1671 times.
✓ Branch 23 taken 39681 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 1671 times.
✓ Branch 26 taken 39681 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 1671 times.
✓ Branch 29 taken 39681 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 1671 times.
✓ Branch 32 taken 39681 times.
✗ Branch 33 not taken.
✓ Branch 34 taken 182493 times.
✓ Branch 35 taken 39681 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 182493 times.
✓ Branch 38 taken 39681 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 182493 times.
✓ Branch 41 taken 39681 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 182493 times.
✓ Branch 44 taken 39681 times.
✓ Branch 45 taken 25 times.
✓ Branch 46 taken 182493 times.
✓ Branch 47 taken 39681 times.
✓ Branch 48 taken 25 times.
✓ Branch 49 taken 182493 times.
✓ Branch 50 taken 39681 times.
✓ Branch 51 taken 25 times.
✓ Branch 52 taken 182493 times.
✓ Branch 53 taken 39681 times.
✓ Branch 54 taken 25 times.
✓ Branch 55 taken 182493 times.
✓ Branch 56 taken 18 times.
✓ Branch 57 taken 25 times.
✓ Branch 58 taken 182493 times.
✓ Branch 59 taken 18 times.
✓ Branch 60 taken 25 times.
✓ Branch 61 taken 182493 times.
✓ Branch 62 taken 18 times.
✓ Branch 63 taken 25 times.
✓ Branch 64 taken 182493 times.
✓ Branch 65 taken 18 times.
✓ Branch 66 taken 25 times.
✓ Branch 67 taken 1579608 times.
✓ Branch 68 taken 18 times.
✓ Branch 69 taken 25 times.
✓ Branch 70 taken 1579608 times.
✓ Branch 71 taken 18 times.
✓ Branch 72 taken 25 times.
✓ Branch 73 taken 1579608 times.
✓ Branch 74 taken 18 times.
✓ Branch 75 taken 25 times.
✓ Branch 76 taken 1579608 times.
✓ Branch 77 taken 18 times.
✓ Branch 78 taken 1 times.
✓ Branch 79 taken 1579608 times.
✓ Branch 80 taken 18 times.
✓ Branch 81 taken 1 times.
✓ Branch 82 taken 1579608 times.
✓ Branch 83 taken 18 times.
✓ Branch 84 taken 1 times.
✓ Branch 85 taken 1579608 times.
✓ Branch 86 taken 18 times.
✓ Branch 87 taken 1 times.
✓ Branch 88 taken 1579608 times.
✓ Branch 89 taken 4262 times.
✓ Branch 90 taken 1 times.
✓ Branch 91 taken 1579608 times.
✓ Branch 92 taken 4262 times.
✓ Branch 93 taken 1 times.
✓ Branch 94 taken 1579608 times.
✓ Branch 95 taken 4262 times.
✓ Branch 96 taken 1 times.
✓ Branch 97 taken 1579608 times.
✓ Branch 98 taken 4262 times.
✓ Branch 99 taken 1 times.
✓ Branch 100 taken 11971450 times.
✓ Branch 101 taken 4262 times.
✓ Branch 102 taken 1 times.
✓ Branch 103 taken 11971450 times.
✓ Branch 104 taken 4262 times.
✓ Branch 105 taken 1 times.
✓ Branch 106 taken 11971450 times.
✓ Branch 107 taken 4262 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 11971450 times.
✓ Branch 110 taken 4262 times.
✓ Branch 111 taken 264 times.
✓ Branch 112 taken 11971450 times.
✓ Branch 113 taken 4262 times.
✓ Branch 114 taken 264 times.
✓ Branch 115 taken 11971450 times.
✓ Branch 116 taken 4262 times.
✓ Branch 117 taken 264 times.
✓ Branch 118 taken 11971450 times.
✓ Branch 119 taken 4262 times.
✓ Branch 120 taken 264 times.
✓ Branch 121 taken 11971450 times.
✓ Branch 122 taken 383732 times.
✓ Branch 123 taken 264 times.
✓ Branch 124 taken 11971450 times.
✓ Branch 125 taken 383732 times.
✓ Branch 126 taken 264 times.
✓ Branch 127 taken 11971450 times.
✓ Branch 128 taken 383732 times.
✓ Branch 129 taken 264 times.
✓ Branch 130 taken 11971450 times.
✓ Branch 131 taken 383732 times.
✓ Branch 132 taken 264 times.
✓ Branch 133 taken 455465 times.
✓ Branch 134 taken 383732 times.
✓ Branch 135 taken 264 times.
✓ Branch 136 taken 455465 times.
✓ Branch 137 taken 383732 times.
✓ Branch 138 taken 264 times.
✓ Branch 139 taken 455465 times.
✓ Branch 140 taken 383732 times.
✓ Branch 141 taken 264 times.
✓ Branch 142 taken 455465 times.
✓ Branch 143 taken 383732 times.
✓ Branch 144 taken 12 times.
✓ Branch 145 taken 455465 times.
✓ Branch 146 taken 383732 times.
✓ Branch 147 taken 12 times.
✓ Branch 148 taken 455465 times.
✓ Branch 149 taken 383732 times.
✓ Branch 150 taken 12 times.
✓ Branch 151 taken 455465 times.
✓ Branch 152 taken 383732 times.
✓ Branch 153 taken 12 times.
✓ Branch 154 taken 455465 times.
✓ Branch 155 taken 269792 times.
✓ Branch 156 taken 12 times.
✓ Branch 157 taken 455465 times.
✓ Branch 158 taken 269792 times.
✓ Branch 159 taken 12 times.
✓ Branch 160 taken 455465 times.
✓ Branch 161 taken 269792 times.
✓ Branch 162 taken 12 times.
✓ Branch 163 taken 455465 times.
✓ Branch 164 taken 269792 times.
✓ Branch 165 taken 12 times.
✓ Branch 166 taken 40489 times.
✓ Branch 167 taken 269792 times.
✓ Branch 168 taken 12 times.
✓ Branch 169 taken 40489 times.
✓ Branch 170 taken 269792 times.
✓ Branch 171 taken 12 times.
✓ Branch 172 taken 40489 times.
✓ Branch 173 taken 269792 times.
✓ Branch 174 taken 12 times.
✓ Branch 175 taken 40489 times.
✓ Branch 176 taken 269792 times.
✓ Branch 177 taken 12 times.
✓ Branch 178 taken 40489 times.
✓ Branch 179 taken 269792 times.
✓ Branch 180 taken 12 times.
✓ Branch 181 taken 40489 times.
✓ Branch 182 taken 269792 times.
✓ Branch 183 taken 12 times.
✓ Branch 184 taken 40489 times.
✓ Branch 185 taken 269792 times.
✓ Branch 186 taken 12 times.
✓ Branch 187 taken 40489 times.
✗ Branch 188 not taken.
✓ Branch 189 taken 12 times.
✓ Branch 190 taken 40489 times.
✗ Branch 191 not taken.
✓ Branch 192 taken 12 times.
✓ Branch 193 taken 40489 times.
✗ Branch 194 not taken.
✓ Branch 195 taken 12 times.
✓ Branch 196 taken 40489 times.
✗ Branch 197 not taken.
✓ Branch 198 taken 12 times.
✓ Branch 199 taken 499341 times.
✗ Branch 200 not taken.
✓ Branch 201 taken 12 times.
✓ Branch 202 taken 499341 times.
✗ Branch 203 not taken.
✓ Branch 204 taken 12 times.
✓ Branch 205 taken 499341 times.
✗ Branch 206 not taken.
✓ Branch 207 taken 12 times.
✓ Branch 208 taken 499341 times.
✗ Branch 209 not taken.
✓ Branch 210 taken 264 times.
✓ Branch 211 taken 499341 times.
✗ Branch 212 not taken.
✓ Branch 213 taken 264 times.
✓ Branch 214 taken 499341 times.
✗ Branch 215 not taken.
✓ Branch 216 taken 264 times.
✓ Branch 217 taken 499341 times.
✗ Branch 218 not taken.
✓ Branch 219 taken 264 times.
✓ Branch 220 taken 499341 times.
✗ Branch 221 not taken.
✓ Branch 222 taken 264 times.
✓ Branch 223 taken 499341 times.
✗ Branch 224 not taken.
✓ Branch 225 taken 264 times.
✓ Branch 226 taken 499341 times.
✗ Branch 227 not taken.
✓ Branch 228 taken 264 times.
✓ Branch 229 taken 499341 times.
✗ Branch 230 not taken.
✓ Branch 231 taken 264 times.
✓ Branch 232 taken 51558 times.
✗ Branch 233 not taken.
✓ Branch 234 taken 264 times.
✓ Branch 235 taken 51558 times.
✗ Branch 236 not taken.
✓ Branch 237 taken 264 times.
✓ Branch 238 taken 51558 times.
✗ Branch 239 not taken.
✓ Branch 240 taken 264 times.
✓ Branch 241 taken 51558 times.
✗ Branch 242 not taken.
✓ Branch 243 taken 5781 times.
✓ Branch 244 taken 51558 times.
✗ Branch 245 not taken.
✓ Branch 246 taken 5781 times.
✓ Branch 247 taken 51558 times.
✗ Branch 248 not taken.
✓ Branch 249 taken 5781 times.
✓ Branch 250 taken 51558 times.
✗ Branch 251 not taken.
✓ Branch 252 taken 5781 times.
✓ Branch 253 taken 51558 times.
✗ Branch 254 not taken.
✓ Branch 255 taken 5781 times.
✓ Branch 256 taken 51558 times.
✗ Branch 257 not taken.
✓ Branch 258 taken 5781 times.
✓ Branch 259 taken 51558 times.
✗ Branch 260 not taken.
✓ Branch 261 taken 5781 times.
✓ Branch 262 taken 51558 times.
✗ Branch 263 not taken.
✓ Branch 264 taken 5781 times.
✓ Branch 265 taken 51302 times.
✗ Branch 266 not taken.
✓ Branch 267 taken 5781 times.
✓ Branch 268 taken 51302 times.
✗ Branch 269 not taken.
✓ Branch 270 taken 5781 times.
✓ Branch 271 taken 51302 times.
✗ Branch 272 not taken.
✓ Branch 273 taken 5781 times.
✓ Branch 274 taken 51302 times.
✗ Branch 275 not taken.
✓ Branch 277 taken 51302 times.
✗ Branch 278 not taken.
✓ Branch 280 taken 51302 times.
✗ Branch 281 not taken.
✓ Branch 283 taken 51302 times.
✗ Branch 284 not taken.
✓ Branch 286 taken 51302 times.
✗ Branch 287 not taken.
✓ Branch 289 taken 51302 times.
✗ Branch 290 not taken.
✓ Branch 292 taken 51302 times.
✗ Branch 293 not taken.
✓ Branch 295 taken 51302 times.
✗ Branch 296 not taken.
✓ Branch 298 taken 1098424 times.
✗ Branch 299 not taken.
✓ Branch 301 taken 1098424 times.
✗ Branch 302 not taken.
✓ Branch 304 taken 1098424 times.
✗ Branch 305 not taken.
✓ Branch 307 taken 1098424 times.
✗ Branch 308 not taken.
✓ Branch 310 taken 1098424 times.
✗ Branch 311 not taken.
✓ Branch 313 taken 1098424 times.
✗ Branch 314 not taken.
✓ Branch 316 taken 1098424 times.
✗ Branch 317 not taken.
✓ Branch 319 taken 1098424 times.
✗ Branch 320 not taken.
✓ Branch 322 taken 1098424 times.
✗ Branch 323 not taken.
✓ Branch 325 taken 1098424 times.
✗ Branch 326 not taken.
✓ Branch 328 taken 1098424 times.
✗ Branch 329 not taken.
✓ Branch 331 taken 134500 times.
✗ Branch 332 not taken.
✓ Branch 334 taken 134500 times.
✗ Branch 335 not taken.
✓ Branch 337 taken 134500 times.
✗ Branch 338 not taken.
✓ Branch 340 taken 134500 times.
✗ Branch 341 not taken.
✓ Branch 343 taken 134500 times.
✗ Branch 344 not taken.
✓ Branch 346 taken 134500 times.
✗ Branch 347 not taken.
✓ Branch 349 taken 134500 times.
✗ Branch 350 not taken.
✓ Branch 352 taken 134500 times.
✗ Branch 353 not taken.
✓ Branch 355 taken 134500 times.
✗ Branch 356 not taken.
✓ Branch 358 taken 134500 times.
✗ Branch 359 not taken.
✓ Branch 361 taken 134500 times.
✗ Branch 362 not taken.
✓ Branch 375 taken 1 times.
✗ Branch 376 not taken.
✓ Branch 378 taken 1 times.
✗ Branch 379 not taken.
✓ Branch 381 taken 1 times.
✗ Branch 382 not taken.
✓ Branch 384 taken 1 times.
✗ Branch 385 not taken.
✓ Branch 387 taken 1 times.
✗ Branch 388 not taken.
✓ Branch 390 taken 1 times.
✗ Branch 391 not taken.
✓ Branch 393 taken 1 times.
✗ Branch 394 not taken.
✓ Branch 396 taken 1 times.
✗ Branch 397 not taken.
✓ Branch 399 taken 1 times.
✗ Branch 400 not taken.
✓ Branch 402 taken 1 times.
✗ Branch 403 not taken.
✓ Branch 405 taken 1 times.
✗ Branch 406 not taken.
|
189492292 | : gridGeometryPtr_(&gridGeometry) {} |
262 | |||
263 | //! Get an element sub control volume with a global scv index | ||
264 | //! We separate element and neighbor scvs to speed up mapping | ||
265 | const SubControlVolume& scv(GridIndexType scvIdx) const | ||
266 | { | ||
267 |
172/176✓ Branch 0 taken 96460507 times.
✓ Branch 1 taken 76464425 times.
✓ Branch 2 taken 96460507 times.
✓ Branch 3 taken 76464425 times.
✓ Branch 4 taken 92135233 times.
✓ Branch 5 taken 95466905 times.
✓ Branch 6 taken 92135233 times.
✓ Branch 7 taken 95466905 times.
✓ Branch 8 taken 94235673 times.
✓ Branch 9 taken 85117962 times.
✓ Branch 10 taken 94235673 times.
✓ Branch 11 taken 85117962 times.
✓ Branch 12 taken 72938831 times.
✓ Branch 13 taken 68697024 times.
✓ Branch 14 taken 72938831 times.
✓ Branch 15 taken 68697024 times.
✓ Branch 16 taken 40319110 times.
✓ Branch 17 taken 36204217 times.
✓ Branch 18 taken 40319110 times.
✓ Branch 19 taken 36204217 times.
✓ Branch 20 taken 40538770 times.
✓ Branch 21 taken 41005890 times.
✓ Branch 22 taken 40538770 times.
✓ Branch 23 taken 41005890 times.
✓ Branch 24 taken 91361752 times.
✓ Branch 25 taken 52281246 times.
✓ Branch 26 taken 87672920 times.
✓ Branch 27 taken 55997838 times.
✓ Branch 28 taken 46666725 times.
✓ Branch 29 taken 72042032 times.
✓ Branch 30 taken 46643557 times.
✓ Branch 31 taken 68325440 times.
✓ Branch 32 taken 18856581 times.
✓ Branch 33 taken 5234739 times.
✓ Branch 34 taken 19291461 times.
✓ Branch 35 taken 6088339 times.
✓ Branch 36 taken 3477123 times.
✓ Branch 37 taken 25230290 times.
✓ Branch 38 taken 3077981 times.
✓ Branch 39 taken 24376690 times.
✓ Branch 40 taken 4333719 times.
✓ Branch 41 taken 665776 times.
✓ Branch 42 taken 4347861 times.
✓ Branch 43 taken 706672 times.
✓ Branch 44 taken 1764801 times.
✓ Branch 45 taken 21703603 times.
✓ Branch 46 taken 1791445 times.
✓ Branch 47 taken 21662707 times.
✓ Branch 48 taken 17531078 times.
✓ Branch 49 taken 1679878 times.
✓ Branch 50 taken 17449434 times.
✓ Branch 51 taken 2067026 times.
✓ Branch 52 taken 11646342 times.
✓ Branch 53 taken 454644 times.
✓ Branch 54 taken 11649878 times.
✓ Branch 55 taken 177496 times.
✓ Branch 56 taken 6258567 times.
✓ Branch 57 taken 4074776 times.
✓ Branch 58 taken 6282531 times.
✓ Branch 59 taken 3978408 times.
✓ Branch 60 taken 13779602 times.
✓ Branch 61 taken 5378360 times.
✓ Branch 62 taken 13965502 times.
✓ Branch 63 taken 5364728 times.
✓ Branch 64 taken 679847 times.
✓ Branch 65 taken 197746 times.
✓ Branch 66 taken 466447 times.
✓ Branch 67 taken 197746 times.
✓ Branch 68 taken 138974 times.
✓ Branch 69 taken 1475950 times.
✓ Branch 70 taken 138974 times.
✓ Branch 71 taken 1475950 times.
✓ Branch 72 taken 619622 times.
✓ Branch 73 taken 1272311 times.
✓ Branch 74 taken 619622 times.
✓ Branch 75 taken 1272311 times.
✓ Branch 76 taken 223486 times.
✓ Branch 77 taken 3638 times.
✓ Branch 78 taken 223486 times.
✓ Branch 79 taken 3638 times.
✓ Branch 80 taken 185814 times.
✓ Branch 81 taken 7518 times.
✓ Branch 82 taken 185814 times.
✓ Branch 83 taken 7518 times.
✓ Branch 84 taken 137240 times.
✓ Branch 85 taken 543078 times.
✓ Branch 86 taken 137240 times.
✓ Branch 87 taken 543078 times.
✓ Branch 88 taken 47338 times.
✓ Branch 89 taken 473824 times.
✓ Branch 90 taken 47338 times.
✓ Branch 91 taken 473824 times.
✓ Branch 92 taken 129090 times.
✓ Branch 93 taken 10372 times.
✓ Branch 94 taken 129090 times.
✓ Branch 95 taken 10372 times.
✓ Branch 96 taken 54923 times.
✓ Branch 97 taken 11354 times.
✓ Branch 98 taken 54923 times.
✓ Branch 99 taken 11354 times.
✓ Branch 100 taken 104294 times.
✓ Branch 101 taken 5596 times.
✓ Branch 102 taken 104294 times.
✓ Branch 103 taken 5596 times.
✓ Branch 104 taken 197960 times.
✓ Branch 105 taken 106876 times.
✓ Branch 106 taken 197960 times.
✓ Branch 107 taken 106876 times.
✓ Branch 108 taken 39348 times.
✓ Branch 109 taken 109404 times.
✓ Branch 110 taken 39348 times.
✓ Branch 111 taken 109404 times.
✓ Branch 112 taken 796 times.
✓ Branch 113 taken 162472 times.
✓ Branch 114 taken 796 times.
✓ Branch 115 taken 162472 times.
✓ Branch 116 taken 1029378 times.
✓ Branch 117 taken 18 times.
✓ Branch 118 taken 1029378 times.
✓ Branch 119 taken 18 times.
✓ Branch 120 taken 1081004 times.
✓ Branch 121 taken 2480 times.
✓ Branch 122 taken 1081004 times.
✓ Branch 123 taken 2480 times.
✓ Branch 124 taken 708 times.
✓ Branch 125 taken 3162196 times.
✓ Branch 126 taken 708 times.
✓ Branch 127 taken 3162196 times.
✓ Branch 128 taken 73244 times.
✓ Branch 129 taken 100000 times.
✓ Branch 130 taken 73244 times.
✓ Branch 131 taken 100000 times.
✓ Branch 132 taken 90068 times.
✓ Branch 133 taken 2364 times.
✓ Branch 134 taken 90068 times.
✓ Branch 135 taken 2364 times.
✓ Branch 136 taken 964756 times.
✓ Branch 137 taken 154488 times.
✓ Branch 138 taken 964756 times.
✓ Branch 139 taken 154488 times.
✓ Branch 140 taken 86419 times.
✓ Branch 141 taken 33096 times.
✓ Branch 142 taken 86419 times.
✓ Branch 143 taken 33096 times.
✓ Branch 144 taken 6045 times.
✓ Branch 145 taken 1512 times.
✓ Branch 146 taken 6045 times.
✓ Branch 147 taken 1512 times.
✓ Branch 148 taken 2217 times.
✓ Branch 149 taken 23577 times.
✓ Branch 150 taken 2217 times.
✓ Branch 151 taken 23577 times.
✓ Branch 152 taken 39312 times.
✓ Branch 153 taken 24 times.
✓ Branch 154 taken 39312 times.
✓ Branch 155 taken 24 times.
✓ Branch 156 taken 400 times.
✓ Branch 157 taken 528 times.
✓ Branch 158 taken 400 times.
✓ Branch 159 taken 528 times.
✓ Branch 160 taken 12 times.
✓ Branch 161 taken 864 times.
✓ Branch 162 taken 12 times.
✓ Branch 163 taken 864 times.
✓ Branch 164 taken 8376 times.
✗ Branch 165 not taken.
✓ Branch 166 taken 8376 times.
✗ Branch 167 not taken.
✓ Branch 168 taken 5781 times.
✓ Branch 169 taken 24056 times.
✓ Branch 170 taken 5781 times.
✓ Branch 171 taken 24056 times.
✗ Branch 172 not taken.
✓ Branch 173 taken 304 times.
✗ Branch 174 not taken.
✓ Branch 175 taken 304 times.
|
2479390426 | if (scvIdx == scvIndices_[0]) |
268 | 1283497020 | return scvs_[0]; | |
269 | else | ||
270 | 598555509 | return neighborScvs_[Detail::Tpfa::findLocalIndex(scvIdx, neighborScvIndices_)]; | |
271 | } | ||
272 | |||
273 | //! Get an element sub control volume face with a global scvf index | ||
274 | //! We separate element and neighbor scvfs to speed up mapping | ||
275 | 215283047 | const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const | |
276 | { | ||
277 | 645849141 | auto it = std::find(scvfIndices_.begin(), scvfIndices_.end(), scvfIdx); | |
278 |
6/6✓ Branch 0 taken 53674592 times.
✓ Branch 1 taken 147337169 times.
✓ Branch 2 taken 53674592 times.
✓ Branch 3 taken 147337169 times.
✓ Branch 4 taken 53674592 times.
✓ Branch 5 taken 147337169 times.
|
645849141 | if (it != scvfIndices_.end()) |
279 | 228992912 | return scvfs_[std::distance(scvfIndices_.begin(), it)]; | |
280 | else | ||
281 | 158034819 | return neighborScvfs_[Detail::Tpfa::findLocalIndex(scvfIdx, neighborScvfIndices_)]; | |
282 | } | ||
283 | |||
284 | //! Get the scvf on the same face but from the other side | ||
285 | //! Note that e.g. the normals might be different in the case of surface grids | ||
286 | 15211828 | const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const | |
287 | { | ||
288 | 45635484 | auto it = std::find(scvfIndices_.begin(), scvfIndices_.end(), scvfIdx); | |
289 |
6/6✓ Branch 0 taken 4006914 times.
✓ Branch 1 taken 3881672 times.
✓ Branch 2 taken 4006914 times.
✓ Branch 3 taken 3881672 times.
✓ Branch 4 taken 4006914 times.
✓ Branch 5 taken 3881672 times.
|
45635484 | if (it != scvfIndices_.end()) |
290 | { | ||
291 | 15344774 | const auto localScvfIdx = std::distance(scvfIndices_.begin(), it); | |
292 | 30689548 | return neighborScvfs_[flippedScvfIndices_[localScvfIdx][outsideScvIdx]]; | |
293 | } | ||
294 | else | ||
295 | { | ||
296 | 7539441 | const auto localScvfIdx = Detail::Tpfa::findLocalIndex(scvfIdx, neighborScvfIndices_); | |
297 |
4/4✓ Branch 0 taken 3869750 times.
✓ Branch 1 taken 11922 times.
✓ Branch 2 taken 3869750 times.
✓ Branch 3 taken 11922 times.
|
15078882 | const auto localFlippedIndex = flippedNeighborScvfIndices_[localScvfIdx][outsideScvIdx]; |
298 |
4/4✓ Branch 0 taken 3869750 times.
✓ Branch 1 taken 11922 times.
✓ Branch 2 taken 3869750 times.
✓ Branch 3 taken 11922 times.
|
15078882 | if (localFlippedIndex < scvfs_.size()) |
299 | 15052374 | return scvfs_[localFlippedIndex]; | |
300 | else | ||
301 | 26508 | return neighborScvfs_[localFlippedIndex - scvfs_.size()]; | |
302 | } | ||
303 | } | ||
304 | |||
305 | //! iterator range for sub control volumes. Iterates over | ||
306 | //! all scvs of the bound element (not including neighbor scvs) | ||
307 | //! This is a free function found by means of ADL | ||
308 | //! To iterate over all sub control volumes of this FVElementGeometry use | ||
309 | //! for (auto&& scv : scvs(fvGeometry)) | ||
310 | friend inline Dune::IteratorRange<typename std::array<SubControlVolume, 1>::const_iterator> | ||
311 | scvs(const ThisType& g) | ||
312 | { | ||
313 | using IteratorType = typename std::array<SubControlVolume, 1>::const_iterator; | ||
314 |
26/32✓ Branch 0 taken 1959248 times.
✓ Branch 1 taken 4324516 times.
✓ Branch 2 taken 1959248 times.
✓ Branch 3 taken 4142364 times.
✓ Branch 4 taken 2146680 times.
✓ Branch 5 taken 4142364 times.
✓ Branch 6 taken 5280 times.
✓ Branch 7 taken 188204 times.
✓ Branch 8 taken 5280 times.
✓ Branch 9 taken 6052 times.
✓ Branch 10 taken 8840 times.
✓ Branch 11 taken 6052 times.
✓ Branch 12 taken 5280 times.
✓ Branch 13 taken 51916 times.
✓ Branch 14 taken 5280 times.
✓ Branch 15 taken 48356 times.
✓ Branch 16 taken 3560 times.
✓ Branch 17 taken 48356 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1242 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 1232 times.
✓ Branch 22 taken 10 times.
✓ Branch 23 taken 1232 times.
✓ Branch 25 taken 10 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 10 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 10 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 10 times.
✗ Branch 35 not taken.
|
187584828 | return Dune::IteratorRange<IteratorType>(g.scvs_.begin(), g.scvs_.end()); |
315 | } | ||
316 | |||
317 | //! iterator range for sub control volumes faces. Iterates over | ||
318 | //! all scvfs of the bound element (not including neighbor scvfs) | ||
319 | //! This is a free function found by means of ADL | ||
320 | //! To iterate over all sub control volume faces of this FVElementGeometry use | ||
321 | //! for (auto&& scvf : scvfs(fvGeometry)) | ||
322 | friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator> | ||
323 | scvfs(const ThisType& g) | ||
324 | { | ||
325 | using IteratorType = typename std::vector<SubControlVolumeFace>::const_iterator; | ||
326 |
12/24✓ Branch 1 taken 400 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 400 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 400 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 400 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 400 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 400 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 10 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 10 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 10 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 10 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 10 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 10 times.
✗ Branch 35 not taken.
|
170299392 | return Dune::IteratorRange<IteratorType>(g.scvfs_.begin(), g.scvfs_.end()); |
327 | } | ||
328 | |||
329 | //! number of sub control volumes in this fv element geometry | ||
330 | ✗ | std::size_t numScv() const | |
331 |
3/4✓ Branch 0 taken 404096 times.
✓ Branch 1 taken 3515 times.
✓ Branch 2 taken 405376 times.
✗ Branch 3 not taken.
|
54377588 | { return scvs_.size(); } |
332 | |||
333 | //! number of sub control volumes in this fv element geometry | ||
334 | std::size_t numScvf() const | ||
335 |
3/6✗ Branch 0 not taken.
✓ Branch 1 taken 658336 times.
✓ Branch 2 taken 2580 times.
✓ Branch 3 taken 658336 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
16852668 | { return scvfs_.size(); } |
336 | |||
337 | /*! | ||
338 | * \brief bind the local view (r-value overload) | ||
339 | * This overload is called when an instance of this class is a temporary in the usage context | ||
340 | * This allows a usage like this: `const auto view = localView(...).bind(element);` | ||
341 | */ | ||
342 | CCTpfaFVElementGeometry bind(const Element& element) && | ||
343 | { | ||
344 |
3/6✓ Branch 1 taken 4811 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 50012 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 100 times.
✗ Branch 8 not taken.
|
54923 | this->bind_(element); |
345 | 54923 | return std::move(*this); | |
346 | } | ||
347 | |||
348 | void bind(const Element& element) & | ||
349 | { | ||
350 |
8/14✓ Branch 1 taken 560861 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 87740 times.
✓ Branch 5 taken 36914 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 10 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 76900 times.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 17 taken 100 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1928 times.
✗ Branch 21 not taken.
|
16166880 | this->bind_(element); |
351 | } | ||
352 | |||
353 | /*! | ||
354 | * \brief bind the local view (r-value overload) | ||
355 | * This overload is called when an instance of this class is a temporary in the usage context | ||
356 | * This allows a usage like this: `const auto view = localView(...).bindElement(element);` | ||
357 | */ | ||
358 | CCTpfaFVElementGeometry bindElement(const Element& element) && | ||
359 | { | ||
360 |
4/8✓ Branch 1 taken 187611 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4440 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 371200 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 371200 times.
✗ Branch 11 not taken.
|
934451 | this->bindElement_(element); |
361 | 934451 | return std::move(*this); | |
362 | } | ||
363 | |||
364 | void bindElement(const Element& element) & | ||
365 | { | ||
366 |
12/24✓ Branch 1 taken 895089 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 448544 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 680830 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2428811 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 309701 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 378759 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 519406 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1990 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 52048 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 100528 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 320 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 376 times.
✗ Branch 35 not taken.
|
5816402 | this->bindElement_(element); |
367 | } | ||
368 | |||
369 | //! Returns true if bind/bindElement has already been called | ||
370 | bool isBound() const | ||
371 |
4/8✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 4 times.
|
8 | { return static_cast<bool>(element_); } |
372 | |||
373 | //! The bound element | ||
374 | const Element& element() const | ||
375 | 2303880 | { return *element_; } | |
376 | |||
377 | //! The global finite volume geometry we are a restriction of | ||
378 | ✗ | const GridGeometry& gridGeometry() const | |
379 | ✗ | { return *gridGeometryPtr_; } | |
380 | |||
381 | //! Returns whether one of the geometry's scvfs lies on a boundary | ||
382 | ✗ | bool hasBoundaryScvf() const | |
383 | ✗ | { return hasBoundaryScvf_; } | |
384 | |||
385 | ✗ | typename Element::Geometry geometry(const SubControlVolume& scv) const | |
386 | ✗ | { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); } | |
387 | |||
388 | 4744 | typename GridView::Intersection::Geometry geometry(const SubControlVolumeFace& scvf) const | |
389 | { | ||
390 |
0/4✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
9592 | const auto element = gridGeometryPtr_->element(scvf.insideScvIdx()); |
391 | 9488 | const auto& scvfIndices = gridGeometryPtr_->scvfIndicesOfScv(scvf.insideScvIdx()); | |
392 | 4744 | const LocalIndexType localScvfIdx = Detail::Tpfa::findLocalIndex(scvf.index(), scvfIndices); | |
393 | 4744 | LocalIndexType localIdx = 0; | |
394 |
5/11✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 11600 times.
✓ Branch 4 taken 104 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 280 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 14 taken 176 times.
✗ Branch 15 not taken.
|
16904 | for (const auto& intersection : intersections(gridGeometryPtr_->gridView(), element)) |
395 | { | ||
396 |
4/6✓ Branch 0 taken 9252 times.
✓ Branch 1 taken 2412 times.
✓ Branch 2 taken 4912 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 64 times.
✗ Branch 5 not taken.
|
14228 | if (intersection.neighbor() || intersection.boundary()) |
397 | { | ||
398 |
2/2✓ Branch 0 taken 4744 times.
✓ Branch 1 taken 7136 times.
|
11880 | if (localIdx == localScvfIdx) |
399 |
1/2✓ Branch 1 taken 104 times.
✗ Branch 2 not taken.
|
4848 | return intersection.geometry(); |
400 | else | ||
401 | 7136 | ++localIdx; | |
402 | } | ||
403 | } | ||
404 | |||
405 | ✗ | DUNE_THROW(Dune::InvalidStateException, "Could not find scvf geometry"); | |
406 | } | ||
407 | |||
408 | private: | ||
409 | //! Binding of an element preparing the geometries of the whole stencil | ||
410 | //! called by the local jacobian to prepare element assembly | ||
411 | 17579748 | void bind_(const Element& element) | |
412 | { | ||
413 | 17579748 | bindElement_(element); | |
414 | |||
415 | 30696123 | neighborScvs_.reserve(element.subEntities(1)); | |
416 | 30696123 | neighborScvfIndices_.reserve(element.subEntities(1)); | |
417 | 30696123 | neighborScvfs_.reserve(element.subEntities(1)); | |
418 | |||
419 |
2/6✓ Branch 1 taken 16221803 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 16191403 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
35159496 | std::vector<GridIndexType> handledNeighbors; |
420 |
3/5✓ Branch 1 taken 16191403 times.
✓ Branch 2 taken 30400 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16191403 times.
✗ Branch 5 not taken.
|
30696123 | handledNeighbors.reserve(element.subEntities(1)); |
421 | |||
422 |
17/21✓ Branch 1 taken 3407701 times.
✓ Branch 2 taken 12814102 times.
✓ Branch 3 taken 34918640 times.
✓ Branch 4 taken 19857342 times.
✓ Branch 5 taken 49599 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 365534 times.
✓ Branch 8 taken 14459178 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 243934 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1071858 times.
✓ Branch 13 taken 407254 times.
✓ Branch 14 taken 11699817 times.
✓ Branch 15 taken 162332 times.
✓ Branch 16 taken 903358 times.
✓ Branch 17 taken 229202 times.
✓ Branch 18 taken 111726 times.
✓ Branch 19 taken 649328 times.
✓ Branch 20 taken 340928 times.
✗ Branch 21 not taken.
|
107969208 | for (const auto& intersection : intersections(gridGeometry().gridView(), element)) |
423 | { | ||
424 | // for inner intersections and periodic (according to grid interface) intersections make neighbor geometry | ||
425 |
4/4✓ Branch 0 taken 34127226 times.
✓ Branch 1 taken 12900620 times.
✓ Branch 2 taken 650585 times.
✓ Branch 3 taken 120834 times.
|
52230985 | if (intersection.neighbor()) |
426 | { | ||
427 |
1/2✓ Branch 1 taken 11712050 times.
✗ Branch 2 not taken.
|
62509822 | const auto outside = intersection.outside(); |
428 |
2/4✓ Branch 1 taken 11712050 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 11712050 times.
✗ Branch 5 not taken.
|
95052828 | const auto outsideIdx = gridGeometry().elementMapper().index(outside); |
429 | |||
430 | // make outside geometries only if not done yet (could happen on non-conforming grids) | ||
431 |
2/4✓ Branch 4 taken 43288072 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 43288072 times.
✗ Branch 7 not taken.
|
190105656 | if ( std::find(handledNeighbors.begin(), handledNeighbors.end(), outsideIdx) == handledNeighbors.end() ) |
432 | { | ||
433 |
1/2✓ Branch 1 taken 43288072 times.
✗ Branch 2 not taken.
|
47526414 | makeNeighborGeometries(outside, outsideIdx); |
434 |
1/2✓ Branch 1 taken 43288072 times.
✗ Branch 2 not taken.
|
47526414 | handledNeighbors.push_back(outsideIdx); |
435 | } | ||
436 | } | ||
437 | } | ||
438 | |||
439 | // build flip index set for network, surface, and periodic grids | ||
440 |
2/2✓ Branch 0 taken 30400 times.
✓ Branch 1 taken 15990210 times.
|
17237013 | if (dim < dimWorld || gridGeometry().isPeriodic()) |
441 | { | ||
442 |
2/4✓ Branch 1 taken 231593 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 231593 times.
✗ Branch 5 not taken.
|
746270 | flippedScvfIndices_.resize(scvfs_.size()); |
443 |
4/4✓ Branch 0 taken 697076 times.
✓ Branch 1 taken 231593 times.
✓ Branch 2 taken 697076 times.
✓ Branch 3 taken 231593 times.
|
1899920 | for (unsigned int localScvfIdx = 0; localScvfIdx < scvfs_.size(); ++localScvfIdx) |
444 | { | ||
445 |
2/2✓ Branch 0 taken 676112 times.
✓ Branch 1 taken 20964 times.
|
1153650 | const auto& scvf = scvfs_[localScvfIdx]; |
446 |
2/2✓ Branch 0 taken 676112 times.
✓ Branch 1 taken 20964 times.
|
1153650 | if (scvf.boundary()) |
447 | continue; | ||
448 | |||
449 |
3/6✓ Branch 1 taken 676112 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 676112 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 676112 times.
✗ Branch 8 not taken.
|
3350586 | flippedScvfIndices_[localScvfIdx].resize(scvf.numOutsideScvs()); |
450 |
4/4✓ Branch 0 taken 700694 times.
✓ Branch 1 taken 676112 times.
✓ Branch 2 taken 700694 times.
✓ Branch 3 taken 676112 times.
|
3387384 | for (unsigned int localOutsideScvIdx = 0; localOutsideScvIdx < scvf.numOutsideScvs(); ++localOutsideScvIdx) |
451 | { | ||
452 | 1153660 | const auto globalOutsideScvIdx = scvf.outsideScvIdx(localOutsideScvIdx); | |
453 |
2/4✓ Branch 0 taken 1534004 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1534004 times.
✗ Branch 3 not taken.
|
2554727 | for (unsigned int localNeighborScvfIdx = 0; localNeighborScvfIdx < neighborScvfs_.size(); ++localNeighborScvfIdx) |
454 | { | ||
455 |
6/6✓ Branch 0 taken 700694 times.
✓ Branch 1 taken 833310 times.
✓ Branch 2 taken 700694 times.
✓ Branch 3 taken 833310 times.
✓ Branch 4 taken 700694 times.
✓ Branch 5 taken 833310 times.
|
7664181 | if (neighborScvfs_[localNeighborScvfIdx].insideScvIdx() == globalOutsideScvIdx) |
456 | { | ||
457 | 2307320 | flippedScvfIndices_[localScvfIdx][localOutsideScvIdx] = localNeighborScvfIdx; | |
458 | 1153660 | break; | |
459 | } | ||
460 | } | ||
461 | } | ||
462 | } | ||
463 | |||
464 |
2/4✓ Branch 1 taken 231593 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 231593 times.
✗ Branch 5 not taken.
|
746270 | flippedNeighborScvfIndices_.resize(neighborScvfs_.size()); |
465 |
4/4✓ Branch 0 taken 700694 times.
✓ Branch 1 taken 231593 times.
✓ Branch 2 taken 700694 times.
✓ Branch 3 taken 231593 times.
|
1899930 | for (unsigned int localScvfIdx = 0; localScvfIdx < neighborScvfs_.size(); ++localScvfIdx) |
466 | { | ||
467 |
1/2✓ Branch 1 taken 700694 times.
✗ Branch 2 not taken.
|
1153660 | const auto& neighborScvf = neighborScvfs_[localScvfIdx]; |
468 |
3/6✓ Branch 1 taken 700694 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 700694 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 700694 times.
✗ Branch 8 not taken.
|
3460980 | flippedNeighborScvfIndices_[localScvfIdx].resize(neighborScvf.numOutsideScvs()); |
469 |
4/4✓ Branch 0 taken 774710 times.
✓ Branch 1 taken 700694 times.
✓ Branch 2 taken 774710 times.
✓ Branch 3 taken 700694 times.
|
4835968 | for (unsigned int localOutsideScvIdx = 0; localOutsideScvIdx < neighborScvf.numOutsideScvs(); ++localOutsideScvIdx) |
470 | { | ||
471 |
3/6✓ Branch 1 taken 774710 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 774710 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 774710 times.
✗ Branch 8 not taken.
|
3792972 | flippedNeighborScvfIndices_[localScvfIdx][localOutsideScvIdx] = findFlippedScvfIndex_(neighborScvf.insideScvIdx(), neighborScvf.outsideScvIdx(localOutsideScvIdx)); |
472 | } | ||
473 | } | ||
474 | } | ||
475 | 17579748 | } | |
476 | |||
477 | //! Binding of an element preparing the geometries only inside the element | ||
478 | 24650429 | void bindElement_(const Element& element) | |
479 | { | ||
480 | 24650429 | clear(); | |
481 |
2/2✓ Branch 0 taken 3722584 times.
✓ Branch 1 taken 13926441 times.
|
24650429 | element_ = element; |
482 | 42586709 | scvfs_.reserve(element.subEntities(1)); | |
483 | 42586709 | scvfIndices_.reserve(element.subEntities(1)); | |
484 | 24650429 | makeElementGeometries(element); | |
485 | 24650429 | } | |
486 | |||
487 | 1264324 | GridIndexType findFlippedScvfIndex_(GridIndexType insideScvIdx, GridIndexType globalOutsideScvIdx) | |
488 | { | ||
489 |
4/4✓ Branch 0 taken 2552480 times.
✓ Branch 1 taken 700694 times.
✓ Branch 2 taken 2552480 times.
✓ Branch 3 taken 700694 times.
|
5386150 | for (unsigned int localNeighborScvfIdx = 0; localNeighborScvfIdx < neighborScvfs_.size(); ++localNeighborScvfIdx) |
490 | { | ||
491 |
6/6✓ Branch 0 taken 74016 times.
✓ Branch 1 taken 2478464 times.
✓ Branch 2 taken 74016 times.
✓ Branch 3 taken 2478464 times.
✓ Branch 4 taken 74016 times.
✓ Branch 5 taken 2478464 times.
|
12697470 | if (neighborScvfs_[localNeighborScvfIdx].insideScvIdx() == globalOutsideScvIdx) |
492 | { | ||
493 | 221328 | return scvfs_.size() + localNeighborScvfIdx; | |
494 | } | ||
495 | } | ||
496 | |||
497 | // go over all potential scvfs of the outside scv | ||
498 |
2/4✓ Branch 0 taken 1505049 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1505049 times.
✗ Branch 3 not taken.
|
3672882 | for (unsigned int localOutsideScvfIdx = 0; localOutsideScvfIdx < scvfs_.size(); ++localOutsideScvfIdx) |
499 | { | ||
500 | 2519222 | const auto& outsideScvf = scvfs_[localOutsideScvfIdx]; | |
501 |
4/4✓ Branch 0 taken 1554579 times.
✓ Branch 1 taken 804355 times.
✓ Branch 2 taken 1554579 times.
✓ Branch 3 taken 804355 times.
|
3958896 | for (unsigned int j = 0; j < outsideScvf.numOutsideScvs(); ++j) |
502 | { | ||
503 |
4/4✓ Branch 0 taken 700694 times.
✓ Branch 1 taken 853885 times.
✓ Branch 2 taken 700694 times.
✓ Branch 3 taken 853885 times.
|
5186668 | if (outsideScvf.outsideScvIdx(j) == insideScvIdx) |
504 | { | ||
505 | 1153660 | return localOutsideScvfIdx; | |
506 | } | ||
507 | } | ||
508 | } | ||
509 | |||
510 | ✗ | DUNE_THROW(Dune::InvalidStateException, "No flipped version of this scvf found!"); | |
511 | } | ||
512 | |||
513 | //! create scvs and scvfs of the bound element | ||
514 | 24650429 | void makeElementGeometries(const Element& element) | |
515 | { | ||
516 | using ScvfGridIndexStorage = typename SubControlVolumeFace::Traits::GridIndexStorage; | ||
517 | |||
518 | 49300858 | const auto eIdx = gridGeometry().elementMapper().index(element); | |
519 |
2/3✓ Branch 2 taken 5043059 times.
✓ Branch 3 taken 1392785 times.
✗ Branch 4 not taken.
|
40007574 | scvs_[0] = SubControlVolume(element.geometry(), eIdx); |
520 |
1/2✓ Branch 1 taken 6449364 times.
✗ Branch 2 not taken.
|
24650429 | scvIndices_[0] = eIdx; |
521 | |||
522 |
1/2✓ Branch 1 taken 6449364 times.
✗ Branch 2 not taken.
|
24650429 | const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdx); |
523 |
1/2✓ Branch 1 taken 6449364 times.
✗ Branch 2 not taken.
|
24650429 | const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx); |
524 | |||
525 | // for network grids there might be multiple intersection with the same geometryInInside | ||
526 | // we identify those by the indexInInside for now (assumes conforming grids at branching facets) | ||
527 | // here we keep track of them | ||
528 |
1/2✓ Branch 1 taken 6449364 times.
✗ Branch 2 not taken.
|
25074873 | std::vector<bool> handledScvf; |
529 | if (dim < dimWorld) | ||
530 |
2/4✓ Branch 1 taken 1115889 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1115889 times.
✗ Branch 5 not taken.
|
2681206 | handledScvf.resize(element.subEntities(1), false); |
531 | |||
532 | 24650429 | int scvfCounter = 0; | |
533 |
18/21✓ Branch 1 taken 6449364 times.
✓ Branch 2 taken 16523722 times.
✓ Branch 3 taken 47856936 times.
✓ Branch 4 taken 6932564 times.
✓ Branch 5 taken 18363035 times.
✓ Branch 6 taken 20293 times.
✓ Branch 7 taken 907503 times.
✓ Branch 8 taken 27094175 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 424303 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1848295 times.
✓ Branch 13 taken 752776 times.
✓ Branch 14 taken 19560886 times.
✓ Branch 15 taken 2569012 times.
✓ Branch 16 taken 450516 times.
✓ Branch 17 taken 2266752 times.
✓ Branch 18 taken 139449 times.
✓ Branch 19 taken 377763 times.
✓ Branch 21 taken 517212 times.
✗ Branch 22 not taken.
|
189860045 | for (const auto& intersection : intersections(gridGeometry().gridView(), element)) |
534 | { | ||
535 | if (dim < dimWorld) | ||
536 |
7/9✗ Branch 0 not taken.
✓ Branch 1 taken 2717268 times.
✓ Branch 2 taken 2007916 times.
✓ Branch 3 taken 709352 times.
✓ Branch 4 taken 2007916 times.
✓ Branch 5 taken 709352 times.
✓ Branch 6 taken 2007916 times.
✓ Branch 7 taken 709352 times.
✗ Branch 8 not taken.
|
3671968 | if (handledScvf[intersection.indexInInside()]) |
537 | continue; | ||
538 | |||
539 |
2/2✓ Branch 0 taken 45611830 times.
✓ Branch 1 taken 4287034 times.
|
75601606 | const auto& scvfNeighborVolVarIndices = neighborVolVarIndices[scvfCounter]; |
540 |
7/8✓ Branch 0 taken 45611830 times.
✓ Branch 1 taken 4598305 times.
✓ Branch 2 taken 23345845 times.
✓ Branch 3 taken 2312205 times.
✓ Branch 4 taken 521462 times.
✓ Branch 5 taken 2732 times.
✓ Branch 6 taken 73474 times.
✗ Branch 7 not taken.
|
80761544 | if (intersection.neighbor() || intersection.boundary()) |
541 | { | ||
542 |
2/3✓ Branch 0 taken 67929818 times.
✓ Branch 1 taken 70388250 times.
✗ Branch 2 not taken.
|
151192780 | ScvfGridIndexStorage scvIndices; |
543 |
3/5✓ Branch 0 taken 67929818 times.
✓ Branch 1 taken 2458432 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2458432 times.
✗ Branch 5 not taken.
|
78956162 | scvIndices.resize(scvfNeighborVolVarIndices.size() + 1); |
544 |
1/2✓ Branch 0 taken 67929818 times.
✗ Branch 1 not taken.
|
75596390 | scvIndices[0] = eIdx; |
545 |
5/10✓ Branch 0 taken 70388250 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 70388250 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 70388250 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 70388250 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2458432 times.
✗ Branch 9 not taken.
|
305745332 | std::copy(scvfNeighborVolVarIndices.begin(), scvfNeighborVolVarIndices.end(), scvIndices.begin()+1); |
546 | |||
547 |
7/8✓ Branch 0 taken 48961826 times.
✓ Branch 1 taken 2454933 times.
✓ Branch 2 taken 21227663 times.
✓ Branch 3 taken 4045408 times.
✓ Branch 4 taken 2800 times.
✓ Branch 5 taken 521186 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 73474 times.
|
82486403 | const bool onBoundary = intersection.boundary() && !intersection.neighbor(); |
548 |
4/4✓ Branch 0 taken 63937245 times.
✓ Branch 1 taken 6451005 times.
✓ Branch 2 taken 60905428 times.
✓ Branch 3 taken 3031817 times.
|
75596390 | hasBoundaryScvf_ = (hasBoundaryScvf_ || onBoundary); |
549 | |||
550 |
2/6✓ Branch 1 taken 70388250 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 515004 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
75596390 | scvfs_.emplace_back(intersection, |
551 | intersection.geometry(), | ||
552 |
2/4✓ Branch 1 taken 21325282 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 21325282 times.
✗ Branch 5 not taken.
|
151192780 | scvFaceIndices[scvfCounter], |
553 | scvIndices, | ||
554 | onBoundary); | ||
555 |
2/4✓ Branch 1 taken 70388250 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 70388250 times.
✗ Branch 5 not taken.
|
151192780 | scvfIndices_.emplace_back(scvFaceIndices[scvfCounter]); |
556 |
1/2✓ Branch 1 taken 1209040 times.
✗ Branch 2 not taken.
|
75596390 | scvfCounter++; |
557 | |||
558 | // for surface and network grids mark that we handled this face | ||
559 | if (dim < dimWorld) | ||
560 |
7/9✗ Branch 0 not taken.
✓ Branch 1 taken 2458432 times.
✓ Branch 2 taken 2007916 times.
✓ Branch 3 taken 450516 times.
✓ Branch 4 taken 2007916 times.
✓ Branch 5 taken 450516 times.
✓ Branch 6 taken 2007916 times.
✓ Branch 7 taken 450516 times.
✗ Branch 8 not taken.
|
3359772 | handledScvf[intersection.indexInInside()] = true; |
561 | } | ||
562 | } | ||
563 | 24650429 | } | |
564 | |||
565 | //! create the necessary scvs and scvfs of the neighbor elements to the bound elements | ||
566 | 47526414 | void makeNeighborGeometries(const Element& element, const GridIndexType eIdx) | |
567 | { | ||
568 | using ScvfGridIndexStorage = typename SubControlVolumeFace::Traits::GridIndexStorage; | ||
569 | |||
570 | // create the neighbor scv | ||
571 |
1/2✓ Branch 2 taken 10865928 times.
✗ Branch 3 not taken.
|
47755616 | neighborScvs_.emplace_back(element.geometry(), eIdx); |
572 | 47526414 | neighborScvIndices_.push_back(eIdx); | |
573 | |||
574 |
1/2✓ Branch 1 taken 11956972 times.
✗ Branch 2 not taken.
|
47526414 | const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdx); |
575 |
1/2✓ Branch 1 taken 11956972 times.
✗ Branch 2 not taken.
|
47526414 | const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx); |
576 | |||
577 | // for network grids there might be multiple intersection with the same geometryInInside | ||
578 | // we identify those by the indexInInside for now (assumes conforming grids at branching facets) | ||
579 | // here we keep track of them | ||
580 |
1/2✓ Branch 1 taken 11956972 times.
✗ Branch 2 not taken.
|
48263926 | std::vector<bool> handledScvf; |
581 | if (dim < dimWorld) | ||
582 |
2/4✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 580102 times.
✗ Branch 5 not taken.
|
1395776 | handledScvf.resize(element.subEntities(1), false); |
583 | |||
584 | 47526414 | int scvfCounter = 0; | |
585 |
18/22✓ Branch 1 taken 11956972 times.
✓ Branch 2 taken 31331100 times.
✓ Branch 3 taken 92749340 times.
✓ Branch 4 taken 12439340 times.
✓ Branch 5 taken 32719077 times.
✓ Branch 6 taken 19199 times.
✓ Branch 7 taken 1328490 times.
✓ Branch 8 taken 52003990 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 846122 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 3682186 times.
✓ Branch 13 taken 1957640 times.
✓ Branch 14 taken 41430734 times.
✓ Branch 15 taken 1206286 times.
✓ Branch 16 taken 3808400 times.
✓ Branch 17 taken 589366 times.
✓ Branch 18 taken 753586 times.
✓ Branch 19 taken 2699398 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 985304 times.
✗ Branch 22 not taken.
|
366638284 | for (const auto& intersection : intersections(gridGeometry().gridView(), element)) |
586 | { | ||
587 | if (dim < dimWorld) | ||
588 |
7/9✗ Branch 0 not taken.
✓ Branch 1 taken 1930086 times.
✓ Branch 2 taken 490696 times.
✓ Branch 3 taken 1439390 times.
✓ Branch 4 taken 490696 times.
✓ Branch 5 taken 1439390 times.
✓ Branch 6 taken 490696 times.
✓ Branch 7 taken 1439390 times.
✗ Branch 8 not taken.
|
3556166 | if (handledScvf[intersection.indexInInside()]) |
589 | continue; | ||
590 | |||
591 |
4/4✓ Branch 0 taken 92255684 times.
✓ Branch 1 taken 44258190 times.
✓ Branch 2 taken 1717992 times.
✓ Branch 3 taken 240928 times.
|
152388362 | if (intersection.neighbor()) |
592 | { | ||
593 | // this catches inner and periodic scvfs | ||
594 |
2/3✓ Branch 0 taken 479360 times.
✓ Branch 1 taken 124662754 times.
✗ Branch 2 not taken.
|
142280178 | const auto& scvfNeighborVolVarIndices = neighborVolVarIndices[scvfCounter]; |
595 |
8/11✓ Branch 0 taken 479360 times.
✓ Branch 1 taken 124662754 times.
✓ Branch 2 taken 960846 times.
✓ Branch 3 taken 3142458 times.
✓ Branch 4 taken 125142114 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1787104 times.
✓ Branch 7 taken 123355010 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 123355010 times.
✗ Branch 10 not taken.
|
423991174 | if (scvfNeighborVolVarIndices[0] < gridGeometry().gridView().size(0)) |
596 | { | ||
597 | // only create subcontrol faces where the outside element is the bound element | ||
598 | if (dim == dimWorld) | ||
599 | { | ||
600 |
7/10✓ Branch 1 taken 41658576 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72989676 times.
✓ Branch 5 taken 53987152 times.
✓ Branch 7 taken 41658576 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 41658576 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 11376870 times.
✓ Branch 13 taken 30281706 times.
|
555805832 | if (scvfNeighborVolVarIndices[0] == gridGeometry().elementMapper().index(*element_)) |
601 | { | ||
602 | 92986692 | ScvfGridIndexStorage scvIndices({eIdx, scvfNeighborVolVarIndices[0]}); | |
603 |
2/6✓ Branch 1 taken 42707970 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 229202 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
46493346 | neighborScvfs_.emplace_back(intersection, |
604 | intersection.geometry(), | ||
605 |
1/2✓ Branch 1 taken 10759950 times.
✗ Branch 2 not taken.
|
46493346 | scvFaceIndices[scvfCounter], |
606 | scvIndices, | ||
607 |
1/2✓ Branch 1 taken 10759950 times.
✗ Branch 2 not taken.
|
46493346 | false); |
608 | |||
609 |
2/4✓ Branch 1 taken 42707970 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 42707970 times.
✗ Branch 5 not taken.
|
92986692 | neighborScvfIndices_.push_back(scvFaceIndices[scvfCounter]); |
610 | } | ||
611 | } | ||
612 | // for network grids we can't use the intersection.outside() index as we can't assure that the | ||
613 | // first intersection with this indexInInside is the one that has our bound element as outside | ||
614 | // instead we check if the bound element's index is in the outsideScvIndices of the candidate scvf | ||
615 | // (will be optimized away for dim == dimWorld) | ||
616 | else | ||
617 | { | ||
618 |
4/4✓ Branch 0 taken 1850856 times.
✓ Branch 1 taken 1209128 times.
✓ Branch 2 taken 1850856 times.
✓ Branch 3 taken 1209128 times.
|
9045294 | for (unsigned outsideScvIdx = 0; outsideScvIdx < scvfNeighborVolVarIndices.size(); ++outsideScvIdx) |
619 | { | ||
620 |
13/14✓ Branch 0 taken 12276 times.
✓ Branch 1 taken 1320740 times.
✓ Branch 2 taken 12276 times.
✓ Branch 3 taken 12996 times.
✓ Branch 4 taken 1552666 times.
✓ Branch 5 taken 298190 times.
✓ Branch 6 taken 12276 times.
✓ Branch 7 taken 1320740 times.
✓ Branch 8 taken 12276 times.
✓ Branch 9 taken 12996 times.
✓ Branch 10 taken 1307744 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 335180 times.
✓ Branch 13 taken 972564 times.
|
13708960 | if (scvfNeighborVolVarIndices[outsideScvIdx] == gridGeometry().elementMapper().index(*element_)) |
621 | { | ||
622 |
2/4✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 580102 times.
✗ Branch 4 not taken.
|
3099204 | ScvfGridIndexStorage scvIndices; |
623 |
2/4✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 580102 times.
✗ Branch 5 not taken.
|
2066136 | scvIndices.resize(scvfNeighborVolVarIndices.size() + 1); |
624 | 1033068 | scvIndices[0] = eIdx; | |
625 |
5/10✓ Branch 0 taken 580102 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 580102 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 580102 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 580102 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 580102 times.
✗ Branch 9 not taken.
|
5165340 | std::copy(scvfNeighborVolVarIndices.begin(), scvfNeighborVolVarIndices.end(), scvIndices.begin()+1); |
626 |
1/2✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
|
1033068 | neighborScvfs_.emplace_back(intersection, |
627 | intersection.geometry(), | ||
628 |
1/2✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
|
1033068 | scvFaceIndices[scvfCounter], |
629 | scvIndices, | ||
630 |
1/4✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
1033068 | false); |
631 | |||
632 |
2/4✓ Branch 1 taken 580102 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 580102 times.
✗ Branch 5 not taken.
|
2066136 | neighborScvfIndices_.push_back(scvFaceIndices[scvfCounter]); |
633 | break; | ||
634 | } | ||
635 | } | ||
636 | } | ||
637 | |||
638 | // for surface and network grids mark that we handled this face | ||
639 | if (dim < dimWorld) | ||
640 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1789230 times.
✗ Branch 2 not taken.
|
3328720 | handledScvf[intersection.indexInInside()] = true; |
641 | 142280178 | scvfCounter++; | |
642 | } | ||
643 | } | ||
644 | |||
645 | // only increase counter for boundary intersections | ||
646 | // (exclude periodic boundaries according to dune grid interface, they have been handled in neighbor==true) | ||
647 |
3/4✓ Branch 0 taken 7665900 times.
✓ Branch 1 taken 484836 times.
✓ Branch 2 taken 10402 times.
✗ Branch 3 not taken.
|
8409648 | else if (intersection.boundary()) |
648 | { | ||
649 | if (dim < dimWorld) | ||
650 |
1/2✓ Branch 1 taken 32976 times.
✗ Branch 2 not taken.
|
107616 | handledScvf[intersection.indexInInside()] = true; |
651 | 8387760 | scvfCounter++; | |
652 | } | ||
653 | } | ||
654 | 47526414 | } | |
655 | |||
656 | //! Clear all local data | ||
657 | 24650429 | void clear() | |
658 | { | ||
659 |
2/2✓ Branch 0 taken 5301605 times.
✓ Branch 1 taken 17671481 times.
|
24650429 | scvfIndices_.clear(); |
660 |
2/2✓ Branch 0 taken 5264453 times.
✓ Branch 1 taken 16592744 times.
|
24650429 | scvfs_.clear(); |
661 | 24650429 | flippedScvfIndices_.clear(); | |
662 | |||
663 |
2/2✓ Branch 0 taken 794769 times.
✓ Branch 1 taken 22178317 times.
|
24650429 | neighborScvIndices_.clear(); |
664 |
2/2✓ Branch 0 taken 794769 times.
✓ Branch 1 taken 22178317 times.
|
24650429 | neighborScvfIndices_.clear(); |
665 |
2/2✓ Branch 0 taken 794769 times.
✓ Branch 1 taken 22178317 times.
|
24650429 | neighborScvs_.clear(); |
666 |
2/2✓ Branch 0 taken 794571 times.
✓ Branch 1 taken 21062626 times.
|
24650429 | neighborScvfs_.clear(); |
667 | 24650429 | flippedNeighborScvfIndices_.clear(); | |
668 | |||
669 | 24650429 | hasBoundaryScvf_ = false; | |
670 | 24650429 | } | |
671 | |||
672 | std::optional<Element> element_; //!< the element to which this fvgeometry is bound | ||
673 | const GridGeometry* gridGeometryPtr_; //!< the grid fvgeometry | ||
674 | |||
675 | // local storage after binding an element | ||
676 | std::array<GridIndexType, 1> scvIndices_; | ||
677 | std::array<SubControlVolume, 1> scvs_; | ||
678 | |||
679 | std::vector<GridIndexType> scvfIndices_; | ||
680 | std::vector<SubControlVolumeFace> scvfs_; | ||
681 | std::vector<std::vector<GridIndexType>> flippedScvfIndices_; | ||
682 | |||
683 | std::vector<GridIndexType> neighborScvIndices_; | ||
684 | std::vector<SubControlVolume> neighborScvs_; | ||
685 | |||
686 | std::vector<GridIndexType> neighborScvfIndices_; | ||
687 | std::vector<SubControlVolumeFace> neighborScvfs_; | ||
688 | std::vector<std::vector<GridIndexType>> flippedNeighborScvfIndices_; | ||
689 | |||
690 | bool hasBoundaryScvf_ = false; | ||
691 | }; | ||
692 | |||
693 | } // end namespace Dumux | ||
694 | |||
695 | #endif | ||
696 |