GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/multidomain/poromechanics/el2p/problem_poroelastic.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 19 21 90.5%
Functions: 2 2 100.0%
Branches: 13 22 59.1%

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 PoromechanicsTests
10 * \brief The poro-elastic sub-problem in the el2p coupled problem.
11 */
12 #ifndef DUMUX_POROELASTIC_SUBPROBLEM_HH
13 #define DUMUX_POROELASTIC_SUBPROBLEM_HH
14
15 #include <dune/common/fmatrix.hh>
16
17 #include <dumux/common/properties.hh>
18 #include <dumux/common/parameters.hh>
19 #include <dumux/common/boundarytypes.hh>
20 #include <dumux/common/fvproblemwithspatialparams.hh>
21
22 namespace Dumux {
23
24 /*!
25 * \ingroup PoromechanicsTests
26 * \brief The poro-elastic sub-problem in the el2p coupled problem.
27 */
28 template<class TypeTag>
29 2 class PoroElasticSubProblem : public FVProblemWithSpatialParams<TypeTag>
30 {
31 using ParentType = FVProblemWithSpatialParams<TypeTag>;
32
33 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
34 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
35 using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
36 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
37 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
38 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
39
40 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
41 using FVElementGeometry = typename GridGeometry::LocalView;
42 using SubControlVolume = typename GridGeometry::SubControlVolume;
43
44 using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
45 using Element = typename GridView::template Codim<0>::Entity;
46 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
47
48 static constexpr int dim = GridView::dimension;
49 static constexpr int dimWorld = GridView::dimensionworld;
50 using GradU = Dune::FieldMatrix<Scalar, dim, dimWorld>;
51
52 public:
53 2 PoroElasticSubProblem(std::shared_ptr<const GridGeometry> gridGeometry,
54 std::shared_ptr<GetPropType<TypeTag, Properties::SpatialParams>> spatialParams,
55 const std::string& paramGroup = "PoroElastic")
56
3/8
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
6 : ParentType(gridGeometry, spatialParams, paramGroup)
57 {
58
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
4 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
59 2 }
60
61 /*!
62 * \brief The problem name.
63 */
64 2 const std::string& name() const
65 {
66
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 return problemName_;
67 }
68
69 //! Evaluates the initial value for a control volume.
70 250 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
71 500 { return PrimaryVariables(0.0); }
72
73 //! Evaluates the boundary conditions for a Dirichlet boundary segment.
74 15984 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
75
2/2
✓ Branch 0 taken 47952 times.
✓ Branch 1 taken 15984 times.
79920 { return PrimaryVariables(0.0); }
76
77 //! Evaluates the boundary conditions for a Neumann boundary segment.
78 PrimaryVariables neumannAtPos(const GlobalPosition& globalPos) const
79 { return PrimaryVariables(0.0); }
80
81 /*!
82 * \brief Specifies which kind of boundary condition should be
83 * used for which equation on a given boundary segment.
84 *
85 * \param globalPos The global position
86 */
87 21904 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
88 {
89
2/2
✓ Branch 0 taken 65712 times.
✓ Branch 1 taken 21904 times.
87616 BoundaryTypes values;
90 21904 values.setAllDirichlet();
91 21904 return values;
92 }
93
94 /*!
95 * \brief Evaluates the source term for all phases within a given
96 * sub-control volume.
97 */
98 784384 PrimaryVariables source(const Element& element,
99 const FVElementGeometry& fvGeometry,
100 const ElementVolumeVariables& elemVolVars,
101 const SubControlVolume& scv) const
102
2/2
✓ Branch 0 taken 2353152 times.
✓ Branch 1 taken 784384 times.
3921920 { return PrimaryVariables(0.0); }
103
104 40 void setTime(Scalar t) const
105 40 { time_ = t; }
106
107 private:
108 static constexpr Scalar eps_ = 3e-6;
109 std::string problemName_;
110 mutable Scalar time_ = 0;
111 };
112
113 } // end namespace Dumux
114
115 #endif
116