GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/flux/fluxvariablesbase.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 0 0 -%
Branches: 69 78 88.5%

Line Branch Exec Source
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 //
4 // SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup Flux
10 * \brief Base class for the flux variables living on a sub control volume face
11 */
12 #ifndef DUMUX_DISCRETIZATION_FLUXVARIABLESBASE_HH
13 #define DUMUX_DISCRETIZATION_FLUXVARIABLESBASE_HH
14
15 #include <vector>
16
17 namespace Dumux {
18
19 /*!
20 * \ingroup Flux
21 * \brief Base class for the flux variables living on a sub control volume face
22 *
23 * \tparam Problem the problem type to solve (for boundary conditions)
24 * \tparam FVElementGeometry the element geometry type
25 * \tparam ElementVolumeVariables the element volume variables type
26 * \tparam ElementFluxVariablesCache the element flux variables cache type
27 */
28 template<class Problem,
29 class FVElementGeometry,
30 class ElementVolumeVariables,
31 class ElementFluxVariablesCache>
32 class FluxVariablesBase
33 {
34 using GridView = typename FVElementGeometry::GridGeometry::GridView;
35 using Element = typename GridView::template Codim<0>::Entity;
36 using Stencil = std::vector<std::size_t>;
37 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
38
39 public:
40
41 //! Initialize the flux variables storing some temporary pointers
42 1376959516 void init(const Problem& problem,
43 const Element& element,
44 const FVElementGeometry& fvGeometry,
45 const ElementVolumeVariables& elemVolVars,
46 const SubControlVolumeFace &scvFace,
47 const ElementFluxVariablesCache& elemFluxVarsCache)
48 {
49 1376959516 problemPtr_ = &problem;
50 1376959516 elementPtr_ = &element;
51 1376959516 scvFacePtr_ = &scvFace;
52 1376959516 fvGeometryPtr_ = &fvGeometry;
53 1376959516 elemVolVarsPtr_ = &elemVolVars;
54
10/14
✓ Branch 1 taken 4828724 times.
✓ Branch 2 taken 80072 times.
✓ Branch 4 taken 17699 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 31952018 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 126 times.
✗ Branch 13 not taken.
✓ Branch 8 taken 309100 times.
✓ Branch 3 taken 340 times.
✓ Branch 6 taken 43859 times.
✗ Branch 7 not taken.
✓ Branch 0 taken 484 times.
✓ Branch 11 taken 3200 times.
1376959516 elemFluxVarsCachePtr_ = &elemFluxVarsCache;
55 }
56
57 3779676041 const Problem& problem() const
58
6/6
✓ Branch 0 taken 1801632 times.
✓ Branch 1 taken 45145880 times.
✓ Branch 2 taken 64392 times.
✓ Branch 3 taken 781548 times.
✓ Branch 4 taken 8583064 times.
✓ Branch 5 taken 29579601 times.
2714877374 { return *problemPtr_; }
59
60 2880676194 const Element& element() const
61
11/12
✓ Branch 0 taken 1801632 times.
✓ Branch 1 taken 46002128 times.
✓ Branch 3 taken 9593828 times.
✓ Branch 4 taken 8956944 times.
✓ Branch 5 taken 58056 times.
✓ Branch 6 taken 5170956 times.
✓ Branch 8 taken 37055296 times.
✓ Branch 9 taken 192000 times.
✓ Branch 12 taken 600 times.
✓ Branch 13 taken 16593 times.
✗ Branch 2 not taken.
✓ Branch 7 taken 1314624 times.
3289510502 { return *elementPtr_; }
62
63 7192898739 const SubControlVolumeFace& scvFace() const
64
11/11
✓ Branch 0 taken 16459844 times.
✓ Branch 1 taken 13070191 times.
✓ Branch 2 taken 48219492 times.
✓ Branch 3 taken 269424752 times.
✓ Branch 4 taken 13282386 times.
✓ Branch 5 taken 36726 times.
✓ Branch 9 taken 3176 times.
✓ Branch 10 taken 294 times.
✓ Branch 7 taken 192 times.
✓ Branch 8 taken 12 times.
✓ Branch 6 taken 180 times.
4782509076 { return *scvFacePtr_; }
65
66 2745113183 const FVElementGeometry& fvGeometry() const
67
8/8
✓ Branch 4 taken 400000 times.
✓ Branch 5 taken 2923707 times.
✓ Branch 0 taken 1100016 times.
✓ Branch 1 taken 12031200 times.
✓ Branch 2 taken 61056 times.
✓ Branch 3 taken 231240 times.
✓ Branch 6 taken 745872 times.
✓ Branch 7 taken 8485528 times.
3383920632 { return *fvGeometryPtr_; }
68
69 6220652030 const ElementVolumeVariables& elemVolVars() const
70
16/16
✓ Branch 0 taken 16078424 times.
✓ Branch 1 taken 13895639 times.
✓ Branch 3 taken 305817336 times.
✓ Branch 4 taken 23144472 times.
✓ Branch 6 taken 10270086 times.
✓ Branch 7 taken 776414 times.
✓ Branch 8 taken 8479744 times.
✓ Branch 9 taken 537092 times.
✓ Branch 11 taken 5784 times.
✓ Branch 12 taken 4697160 times.
✓ Branch 15 taken 3176 times.
✓ Branch 16 taken 294 times.
✓ Branch 2 taken 454476 times.
✓ Branch 5 taken 543264 times.
✓ Branch 10 taken 400 times.
✓ Branch 13 taken 24 times.
6620030631 { return *elemVolVarsPtr_; }
71
72 3033142152 const ElementFluxVariablesCache& elemFluxVarsCache() const
73
7/11
✗ Branch 4 not taken.
✓ Branch 5 taken 31707 times.
✓ Branch 6 taken 192000 times.
✓ Branch 7 taken 345092 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 4696800 times.
✓ Branch 0 taken 11500 times.
✓ Branch 1 taken 861248 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 18116400 times.
✗ Branch 11 not taken.
3123819252 { return *elemFluxVarsCachePtr_; }
74
75 private:
76 const Problem* problemPtr_; //!< Pointer to the problem
77 const Element* elementPtr_; //!< Pointer to the element at hand
78 const FVElementGeometry* fvGeometryPtr_; //!< Pointer to the current FVElementGeometry
79 const SubControlVolumeFace* scvFacePtr_; //!< Pointer to the sub control volume face for which the flux variables are created
80 const ElementVolumeVariables* elemVolVarsPtr_; //!< Pointer to the current element volume variables
81 const ElementFluxVariablesCache* elemFluxVarsCachePtr_; //!< Pointer to the current element flux variables cache
82 };
83
84 } // end namespace Dumux
85
86 #endif
87