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 PoreNetworkDiscretization | ||
10 | * \brief Base class for a sub control volume face | ||
11 | */ | ||
12 | #ifndef DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH | ||
13 | #define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH | ||
14 | |||
15 | #include <dune/geometry/axisalignedcubegeometry.hh> | ||
16 | #include <dumux/common/indextraits.hh> | ||
17 | #include <dumux/discretization/subcontrolvolumefacebase.hh> | ||
18 | |||
19 | namespace Dumux::PoreNetwork { | ||
20 | |||
21 | /*! | ||
22 | * \ingroup PoreNetworkDiscretization | ||
23 | * \brief Default traits class | ||
24 | * \tparam GV the type of the grid view | ||
25 | */ | ||
26 | template<class GridView> | ||
27 | struct PNMDefaultScvfGeometryTraits | ||
28 | { | ||
29 | using Grid = typename GridView::Grid; | ||
30 | static constexpr int dim = Grid::dimension; | ||
31 | static constexpr int dimWorld = Grid::dimensionworld; | ||
32 | |||
33 | using GridIndexType = typename IndexTraits<GridView>::GridIndex; | ||
34 | using LocalIndexType = typename IndexTraits<GridView>::LocalIndex; | ||
35 | |||
36 | using Scalar = typename Grid::ctype; | ||
37 | using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; | ||
38 | using CornerStorage = std::array<Dune::FieldVector<Scalar, dimWorld>, 1>; | ||
39 | using Geometry = Dune::AxisAlignedCubeGeometry<Scalar, dim-1, dimWorld>; | ||
40 | |||
41 | }; | ||
42 | |||
43 | /*! | ||
44 | * \ingroup PoreNetworkDiscretization | ||
45 | * \brief Class for a sub control volume face for porenetworks | ||
46 | * \tparam GV the type of the grid view | ||
47 | * \tparam T the scvf geometry traits | ||
48 | */ | ||
49 | template<class GV, | ||
50 | class T = PNMDefaultScvfGeometryTraits<GV> > | ||
51 | class PNMSubControlVolumeFace | ||
52 | : public Dumux::SubControlVolumeFaceBase<PNMSubControlVolumeFace<GV, T>, T> | ||
53 | { | ||
54 | using ThisType = PNMSubControlVolumeFace<GV, T>; | ||
55 | using ParentType = Dumux::SubControlVolumeFaceBase<ThisType, T>; | ||
56 | using GridIndexType = typename T::GridIndexType; | ||
57 | using LocalIndexType = typename T::LocalIndexType; | ||
58 | using Scalar = typename T::Scalar; | ||
59 | |||
60 | public: | ||
61 | //! export the type used for global coordinates | ||
62 | using GlobalPosition = typename T::GlobalPosition; | ||
63 | //! state the traits public and thus export all types | ||
64 | using Traits = T; | ||
65 | |||
66 | //! The default constructor | ||
67 |
52/108✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 7 taken 97583 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 222624 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1007813 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 910253 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 785212 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 308655 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 308632 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 308634 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 2 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 2 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 4028 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 4028 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 4028 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 8736 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 8736 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 8736 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 1 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 2 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 2 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 2 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 1 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 1 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 1 times.
✗ Branch 89 not taken.
✓ Branch 97 taken 338742 times.
✗ Branch 98 not taken.
✓ Branch 100 taken 338742 times.
✗ Branch 101 not taken.
✓ Branch 103 taken 338742 times.
✗ Branch 104 not taken.
✓ Branch 106 taken 338742 times.
✗ Branch 107 not taken.
✓ Branch 109 taken 338742 times.
✗ Branch 110 not taken.
✓ Branch 112 taken 338742 times.
✗ Branch 113 not taken.
✓ Branch 115 taken 182830 times.
✗ Branch 116 not taken.
✓ Branch 118 taken 182830 times.
✗ Branch 119 not taken.
✓ Branch 121 taken 182830 times.
✗ Branch 122 not taken.
✓ Branch 124 taken 182830 times.
✗ Branch 125 not taken.
✓ Branch 127 taken 182830 times.
✗ Branch 128 not taken.
✓ Branch 130 taken 182830 times.
✗ Branch 131 not taken.
✓ Branch 139 taken 2 times.
✗ Branch 140 not taken.
✓ Branch 142 taken 2 times.
✗ Branch 143 not taken.
✓ Branch 145 taken 2 times.
✗ Branch 146 not taken.
✓ Branch 148 taken 2 times.
✗ Branch 149 not taken.
✓ Branch 151 taken 2 times.
✗ Branch 152 not taken.
✓ Branch 154 taken 2 times.
✗ Branch 155 not taken.
✓ Branch 157 taken 1 times.
✗ Branch 158 not taken.
✓ Branch 160 taken 1 times.
✗ Branch 161 not taken.
✓ Branch 163 taken 1 times.
✗ Branch 164 not taken.
✓ Branch 166 taken 1 times.
✗ Branch 167 not taken.
✓ Branch 169 taken 1 times.
✗ Branch 170 not taken.
✓ Branch 172 taken 1 times.
✗ Branch 173 not taken.
|
8417442 | PNMSubControlVolumeFace() = default; |
68 | |||
69 | //! Constructor for inner scvfs | ||
70 | 3953329 | PNMSubControlVolumeFace(const GlobalPosition& center, | |
71 | const GlobalPosition& unitOuterNormal, | ||
72 | const Scalar& area, | ||
73 | GridIndexType scvfIndex, | ||
74 | std::array<LocalIndexType, 2>&& scvIndices) | ||
75 | : center_(center), | ||
76 | unitOuterNormal_(unitOuterNormal), | ||
77 | area_(area), | ||
78 | scvfIndex_(scvfIndex), | ||
79 | 3953329 | scvIndices_(std::move(scvIndices)) | |
80 | {} | ||
81 | |||
82 | //! The center of the sub control volume face | ||
83 | const GlobalPosition& center() const | ||
84 | 1872 | { return center_; } | |
85 | |||
86 | //! The integration point for flux evaluations in global coordinates | ||
87 | const GlobalPosition& ipGlobal() const | ||
88 | 1240211 | { return center_; } | |
89 | |||
90 | //! The area of the sub control volume face | ||
91 | ✗ | Scalar area() const | |
92 | ✗ | { return area_; } | |
93 | |||
94 | //! We assume to always have a pore body and not a pore throat at the boundary | ||
95 | ✗ | bool boundary() const | |
96 | ✗ | { return false; } | |
97 | |||
98 | //! The unit outer normal of the sub control volume face | ||
99 | const GlobalPosition& unitOuterNormal() const | ||
100 | 1872 | { return unitOuterNormal_; } | |
101 | |||
102 | //! Index of the inside sub control volume for spatial param evaluation | ||
103 | LocalIndexType insideScvIdx() const | ||
104 |
52/56✓ Branch 0 taken 31843 times.
✓ Branch 1 taken 22354 times.
✓ Branch 2 taken 31843 times.
✓ Branch 3 taken 22354 times.
✓ Branch 4 taken 1216807 times.
✓ Branch 5 taken 862243 times.
✓ Branch 6 taken 1216807 times.
✓ Branch 7 taken 862243 times.
✓ Branch 8 taken 1775213 times.
✓ Branch 9 taken 2175131 times.
✓ Branch 10 taken 1775213 times.
✓ Branch 11 taken 2175131 times.
✓ Branch 12 taken 369525 times.
✓ Branch 13 taken 950185 times.
✓ Branch 14 taken 369525 times.
✓ Branch 15 taken 950185 times.
✓ Branch 16 taken 2532950 times.
✓ Branch 17 taken 777681 times.
✓ Branch 18 taken 2532950 times.
✓ Branch 19 taken 777681 times.
✓ Branch 20 taken 4910 times.
✓ Branch 21 taken 1128937 times.
✓ Branch 22 taken 4910 times.
✓ Branch 23 taken 1128937 times.
✓ Branch 24 taken 1092264 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 1092264 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 4385 times.
✓ Branch 29 taken 10999 times.
✓ Branch 30 taken 4385 times.
✓ Branch 31 taken 10999 times.
✓ Branch 32 taken 396 times.
✓ Branch 33 taken 2524594 times.
✓ Branch 34 taken 396 times.
✓ Branch 35 taken 2524594 times.
✓ Branch 36 taken 22032 times.
✓ Branch 37 taken 2539784 times.
✓ Branch 38 taken 22032 times.
✓ Branch 39 taken 2539784 times.
✓ Branch 40 taken 6681 times.
✓ Branch 41 taken 1129442 times.
✓ Branch 42 taken 6681 times.
✓ Branch 43 taken 1129442 times.
✓ Branch 44 taken 10470328 times.
✓ Branch 45 taken 21478346 times.
✓ Branch 46 taken 10470328 times.
✓ Branch 47 taken 21478346 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 32058562 times.
✗ Branch 50 not taken.
✓ Branch 51 taken 32058562 times.
✓ Branch 52 taken 18206 times.
✓ Branch 53 taken 25653 times.
✓ Branch 54 taken 18206 times.
✓ Branch 55 taken 25653 times.
|
171131706 | { return scvIndices_[0]; } |
105 | |||
106 | //! Index of the outside sub control volume for spatial param evaluation | ||
107 | // This results in undefined behaviour if boundary is true | ||
108 | LocalIndexType outsideScvIdx() const | ||
109 |
44/48✓ Branch 0 taken 31843 times.
✓ Branch 1 taken 22354 times.
✓ Branch 2 taken 31843 times.
✓ Branch 3 taken 22354 times.
✓ Branch 4 taken 1216807 times.
✓ Branch 5 taken 862243 times.
✓ Branch 6 taken 1216807 times.
✓ Branch 7 taken 862243 times.
✓ Branch 8 taken 1775213 times.
✓ Branch 9 taken 2175131 times.
✓ Branch 10 taken 1775213 times.
✓ Branch 11 taken 2175131 times.
✓ Branch 12 taken 369525 times.
✓ Branch 13 taken 950185 times.
✓ Branch 14 taken 369525 times.
✓ Branch 15 taken 950185 times.
✓ Branch 16 taken 2532950 times.
✓ Branch 17 taken 780101 times.
✓ Branch 18 taken 2532950 times.
✓ Branch 19 taken 780101 times.
✓ Branch 20 taken 4910 times.
✓ Branch 21 taken 1126517 times.
✓ Branch 22 taken 4910 times.
✓ Branch 23 taken 1126517 times.
✓ Branch 24 taken 1092264 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 1092264 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 4385 times.
✓ Branch 29 taken 10999 times.
✓ Branch 30 taken 4385 times.
✓ Branch 31 taken 10999 times.
✓ Branch 32 taken 396 times.
✓ Branch 33 taken 2524594 times.
✓ Branch 34 taken 396 times.
✓ Branch 35 taken 2524594 times.
✓ Branch 36 taken 6681 times.
✓ Branch 37 taken 2560154 times.
✓ Branch 38 taken 6681 times.
✓ Branch 39 taken 2560154 times.
✓ Branch 40 taken 10470328 times.
✓ Branch 41 taken 22570610 times.
✓ Branch 42 taken 10470328 times.
✓ Branch 43 taken 22570610 times.
✗ Branch 44 not taken.
✓ Branch 45 taken 32058562 times.
✗ Branch 46 not taken.
✓ Branch 47 taken 32058562 times.
|
170966300 | { return scvIndices_[1]; } |
110 | |||
111 | //! The local index of this sub control volume face | ||
112 | ✗ | GridIndexType index() const | |
113 | ✗ | { return scvfIndex_; } | |
114 | |||
115 | private: | ||
116 | GlobalPosition center_; | ||
117 | GlobalPosition unitOuterNormal_; | ||
118 | Scalar area_; | ||
119 | GridIndexType scvfIndex_; | ||
120 | std::array<LocalIndexType, 2> scvIndices_; | ||
121 | }; | ||
122 | |||
123 | } // end namespace Dumux::PoreNetwork | ||
124 | |||
125 | #endif | ||
126 |