GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/flux/fluxvariablesbase.hh
Date: 2025-05-03 19:19:02
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 0 0 -%
Branches: 69 80 86.2%

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 1354873664 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 1354873664 problemPtr_ = &problem;
50 1354873664 elementPtr_ = &element;
51 1354873664 scvFacePtr_ = &scvFace;
52 1354873664 fvGeometryPtr_ = &fvGeometry;
53 1354873664 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.
1354873664 elemFluxVarsCachePtr_ = &elemFluxVarsCache;
55 }
56
57 3735504337 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.
2670705670 { return *problemPtr_; }
59
60 2836504490 const Element& element() const
61
10/13
✓ Branch 0 taken 1801632 times.
✓ Branch 1 taken 46002128 times.
✓ Branch 3 taken 9349484 times.
✓ Branch 4 taken 859500 times.
✓ Branch 6 taken 4696800 times.
✓ Branch 7 taken 10188624 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 192000 times.
✓ Branch 12 taken 600 times.
✓ Branch 13 taken 16593 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✓ Branch 8 taken 37055296 times.
3245338798 { return *elementPtr_; }
62
63 7104555331 const SubControlVolumeFace& scvFace() const
64
11/11
✓ Branch 0 taken 16459844 times.
✓ Branch 1 taken 12894511 times.
✓ Branch 2 taken 48208068 times.
✓ Branch 3 taken 269420432 times.
✓ Branch 4 taken 13461810 times.
✓ Branch 5 taken 48726 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.
4694165668 { return *scvFacePtr_; }
65
66 2700941479 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.
3339748928 { return *fvGeometryPtr_; }
68
69 6132308622 const ElementVolumeVariables& elemVolVars() const
70
16/16
✓ Branch 0 taken 16078424 times.
✓ Branch 1 taken 13719959 times.
✓ Branch 3 taken 305817336 times.
✓ Branch 4 taken 14148072 times.
✓ Branch 6 taken 10571910 times.
✓ Branch 7 taken 9650414 times.
✓ Branch 8 taken 8479744 times.
✓ Branch 9 taken 345092 times.
✓ Branch 11 taken 197784 times.
✓ Branch 12 taken 4697160 times.
✓ Branch 15 taken 3176 times.
✓ Branch 16 taken 294 times.
✓ Branch 2 taken 443052 times.
✓ Branch 5 taken 550944 times.
✓ Branch 10 taken 400 times.
✓ Branch 13 taken 24 times.
6531687223 { return *elemVolVarsPtr_; }
71
72 2988970448 const ElementFluxVariablesCache& elemFluxVarsCache() const
73
8/12
✓ Branch 4 taken 9176400 times.
✓ Branch 5 taken 31707 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 345092 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 4696800 times.
✗ Branch 0 not taken.
✓ Branch 1 taken 867748 times.
✓ Branch 2 taken 5000 times.
✓ Branch 3 taken 8940000 times.
✗ Branch 11 not taken.
✓ Branch 8 taken 192000 times.
3079647548 { 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