GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/porousmediumflow/fvspatialparams1pconstant.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 14 14 100.0%
Functions: 6 6 100.0%
Branches: 7 14 50.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-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 PorousmediumflowModels
10 * \ingroup SpatialParameters
11 * \brief A spatial params implementation for 1p problem with constant properties
12 */
13 #ifndef DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_ONEP_CONSTANT_HH
14 #define DUMUX_POROUS_MEDIUM_FLOW_FV_SPATIAL_PARAMS_ONEP_CONSTANT_HH
15
16 #include <dumux/common/parameters.hh>
17 #include "fvspatialparams1p.hh"
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup PorousmediumflowModels
23 * \ingroup SpatialParameters
24 * \brief A spatial params implementation for 1p problem with constant properties
25 */
26 template<class GridGeometry, class Scalar>
27
1/2
✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
7 class FVPorousMediumFlowSpatialParamsOnePConstant
28 : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, FVPorousMediumFlowSpatialParamsOnePConstant<GridGeometry, Scalar>>
29 {
30 using ThisType = FVPorousMediumFlowSpatialParamsOnePConstant<GridGeometry, Scalar>;
31 using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
32 using GlobalPosition = typename GridGeometry::GridView::template Codim<0>::Geometry::GlobalCoordinate;
33
34 public:
35 using PermeabilityType = Scalar;
36
37 7 FVPorousMediumFlowSpatialParamsOnePConstant(std::shared_ptr<const GridGeometry> gridGeometry)
38 : ParentType(gridGeometry)
39 14 , porosity_(getParam<Scalar>("SpatialParams.Porosity"))
40
1/2
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
7 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
41 14 , temperature_(getParam<Scalar>(
42 "SpatialParams.Temperature",
43
2/4
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 7 times.
✗ Branch 5 not taken.
14 ParentType::temperatureAtPos(GlobalPosition(0.0))
44
3/6
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 7 times.
✗ Branch 8 not taken.
14 ))
45 7 {}
46
47 /*!
48 * \brief The (intrinsic) permeability \f$[m^2]\f$
49 */
50 2035480 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
51 1831280 { return permeability_; }
52
53 /*!
54 * \brief The porosity \f$[-]\f$
55 */
56 2035480 Scalar porosityAtPos(const GlobalPosition& globalPos) const
57 1831280 { return porosity_; }
58
59 /*!
60 * \brief The temperature \f$[K]\f$
61 */
62 1785280 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
63 1581080 { return temperature_; }
64
65 private:
66 const Scalar porosity_;
67 const Scalar permeability_;
68 const Scalar temperature_;
69 };
70
71 } // end namespace Dumux
72
73 #endif
74