GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/embedded/1d3d/1p_richards/spatialparams_soil.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 12 58.3%
Functions: 3 12 25.0%
Branches: 12 34 35.3%

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 EmbeddedTests
10 * \brief Definition of the spatial parameters for the tissue problem.
11 */
12
13 #ifndef DUMUX_SOIL_SPATIAL_PARAMS_HH
14 #define DUMUX_SOIL_SPATIAL_PARAMS_HH
15
16 #include <dumux/common/parameters.hh>
17 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
18 #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup EmbeddedTests
24 * \brief Definition of the spatial parameters for the tissue problem.
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 SoilSpatialParams
28 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry,Scalar, SoilSpatialParams<GridGeometry, Scalar>>
29 {
30 using ThisType = SoilSpatialParams<GridGeometry, Scalar>;
31 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
32 using GridView = typename GridGeometry::GridView;
33 using Element = typename GridView::template Codim<0>::Entity;
34 using SubControlVolume = typename GridGeometry::SubControlVolume;
35 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
36
37 using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
38
39 public:
40 // export permeability type
41 using PermeabilityType = Scalar;
42
43 3 SoilSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
44 : ParentType(gridGeometry)
45
7/20
✓ 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 13 taken 3 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 3 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 3 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
12 , pcKrSwCurve_("Soil.SpatialParams")
46 {
47 // perm and poro
48
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 permeability_ = getParam<Scalar>("Soil.SpatialParams.Permeability");
49
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 porosity_ = getParam<Scalar>("Soil.SpatialParams.Porosity");
50 3 }
51
52 /*!
53 * \brief Defines the intrinsic permeability \f$\mathrm{[m^2]}\f$.
54 *
55 * \param element The element
56 * \param scv The sub control volume
57 * \param elemSol The element solution vector
58 */
59 template<class ElementSolution>
60 PermeabilityType permeability(const Element& element,
61 const SubControlVolume& scv,
62 const ElementSolution& elemSol) const
63 {
64 return permeability_;
65 }
66
67 /*!
68 * \brief Defines the porosity \f$\mathrm{[-]}\f$.
69 *
70 * \param element The current finite element
71 * \param scv The sub control volume
72 * \param elemSol The current element solution vector
73 */
74 template<class ElementSolution>
75 Scalar porosity(const Element& element,
76 const SubControlVolume& scv,
77 const ElementSolution& elemSol) const
78 {
79 return porosity_;
80 }
81
82 /*!
83 * \brief Returns the parameters for the material law at a given location
84 *
85 * \param globalPos The global coordinates for the given location
86 */
87 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
88 {
89
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4866880 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 4866880 times.
19467520 return makeFluidMatrixInteraction(pcKrSwCurve_);
90 }
91
92 private:
93 const PcKrSwCurve pcKrSwCurve_;
94 Scalar permeability_;
95 Scalar porosity_;
96 };
97
98 } // end namespace Dumux
99
100 #endif
101