GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/poromechanics/el1p/spatialparams_1p.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 8 10 80.0%
Functions: 2 3 66.7%
Branches: 6 18 33.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 PoromechanicsTests
10 * \brief The spatial parameters class for the test problem using the
11 * 1p box model.
12 */
13
14 #ifndef DUMUX_1P_TEST_SPATIALPARAMS_HH
15 #define DUMUX_1P_TEST_SPATIALPARAMS_HH
16
17 #include <dumux/discretization/elementsolution.hh>
18
19 #include <dumux/porousmediumflow/fvspatialparams1p.hh>
20 #include <dumux/material/gstatrandomfield.hh>
21 #include <dumux/material/fluidmatrixinteractions/porositydeformation.hh>
22
23 namespace Dumux {
24
25 /*!
26 * \ingroup PoromechanicsTests
27 * \brief The spatial parameters class for the test problem using the
28 * 1p box model.
29 */
30 template<class GridGeometry, class Scalar, class CouplingManager>
31 class OnePSpatialParams : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar,
32 OnePSpatialParams<GridGeometry, Scalar, CouplingManager>>
33 {
34 using SubControlVolume = typename GridGeometry::SubControlVolume;
35 using GridView = typename GridGeometry::GridView;
36 using Element = typename GridView::template Codim<0>::Entity;
37 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
38
39 using ThisType = OnePSpatialParams<GridGeometry, Scalar, CouplingManager>;
40 using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
41
42 public:
43 // export permeability type
44 using PermeabilityType = Scalar;
45
46 1 OnePSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
47 std::shared_ptr<CouplingManager> couplingManagerPtr)
48 : ParentType(gridGeometry)
49 , couplingManagerPtr_(couplingManagerPtr)
50 1 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
51
4/14
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
2 , initPorosity_(getParam<Scalar>("SpatialParams.InitialPorosity"))
52 1 {}
53
54 //! Returns the permeability at a given position.
55 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPoss) const
56 { return permeability_; }
57
58 //! Returns the porosity for a sub-control volume.
59 template<class ElementSolution>
60 58100 Scalar porosity(const Element& element,
61 const SubControlVolume& scv,
62 const ElementSolution& elemSol) const
63 {
64 static constexpr auto poroMechId = CouplingManager::poroMechId;
65
66
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 58100 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 58100 times.
116200 const auto& poroMechGridGeom = couplingManagerPtr_->problem(poroMechId).gridGeometry();
67 174300 const auto poroMechElemSol = elementSolution(element, couplingManagerPtr_->curSol(poroMechId), poroMechGridGeom);
68
69 // evaluate the deformation-dependent porosity at the scv center
70 116200 return PorosityDeformation<Scalar>::evaluatePorosity(poroMechGridGeom, element, scv.center(), poroMechElemSol, initPorosity_);
71 }
72
73 //! Returns reference to the coupling manager.
74 const CouplingManager& couplingManager() const
75 { return *couplingManagerPtr_; }
76
77 private:
78 std::shared_ptr<const CouplingManager> couplingManagerPtr_;
79 Scalar permeability_;
80 Scalar initPorosity_;
81 };
82
83 } // end namespace Dumux
84
85 #endif
86