GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 15 19 78.9%
Functions: 2 6 33.3%
Branches: 79 131 60.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 FacetTests
10 * \brief The problem for the bulk domain in the single-phase facet coupling test.
11 */
12
13 #ifndef DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_BULKPROBLEM_HH
14 #define DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_BULKPROBLEM_HH
15
16 #include <dumux/common/boundarytypes.hh>
17 #include <dumux/common/numeqvector.hh>
18
19 #include <dumux/porousmediumflow/problem.hh>
20
21 namespace Dumux {
22
23 /*!
24 * \ingroup FacetTests
25 * \brief Test problem for the incompressible one-phase model
26 * with coupling across the bulk grid facets.
27 */
28 template<class TypeTag>
29 class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag>
30 {
31 using ParentType = PorousMediumFlowProblem<TypeTag>;
32 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
33 using PrimaryVariables = typename GridVariables::PrimaryVariables;
34 using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
35 using Scalar = typename GridVariables::Scalar;
36
37 using GridGeometry = typename GridVariables::GridGeometry;
38 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
39 using GridView = typename GridGeometry::GridView;
40 using Element = typename GridView::template Codim<0>::Entity;
41 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
42
43 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
44 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
45
46 public:
47 //! The constructor
48 2 OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry,
49 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
50 std::shared_ptr<CouplingManager> couplingManagerPtr,
51 const std::string& paramGroup = "Bulk")
52 : ParentType(gridGeometry, spatialParams, paramGroup)
53
3/12
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
8 , couplingManagerPtr_(couplingManagerPtr)
54 {
55
9/26
✓ 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.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 2 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 2 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
4 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
56 2 }
57
58 /*!
59 * \brief The problem name.
60 */
61 const std::string& name() const
62 {
63
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 return problemName_;
64 }
65
66 //! Specifies the kind of boundary condition on a given boundary position.
67 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
68 {
69
4/6
✓ Branch 0 taken 15376 times.
✓ Branch 1 taken 3376 times.
✓ Branch 2 taken 1860 times.
✓ Branch 3 taken 372 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
20984 BoundaryTypes values;
70 20984 values.setAllNeumann();
71
40/60
✓ Branch 0 taken 15376 times.
✓ Branch 1 taken 3376 times.
✓ Branch 2 taken 15376 times.
✓ Branch 3 taken 3376 times.
✓ Branch 4 taken 15376 times.
✓ Branch 5 taken 3376 times.
✓ Branch 6 taken 15376 times.
✓ Branch 7 taken 3376 times.
✓ Branch 8 taken 15376 times.
✓ Branch 9 taken 3376 times.
✓ Branch 10 taken 12000 times.
✓ Branch 11 taken 3376 times.
✓ Branch 12 taken 12000 times.
✓ Branch 13 taken 3376 times.
✓ Branch 14 taken 12000 times.
✓ Branch 15 taken 3376 times.
✓ Branch 16 taken 12000 times.
✓ Branch 17 taken 3376 times.
✓ Branch 18 taken 12000 times.
✓ Branch 19 taken 3376 times.
✓ Branch 20 taken 1860 times.
✓ Branch 21 taken 372 times.
✓ Branch 22 taken 1860 times.
✓ Branch 23 taken 372 times.
✓ Branch 24 taken 1860 times.
✓ Branch 25 taken 372 times.
✓ Branch 26 taken 1860 times.
✓ Branch 27 taken 372 times.
✓ Branch 28 taken 1860 times.
✓ Branch 29 taken 372 times.
✓ Branch 30 taken 1488 times.
✓ Branch 31 taken 372 times.
✓ Branch 32 taken 1488 times.
✓ Branch 33 taken 372 times.
✓ Branch 34 taken 1488 times.
✓ Branch 35 taken 372 times.
✓ Branch 36 taken 1488 times.
✓ Branch 37 taken 372 times.
✓ Branch 38 taken 1488 times.
✓ Branch 39 taken 372 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
104920 if (globalPos[1] < this->gridGeometry().bBoxMin()[1] + 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6)
72 values.setAllDirichlet();
73 return values;
74 }
75
76 /*!
77 * \brief Specifies which kind of interior boundary condition should be
78 * used for which equation on a given sub-control volume face
79 * that couples to a facet element.
80 *
81 * \param element The finite element the scvf is embedded in
82 * \param scvf The sub-control volume face
83 */
84 BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
85 {
86
3/4
✓ Branch 0 taken 11089 times.
✓ Branch 1 taken 61055 times.
✓ Branch 2 taken 22368 times.
✗ Branch 3 not taken.
94512 BoundaryTypes values;
87
3/4
✓ Branch 0 taken 11089 times.
✓ Branch 1 taken 61055 times.
✓ Branch 2 taken 22368 times.
✗ Branch 3 not taken.
94512 values.setAllNeumann();
88 return values;
89 }
90
91 //! Evaluates the Dirichlet boundary conditions at a given position.
92 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
93 {
94 6008 const auto y = globalPos[1];
95 18024 const auto yMin = this->gridGeometry().bBoxMin()[1];
96 18024 const auto yMax = this->gridGeometry().bBoxMax()[1];
97
98 12016 return PrimaryVariables( {2.0 - (y-yMin)/(yMax-yMin)} );
99 }
100
101 //! Evaluates the initial conditions.
102 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
103 { return PrimaryVariables(1.0); }
104
105 //! Returns const reference to the coupling manager.
106 const CouplingManager& couplingManager() const
107
16/17
✓ Branch 0 taken 188208 times.
✓ Branch 1 taken 11088 times.
✓ Branch 2 taken 188208 times.
✓ Branch 3 taken 11088 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 6336 times.
✓ Branch 7 taken 82944 times.
✓ Branch 8 taken 6336 times.
✓ Branch 9 taken 82944 times.
✓ Branch 10 taken 82944 times.
✓ Branch 11 taken 6336 times.
✓ Branch 12 taken 82944 times.
✓ Branch 13 taken 6336 times.
✓ Branch 16 taken 6336 times.
✓ Branch 17 taken 85920 times.
✓ Branch 18 taken 6336 times.
✓ Branch 19 taken 85920 times.
1219296 { return *couplingManagerPtr_; }
108
109 private:
110 std::string problemName_;
111 std::shared_ptr<CouplingManager> couplingManagerPtr_;
112 };
113
114 } // end namespace Dumux
115
116 #endif
117