GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 10 90.0%
Functions: 57 59 96.6%
Branches: 12 60 20.0%

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 FreeflowModels
10 * \brief Definition of the spatial parameters for the freeflow problems.
11 */
12 #ifndef DUMUX_FREEFLOW_SPATIAL_PARAMS_HH
13 #define DUMUX_FREEFLOW_SPATIAL_PARAMS_HH
14
15 #include <dumux/common/fvspatialparams.hh>
16
17 namespace Dumux {
18
19 #ifndef DOXYGEN
20 namespace Detail::BrinkmanSpatialParams {
21
22 template<class GlobalPosition>
23 struct hasInversePermeabilityAtPos
24 {
25 template<class SpatialParams>
26 auto operator()(const SpatialParams& a)
27 -> decltype(a.inversePermeabilityAtPos(std::declval<GlobalPosition>()))
28 {}
29 };
30
31 template<class GlobalPosition>
32 struct hasBrinkmanEpsilonAtPos
33 {
34 template<class SpatialParams>
35 auto operator()(const SpatialParams& a)
36 -> decltype(a.brinkmanEpsilonAtPos(std::declval<GlobalPosition>()))
37 {}
38 };
39
40 } // end namespace Detail
41 #endif
42
43 /*!
44 * \ingroup FreeflowModels
45 * \brief Definition of the spatial parameters for the freeflow problems.
46 */
47 template<class GridGeometry, class Scalar, class Implementation>
48
3/16
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 6 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
457 class FreeFlowSpatialParams
49 : public FVSpatialParams<GridGeometry, Scalar, Implementation>
50 {
51 using ParentType = FVSpatialParams<GridGeometry, Scalar, Implementation>;
52
53 public:
54 376 FreeFlowSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
55
2/6
✓ Branch 2 taken 246 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 246 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
376 : ParentType(gridGeometry)
56 376 {}
57 };
58
59 /*!
60 * \ingroup FreeflowModels
61 * \brief Definition of the spatial parameters for the darcy-brinkman problems.
62 */
63 template<class GridGeometry, class Scalar, class Implementation>
64
2/16
✗ Branch 0 not taken.
✗ 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 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
4 class BrinkmanSpatialParams
65 : public FreeFlowSpatialParams<GridGeometry, Scalar, Implementation>
66 {
67 using ParentType = FreeFlowSpatialParams<GridGeometry, Scalar, Implementation>;
68 using GridView = typename GridGeometry::GridView;
69 using Element = typename GridView::template Codim<0>::Entity;
70 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
71 using FVElementGeometry = typename GridGeometry::LocalView;
72 using SubControlVolume = typename GridGeometry::SubControlVolume;
73
74 public:
75 8 BrinkmanSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
76
2/6
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
8 : ParentType(gridGeometry)
77 8 {}
78
79 decltype(auto) inversePermeability(const Element& element,
80 const FVElementGeometry& fvGeometry,
81 const SubControlVolume& scv) const
82 {
83 static_assert(decltype(isValid(Detail::BrinkmanSpatialParams::hasInversePermeabilityAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
84 " Your spatial params class has to either implement\n\n"
85 " const PermeabilityType& inversePermeabilityAtPos(const GlobalPosition& globalPos) const\n\n"
86 " or overload this function\n\n"
87 " const PermeabilityType& inversePermeability(const Element& element,\n"
88 " const FVElementGeometry& fvGeometry,\n"
89 " const SubControlVolume& scv) const\n"
90 " This can be done simply with the invert() function of the DimMatrix type (e.g. permeability.invert()). \n\n");
91 return this->asImp_().inversePermeabilityAtPos(scv.dofPosition());
92 }
93
94 Scalar brinkmanEpsilon(const Element& element,
95 const FVElementGeometry& fvGeometry,
96 const SubControlVolume& scv) const
97 {
98 static_assert(decltype(isValid(Detail::BrinkmanSpatialParams::hasBrinkmanEpsilonAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
99 " Your spatial params class has to either implement\n\n"
100 " const Scalar& brinkmanEpsilonAtPos(const GlobalPosition& globalPos) const\n\n"
101 " or overload this function\n\n"
102 " const Scalar& brinkmanEpsilon(const Element& element,\n"
103 " const FVElementGeometry& fvGeometry,\n"
104 " const SubControlVolume& scv) const\n\n");
105 return this->asImp_().brinkmanEpsilonAtPos(scv.dofPosition());
106 }
107
108 };
109
110 /*!
111 * \ingroup FreeflowModels
112 * \brief Definition of the spatial parameters for the freeflow problems.
113 */
114 template<class GridGeometry, class Scalar>
115
3/12
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 100 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 57 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 57 times.
✗ Branch 11 not taken.
214 class FreeFlowDefaultSpatialParams
116 : public FreeFlowSpatialParams<GridGeometry, Scalar, FreeFlowDefaultSpatialParams<GridGeometry, Scalar>>
117 {
118 using ParentType = FreeFlowSpatialParams<GridGeometry, Scalar, FreeFlowDefaultSpatialParams<GridGeometry, Scalar>>;
119 public:
120 using ParentType::ParentType;
121 };
122
123 } // end namespace Dumux
124
125 #endif
126