GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 12 15 80.0%
Functions: 4 8 50.0%
Branches: 20 50 40.0%

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 (d-2)-dimensional edge domain in the single-phase
11 * facet coupling test involving three domains.
12 */
13
14 #ifndef DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_EDGEPROBLEM_HH
15 #define DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_EDGEPROBLEM_HH
16
17 #include <dumux/common/boundarytypes.hh>
18 #include <dumux/common/numeqvector.hh>
19
20 #include <dumux/porousmediumflow/problem.hh>
21
22 namespace Dumux {
23
24 /*!
25 * \ingroup FacetTests
26 * \brief The (d-2)-dimensional test problem for the incompressible
27 * one-phase model with coupling across the bulk grid facets.
28 */
29 template<class TypeTag>
30 class OnePEdgeProblem : public PorousMediumFlowProblem<TypeTag>
31 {
32 using ParentType = PorousMediumFlowProblem<TypeTag>;
33 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
34 using PrimaryVariables = typename GridVariables::PrimaryVariables;
35 using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
36 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
37 using Scalar = typename GridVariables::Scalar;
38
39 using GridGeometry = typename GridVariables::GridGeometry;
40 using FVElementGeometry = typename GridGeometry::LocalView;
41 using SubControlVolume = typename GridGeometry::SubControlVolume;
42 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
43 using GridView = typename GridGeometry::GridView;
44 using Element = typename GridView::template Codim<0>::Entity;
45 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
46
47 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
48 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
49
50 public:
51 2 OnePEdgeProblem(std::shared_ptr<const GridGeometry> gridGeometry,
52 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
53 std::shared_ptr<CouplingManager> couplingManagerPtr,
54 const std::string& paramGroup = "Edge")
55 : ParentType(gridGeometry, spatialParams, paramGroup)
56
4/14
✓ 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 taken 2 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
6 , couplingManagerPtr_(couplingManagerPtr)
57 {
58
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");
59 2 }
60
61 /*!
62 * \brief The problem name.
63 */
64 const std::string& name() const
65 {
66
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 return problemName_;
67 }
68
69 //! Specifies the type of boundary condition on a boundary position.
70 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
71 {
72
3/4
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 6 times.
26 BoundaryTypes values;
73
3/4
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 6 times.
26 values.setAllNeumann();
74 return values;
75 }
76
77 /*!
78 * \brief Evaluates the source term for all phases within a given
79 * sub-control volume.
80 */
81 120 NumEqVector source(const Element& element,
82 const FVElementGeometry& fvGeometry,
83 const ElementVolumeVariables& elemVolVars,
84 const SubControlVolume& scv) const
85 {
86 // forward to solution independent, fully-implicit specific interface
87 240 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
88 312 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
89 120 return source;
90 }
91
92 //! Evaluates the initial conditions.
93 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
94 9 { return PrimaryVariables(1.0); }
95
96 //! Returns const reference to the coupling manager.
97 const CouplingManager& couplingManager() const
98 { return *couplingManagerPtr_; }
99
100 private:
101 std::shared_ptr<CouplingManager> couplingManagerPtr_;
102 std::string problemName_;
103 };
104
105 } // end namespace Dumux
106
107 #endif
108