GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/facet/tracer_tracer/problem_1p_lowdim.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 13 18 72.2%
Functions: 6 15 40.0%
Branches: 22 54 40.7%

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 facet domain of the single-phase problem
11 * within the tracer facet coupling test.
12 */
13
14 #ifndef DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_LOWDIMPROBLEM_HH
15 #define DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_LOWDIMPROBLEM_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 facet domain of the single-phase problem
29 * within the tracer facet coupling test.
30 */
31 template<class TypeTag>
32 class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag>
33 {
34 using ParentType = PorousMediumFlowProblem<TypeTag>;
35
36 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
37 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
38 using PrimaryVariables = typename GridVariables::PrimaryVariables;
39 using Scalar = typename GridVariables::Scalar;
40
41 using GridGeometry = typename GridVariables::GridGeometry;
42 using FVElementGeometry = typename GridGeometry::LocalView;
43 using SubControlVolume = typename GridGeometry::SubControlVolume;
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 OnePLowDimProblem(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
4/14
✓ 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 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
9 , couplingManagerPtr_(couplingManager)
60 {
61
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") + "_" +
62
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");
63 3 }
64
65 //! The problem name.
66 const std::string& name() const
67
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 { return problemName_; }
68
69 //! Specifies the type of boundary condition at a given position.
70 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
71 {
72
4/6
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 96 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 72 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 16 times.
216 BoundaryTypes values;
73
4/6
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 96 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 72 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 16 times.
216 values.setAllNeumann();
74 return values;
75 }
76
77 //! Evaluates the source term at a given position.
78 3600 NumEqVector source(const Element& element,
79 const FVElementGeometry& fvGeometry,
80 const ElementVolumeVariables& elemVolVars,
81 const SubControlVolume& scv) const
82 {
83 // evaluate sources from bulk domain
84 7200 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
85 8400 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
86 3600 return source;
87 }
88
89 //! Evaluates the Dirichlet boundary condition for a given position.
90 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
91 { return initialAtPos(globalPos); }
92
93 //! Evaluates the initial conditions.
94 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
95 101 { return PrimaryVariables(1.0e5); }
96
97 //! Returns reference to the coupling manager.
98 const CouplingManager& couplingManager() const
99 { return *couplingManagerPtr_; }
100
101 private:
102 std::shared_ptr<CouplingManager> couplingManagerPtr_;
103 std::string problemName_;
104 };
105
106 } // end namespace Dumux
107
108 #endif
109