GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/multidomain/facet/cellcentered/mpfa/localsubcontrolentities.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 14 16 87.5%
Functions: 3 9 33.3%
Branches: 54 136 39.7%

Line Branch Exec Source
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 //
4 // SPDX-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 FacetCoupling
10 * \brief Classes for sub control entities of the
11 * mpfa-o method in the context of facet coupling
12 */
13 #ifndef DUMUX_MULTDOMAIN_FACET_CC_MPFA_O_LOCAL_SUBCONTROLENTITIES_HH
14 #define DUMUX_MULTDOMAIN_FACET_CC_MPFA_O_LOCAL_SUBCONTROLENTITIES_HH
15
16 #include <array>
17
18 #include <dune/common/fvector.hh>
19 #include <dumux/discretization/cellcentered/mpfa/omethod/localsubcontrolentities.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup FacetCoupling
25 * \brief Class for the interaction volume-local sub-control volume used
26 * in the mpfa-o scheme in the context of facet coupling.
27 *
28 * \tparam IvIndexSet The type used for index sets within interaction volumes
29 * \tparam dim The dimensionality of the grid
30 * \tparam dimWorld The dimension of the world the grid is embedded in
31 */
32 template< class IvIndexSet, class Scalar, int dim, int dimWorld>
33 class CCMpfaOFacetCouplingInteractionVolumeLocalScv
34 : public CCMpfaOInteractionVolumeLocalScv<IvIndexSet, Scalar, dim, dimWorld>
35 {
36 using ParentType = CCMpfaOInteractionVolumeLocalScv<IvIndexSet, Scalar, dim, dimWorld>;
37
38 public:
39 // export some types
40 using typename ParentType::LocalIndexType;
41
42 // export dimension
43 static constexpr int myDimension = dim;
44
45 //! The default constructor
46 CCMpfaOFacetCouplingInteractionVolumeLocalScv() = default;
47
48 /*!
49 * \brief The constructor
50 *
51 * \param helper Helper class for mpfa schemes
52 * \param fvGeometry The element finite volume geometry
53 * \param scv The grid sub-control volume
54 * \param localIndex The iv-local index of this scvIdx
55 * \param indexSet The interaction volume index set
56 * \param scvfGridToLocalIndexMap maps to grid scvf indices the iv-local scvf index
57 */
58 template<class MpfaHelper, class FVElementGeometry, class SubControlVolume, class IndexMap>
59 21455579 CCMpfaOFacetCouplingInteractionVolumeLocalScv(const MpfaHelper& helper,
60 const FVElementGeometry& fvGeometry,
61 const SubControlVolume& scv,
62 const LocalIndexType localIndex,
63 const IvIndexSet& indexSet,
64 const IndexMap& scvfGridToLocalIndexMap)
65 21455579 : ParentType(helper, fvGeometry, scv, localIndex, indexSet)
66 {
67 // set up local scvf indices
68 21455579 const auto& nis = indexSet.nodalIndexSet();
69
2/2
✓ Branch 0 taken 42911158 times.
✓ Branch 1 taken 21455579 times.
64366737 for (unsigned int dir = 0; dir < myDimension; ++dir)
70 42911158 localScvfIndices_[dir] = scvfGridToLocalIndexMap.at(nis.gridScvfIndex(this->localDofIndex(), dir));
71 21455579 }
72
73 //! iv-local index of the coordir's scvf in this scv
74 LocalIndexType localScvfIndex(unsigned int coordDir) const
75 {
76 assert(coordDir < myDimension);
77
36/40
✓ Branch 0 taken 23106475 times.
✓ Branch 1 taken 9548531 times.
✓ Branch 2 taken 23106475 times.
✓ Branch 3 taken 9548531 times.
✓ Branch 4 taken 16141491 times.
✓ Branch 5 taken 18164347 times.
✓ Branch 6 taken 16141491 times.
✓ Branch 7 taken 18164347 times.
✓ Branch 8 taken 13446124 times.
✓ Branch 9 taken 15149660 times.
✓ Branch 10 taken 13446124 times.
✓ Branch 11 taken 15149660 times.
✓ Branch 12 taken 17907140 times.
✓ Branch 13 taken 7256840 times.
✓ Branch 14 taken 17907140 times.
✓ Branch 15 taken 7256840 times.
✓ Branch 16 taken 11162994 times.
✓ Branch 17 taken 11162994 times.
✓ Branch 18 taken 11162994 times.
✓ Branch 19 taken 11162994 times.
✓ Branch 20 taken 9547630 times.
✓ Branch 21 taken 12177974 times.
✓ Branch 22 taken 9547630 times.
✓ Branch 23 taken 12177974 times.
✓ Branch 24 taken 7831856 times.
✓ Branch 25 taken 31320 times.
✓ Branch 26 taken 7831856 times.
✓ Branch 27 taken 31320 times.
✓ Branch 28 taken 4606476 times.
✓ Branch 29 taken 4606476 times.
✓ Branch 30 taken 4606476 times.
✓ Branch 31 taken 4606476 times.
✓ Branch 32 taken 3931588 times.
✓ Branch 33 taken 5035444 times.
✓ Branch 34 taken 3931588 times.
✓ Branch 35 taken 5035444 times.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
381630720 return localScvfIndices_[coordDir];
78 }
79
80 private:
81 std::array<LocalIndexType, dim> localScvfIndices_;
82 };
83
84 /*!
85 * \ingroup FacetCoupling
86 * \brief Class for the interaction volume-local sub-control volume face
87 * used in the mpfa-o scheme in the context of facet coupling.
88 *
89 * \tparam IvIndexSet The type used for index sets within interaction volumes
90 */
91 template< class IvIndexSet >
92
2/34
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✓ Branch 33 taken 35680 times.
✓ Branch 34 taken 1392000 times.
1463360 struct CCMpfaOFacetCouplingInteractionVolumeLocalScvf
93 : public CCMpfaOInteractionVolumeLocalScvf< IvIndexSet >
94 {
95 using ParentType = CCMpfaOInteractionVolumeLocalScvf< IvIndexSet >;
96 using ScvfNeighborLocalIndexSet = typename IvIndexSet::ScvfNeighborLocalIndexSet;
97
98 public:
99 // pull up index types
100 using typename ParentType::LocalIndexType;
101 using typename ParentType::GridIndexType;
102
103 //! pull up parent's constructors
104 62231805 using ParentType::ParentType;
105
106 /*!
107 * \brief The constructor for interior boundary faces.
108 *
109 * \param scvf The grid sub-control volume face
110 * \param localScvIndices The iv-local neighboring scv indices
111 * \param localDofIdx This scvf's interaction volume-local dof index
112 * \param isDirichlet Specifies if this scv is on a Dirichlet boundary
113 * \param coupledFacetLocalDof The local index of the coupled facet element
114 * in the set of cell&Dirichlet values.
115 */
116 template< class SubControlVolumeFace >
117 1746356 CCMpfaOFacetCouplingInteractionVolumeLocalScvf(const SubControlVolumeFace& scvf,
118 const ScvfNeighborLocalIndexSet& localScvIndices,
119 const LocalIndexType localDofIdx,
120 const bool isDirichlet,
121 const LocalIndexType coupledFacetLocalDof)
122 1746356 : ParentType(scvf, neighborLocalScvIndices_, localDofIdx, isDirichlet)
123 , isInteriorBoundary_(true)
124 , coupledFacetLocalDofIndex_(coupledFacetLocalDof)
125
0/32
✗ 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 33 not taken.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
3492712 , neighborLocalScvIndices_(localScvIndices)
126 {}
127
128 //! Returns the iv-local dof index of the coupled facet element
129 LocalIndexType coupledFacetLocalDofIndex() const
130
6/14
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1863196 times.
✓ Branch 6 taken 1863196 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1571292 times.
✓ Branch 11 taken 1571292 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1065792 times.
✓ Branch 16 taken 1065792 times.
✗ Branch 17 not taken.
4500280 { assert(isInteriorBoundary_); return coupledFacetLocalDofIndex_; }
131
132 //! Returns the local indices of the scvs neighboring this scvf
133 const ScvfNeighborLocalIndexSet& neighboringLocalScvIndices() const
134
8/14
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 1870000 times.
✓ Branch 3 taken 15512623 times.
✓ Branch 4 taken 49896 times.
✓ Branch 5 taken 785484 times.
✓ Branch 6 taken 1571292 times.
✓ Branch 7 taken 11920722 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1065792 times.
✓ Branch 11 taken 7829472 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
40605281 { return isOnInteriorBoundary() ? neighborLocalScvIndices_ : ParentType::neighboringLocalScvIndices(); }
135
136 //! Returns true if this face is on an interior boundary
137 bool isOnInteriorBoundary() const { return isInteriorBoundary_; }
138
139 private:
140 bool isInteriorBoundary_{false};
141 LocalIndexType coupledFacetLocalDofIndex_{0};
142 ScvfNeighborLocalIndexSet neighborLocalScvIndices_;
143 };
144
145 } // end namespace Dumux
146
147 #endif
148