GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/multidomain/facet/1p_1p/box_dof_enrichment/problem_bulk.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 16 22 72.7%
Functions: 1 6 16.7%
Branches: 37 90 41.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-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 box-facet coupling dof enrichment test.
11 */
12 #ifndef DUMUX_TEST_FACET_BOX_DOF_ENRICHMENT_ONEP_BULKPROBLEM_HH
13 #define DUMUX_TEST_FACET_BOX_DOF_ENRICHMENT_ONEP_BULKPROBLEM_HH
14
15 #include <dumux/common/properties.hh>
16 #include <dumux/common/parameters.hh>
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 Test problem for the incompressible one-phase model
27 * with coupling across the bulk grid facets.
28 */
29 template<class TypeTag>
30 class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag>
31 {
32 using ParentType = PorousMediumFlowProblem<TypeTag>;
33
34 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
35 using PrimaryVariables = typename GridVariables::PrimaryVariables;
36 using Scalar = typename GridVariables::Scalar;
37
38 using GridGeometry = typename GridVariables::GridGeometry;
39 using FVElementGeometry = typename GridGeometry::LocalView;
40 using SubControlVolume = typename GridGeometry::SubControlVolume;
41 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
42 using GridView = typename GridGeometry::GridView;
43 using Element = typename GridView::template Codim<0>::Entity;
44 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
45
46 using BoundaryTypes = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>;
47 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
48 using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
49
50 static constexpr int dimWorld = GridView::dimensionworld;
51
52 public:
53 2 OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry,
54 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
55 std::shared_ptr<CouplingManager> couplingManager,
56 const std::string& paramGroup = "")
57 : ParentType(gridGeometry, spatialParams, paramGroup)
58
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_(couplingManager)
59 {
60
7/22
✓ 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 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 2 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.
2 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" +
61
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
4 getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
62 2 }
63
64 //! The problem name.
65 const std::string& name() const
66
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 { return problemName_; }
67
68 //! Specifies the type of boundary condition at a given position.
69 BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const
70 {
71
2/4
✓ Branch 0 taken 2445 times.
✓ Branch 1 taken 372 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
2817 BoundaryTypes values;
72 2817 values.setAllNeumann();
73
14/28
✓ Branch 0 taken 2445 times.
✓ Branch 1 taken 372 times.
✓ Branch 2 taken 2445 times.
✓ Branch 3 taken 372 times.
✓ Branch 4 taken 2223 times.
✓ Branch 5 taken 222 times.
✓ Branch 6 taken 2223 times.
✓ Branch 7 taken 222 times.
✓ Branch 8 taken 2223 times.
✓ Branch 9 taken 222 times.
✓ Branch 10 taken 2223 times.
✓ Branch 11 taken 222 times.
✓ Branch 12 taken 2223 times.
✓ Branch 13 taken 222 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ 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.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
5634 if (globalPos[1] < 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6)
74 values.setAllDirichlet();
75 return values;
76 }
77
78 //! Specifies the type of interior boundary condition at a given position.
79 BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
80 {
81
3/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7438 times.
✓ Branch 2 taken 2640 times.
✗ Branch 3 not taken.
10080 BoundaryTypes values;
82
3/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7438 times.
✓ Branch 2 taken 2640 times.
✗ Branch 3 not taken.
10080 values.setAllNeumann();
83 return values;
84 }
85
86 //! Evaluates the source term at a given position.
87 NumEqVector sourceAtPos(const GlobalPosition& globalPos) const
88
1/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 163584 times.
163584 { return NumEqVector(0.0); }
89
90 //! Evaluates the Dirichlet boundary condition for a given position.
91 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
92 1188 { return initialAtPos(globalPos); }
93
94 //! Evaluates the Neumann boundary condition for a boundary segment.
95 NumEqVector neumannAtPos(const GlobalPosition& globalPos) const
96 5844 { return NumEqVector(0.0); }
97
98 //! Evaluates the initial conditions.
99 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
100 1782 { return PrimaryVariables(globalPos[dimWorld-1]); }
101
102 //! Returns reference to the coupling manager.
103 const CouplingManager& couplingManager() const
104
0/4
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
29760 { return *couplingManagerPtr_; }
105
106 private:
107 std::shared_ptr<CouplingManager> couplingManagerPtr_;
108 std::string problemName_;
109 };
110
111 } // end namespace Dumux
112
113 #endif
114