GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/facet/tracer_tracer/problem_1p_bulk.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 20 27 74.1%
Functions: 6 21 28.6%
Branches: 85 131 64.9%

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 FacetTests
10 * \brief The problem for the bulk domain of the single-phase problem
11 * within the tracer facet coupling test.
12 */
13
14 #ifndef DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_BULKPROBLEM_HH
15 #define DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_BULKPROBLEM_HH
16
17 #include <dumux/common/boundarytypes.hh>
18 #include <dumux/common/properties.hh>
19 #include <dumux/common/parameters.hh>
20 #include <dumux/common/numeqvector.hh>
21
22 #include <dumux/porousmediumflow/problem.hh>
23
24 namespace Dumux {
25
26 /*!
27 * \ingroup FacetTests
28 * \brief The problem for the bulk domain of the single-phase problem
29 * within the tracer facet coupling test.
30 */
31 template<class TypeTag>
32 class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag>
33 {
34 using ParentType = PorousMediumFlowProblem<TypeTag>;
35
36 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
37 using PrimaryVariables = typename GridVariables::PrimaryVariables;
38 using Scalar = typename GridVariables::Scalar;
39
40 using GridGeometry = typename GridVariables::GridGeometry;
41 using FVElementGeometry = typename GridGeometry::LocalView;
42 using SubControlVolume = typename GridGeometry::SubControlVolume;
43 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
44 using GridView = typename GridGeometry::GridView;
45 using Element = typename GridView::template Codim<0>::Entity;
46 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
47
48 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
49 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
50 using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
51 using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
52
53 public:
54 3 OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry,
55 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
56 std::shared_ptr<CouplingManager> couplingManager,
57 const std::string& paramGroup = "")
58 : ParentType(gridGeometry, spatialParams, paramGroup)
59 , couplingManagerPtr_(couplingManager)
60
5/16
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 3 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
9 , overPressure_(getParamFromGroup<Scalar>(paramGroup, "Problem.BoundaryOverpressure"))
61 {
62
7/22
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 3 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 3 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
3 problemName_ = getParamFromGroup<std::string>(this->paramGroup(), "Vtk.OutputName") + "_" +
63
2/4
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
6 getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
64 3 }
65
66 //! The problem name.
67 const std::string& name() const
68
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 { return problemName_; }
69
70 //! Specifies the type of boundary condition at a given position.
71 9429 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
72 {
73
2/2
✓ Branch 0 taken 2734 times.
✓ Branch 1 taken 6695 times.
9429 BoundaryTypes values;
74 9429 values.setAllNeumann();
75
18/18
✓ Branch 0 taken 2734 times.
✓ Branch 1 taken 6695 times.
✓ Branch 2 taken 2734 times.
✓ Branch 3 taken 6695 times.
✓ Branch 4 taken 2067 times.
✓ Branch 5 taken 667 times.
✓ Branch 6 taken 2067 times.
✓ Branch 7 taken 667 times.
✓ Branch 8 taken 7402 times.
✓ Branch 9 taken 1360 times.
✓ Branch 10 taken 7402 times.
✓ Branch 11 taken 1360 times.
✓ Branch 12 taken 7402 times.
✓ Branch 13 taken 1360 times.
✓ Branch 14 taken 7402 times.
✓ Branch 15 taken 1360 times.
✓ Branch 16 taken 7402 times.
✓ Branch 17 taken 1360 times.
18858 if ( (globalPos[0] < 1e-6 && globalPos[1] < 4.0) || globalPos[0] > this->gridGeometry().bBoxMax()[0] - 1e-6)
76 values.setAllDirichlet();
77 9429 return values;
78 }
79
80 //! Specifies the type of interior boundary condition at a given position.
81 BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
82 {
83
3/4
✓ Branch 0 taken 11049 times.
✓ Branch 1 taken 43671 times.
✓ Branch 2 taken 12640 times.
✗ Branch 3 not taken.
67360 BoundaryTypes values;
84
3/4
✓ Branch 0 taken 11049 times.
✓ Branch 1 taken 43671 times.
✓ Branch 2 taken 12640 times.
✗ Branch 3 not taken.
67360 values.setAllNeumann();
85 return values;
86 }
87
88 //! Evaluates the source term at a given position.
89 NumEqVector sourceAtPos(const GlobalPosition& globalPos) const
90
1/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 115680 times.
115680 { return NumEqVector(0.0); }
91
92 //! Evaluates the Dirichlet boundary condition for a given position.
93 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
94 {
95 1816 auto values = initialAtPos(globalPos);
96
6/8
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✓ Branch 3 taken 488 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 40 times.
✓ Branch 6 taken 40 times.
✓ Branch 7 taken 80 times.
908 if (globalPos[0] < 1e-6)
97 300 values[Indices::pressureIdx] += overPressure_;
98 return values;
99 }
100
101 //! Evaluates the Neumann boundary condition for a boundary segment.
102 NumEqVector neumannAtPos(const GlobalPosition& globalPos) const
103
2/2
✓ Branch 0 taken 990 times.
✓ Branch 1 taken 1422 times.
4044 { return NumEqVector(0.0); }
104
105 //! Evaluates the initial conditions.
106 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
107
6/8
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✓ Branch 3 taken 488 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 40 times.
✓ Branch 6 taken 40 times.
✓ Branch 7 taken 80 times.
908 { return PrimaryVariables(1.0e5); }
108
109 //! Returns reference to the coupling manager.
110 const CouplingManager& couplingManager() const
111
29/37
✓ Branch 0 taken 58056 times.
✓ Branch 1 taken 474156 times.
✓ Branch 2 taken 58056 times.
✓ Branch 3 taken 474156 times.
✓ Branch 4 taken 58056 times.
✓ Branch 5 taken 476568 times.
✓ Branch 6 taken 58056 times.
✓ Branch 7 taken 476568 times.
✓ Branch 8 taken 124290 times.
✓ Branch 9 taken 151572 times.
✓ Branch 10 taken 124290 times.
✓ Branch 11 taken 11048 times.
✓ Branch 12 taken 140524 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 200 times.
✓ Branch 15 taken 75793 times.
✓ Branch 16 taken 200 times.
✓ Branch 17 taken 5531 times.
✓ Branch 18 taken 142075 times.
✓ Branch 19 taken 7400 times.
✓ Branch 20 taken 71813 times.
✓ Branch 21 taken 7400 times.
✗ Branch 22 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 6632 times.
✓ Branch 33 taken 140032 times.
✓ Branch 34 taken 6632 times.
✓ Branch 35 taken 140032 times.
✓ Branch 36 taken 400 times.
✓ Branch 37 taken 11062 times.
✓ Branch 38 taken 400 times.
✓ Branch 39 taken 11062 times.
3497116 { return *couplingManagerPtr_; }
112
113 private:
114 std::shared_ptr<CouplingManager> couplingManagerPtr_;
115 Scalar overPressure_;
116 std::string problemName_;
117 };
118
119 } // end namespace Dumux
120
121 #endif
122