GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/flux/fluxvariablesbase.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 6 18 33.3%
Functions: 0 1813 0.0%
Branches: 10 14 71.4%

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 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 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 682178658 problemPtr_ = &problem;
50 682178658 elementPtr_ = &element;
51 682178658 scvFacePtr_ = &scvFace;
52 682178658 fvGeometryPtr_ = &fvGeometry;
53 682178658 elemVolVarsPtr_ = &elemVolVars;
54
10/14
✓ Branch 0 taken 484 times.
✓ Branch 1 taken 4782688 times.
✓ Branch 2 taken 23332 times.
✓ Branch 3 taken 340 times.
✓ Branch 4 taken 17555 times.
✓ Branch 5 taken 38840 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 309100 times.
✓ Branch 9 taken 47203 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3200 times.
✓ Branch 12 taken 126 times.
✗ Branch 13 not taken.
682178658 elemFluxVarsCachePtr_ = &elemFluxVarsCache;
55 }
56
57 const Problem& problem() const
58 { return *problemPtr_; }
59
60 const Element& element() const
61 { return *elementPtr_; }
62
63 const SubControlVolumeFace& scvFace() const
64 { return *scvFacePtr_; }
65
66 const FVElementGeometry& fvGeometry() const
67 { return *fvGeometryPtr_; }
68
69 const ElementVolumeVariables& elemVolVars() const
70 { return *elemVolVarsPtr_; }
71
72 const ElementFluxVariablesCache& elemFluxVarsCache() const
73 { 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