GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/1p/compressible/stationary/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 8 16 50.0%
Functions: 3 9 33.3%
Branches: 9 58 15.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-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 OnePTests
10 * \brief The spatial params the incompressible test
11 */
12
13 #ifndef DUMUX_COMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
14 #define DUMUX_COMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
15
16 #include <dumux/porousmediumflow/properties.hh>
17 #include <dumux/porousmediumflow/fvspatialparams1p.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup OnePTests
23 * \brief The spatial parameters class for the test problem using the
24 * compressible 1p model
25 */
26 template<class GridGeometry, class Scalar>
27
1/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
3 class OnePTestSpatialParams
28 : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar,
29 OnePTestSpatialParams<GridGeometry, Scalar>>
30 {
31 using GridView = typename GridGeometry::GridView;
32 using Element = typename GridView::template Codim<0>::Entity;
33 using FVElementGeometry = typename GridGeometry::LocalView;
34 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
35
36 using ThisType = OnePTestSpatialParams<GridGeometry, Scalar>;
37 using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
38
39 static constexpr int dimWorld = GridView::dimensionworld;
40 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
41
42 public:
43 using PermeabilityType = Scalar;
44 3 OnePTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
45
4/12
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
9 : ParentType(gridGeometry)
46 {
47
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 permeability_ = getParam<Scalar>("SpatialParams.Permeability");
48
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens");
49
50
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
51
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
52 3 }
53
54 /*!
55 * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$.
56 *
57 * \param element The element
58 * \param scv The sub-control volume
59 * \param elemSol The element solution vector
60 * \return The intrinsic permeability
61 */
62 template<class ElementSolution>
63 PermeabilityType permeability(const Element& element,
64 const SubControlVolume& scv,
65 const ElementSolution& elemSol) const
66 {
67 if (isInLens_(scv.dofPosition()))
68 return permeabilityLens_;
69 else
70 return permeability_;
71 }
72
73 /*!
74 * \brief Defines the porosity \f$\mathrm{[-]}\f$.
75 *
76 * \param globalPos The global position
77 */
78 Scalar porosityAtPos(const GlobalPosition& globalPos) const
79 { return 0.4; }
80
81 private:
82 bool isInLens_(const GlobalPosition &globalPos) const
83 {
84 for (int i = 0; i < dimWorld; ++i) {
85 if (globalPos[i] < lensLowerLeft_[i] + eps_ || globalPos[i] > lensUpperRight_[i] - eps_)
86 return false;
87 }
88 return true;
89 }
90
91 GlobalPosition lensLowerLeft_;
92 GlobalPosition lensUpperRight_;
93
94 Scalar permeability_, permeabilityLens_;
95
96 static constexpr Scalar eps_ = 1.5e-7;
97 };
98
99 } // end namespace Dumux
100
101 #endif
102