GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/fvspatialparams1pconstant.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 8 14 57.1%
Functions: 6 22 27.3%
Branches: 7 22 31.8%

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 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/6
✗ 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.
9 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 9 FVPorousMediumFlowSpatialParamsOnePConstant(std::shared_ptr<const GridGeometry> gridGeometry)
38 : ParentType(gridGeometry)
39 9 , porosity_(getParam<Scalar>("SpatialParams.Porosity"))
40 9 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
41 9 , temperature_(getParam<Scalar>(
42 "SpatialParams.Temperature",
43
2/4
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
9 ParentType::temperatureAtPos(GlobalPosition(0.0))
44
4/12
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 9 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
18 ))
45 9 {}
46
47 /*!
48 * \brief The (intrinsic) permeability \f$[m^2]\f$
49 */
50 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
51 { return permeability_; }
52
53 /*!
54 * \brief The porosity \f$[-]\f$
55 */
56 Scalar porosityAtPos(const GlobalPosition& globalPos) const
57 { return porosity_; }
58
59 /*!
60 * \brief The temperature \f$[K]\f$
61 */
62 Scalar temperatureAtPos(const GlobalPosition& globalPos) const
63 { 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