GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/freeflow/shallowwater/poiseuilleflow/vertical/spatialparams.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 9 13 69.2%
Functions: 1 4 25.0%
Branches: 13 32 40.6%

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 ShallowWaterTests
10 * \brief The spatial parameters for the Poiseuille flow problem.
11 */
12 #ifndef DUMUX_POISEUILLE_FLOW_SPATIAL_PARAMETERS_HH
13 #define DUMUX_POISEUILLE_FLOW_SPATIAL_PARAMETERS_HH
14
15 #include <dumux/common/exceptions.hh>
16 #include <dumux/common/parameters.hh>
17 #include <dumux/freeflow/spatialparams.hh>
18
19 #include <dumux/material/fluidmatrixinteractions/frictionlaws/frictionlaw.hh>
20 #include <dumux/material/fluidmatrixinteractions/frictionlaws/viscousnoslip.hh>
21
22 namespace Dumux {
23
24 /*!
25 * \ingroup ShallowWaterTests
26 * \brief The spatial parameters class for the Poiseuille flow test.
27 *
28 */
29 template<class GridGeometry, class Scalar, class VolumeVariables>
30 class PoiseuilleFlowSpatialParams
31 : public FreeFlowSpatialParams<GridGeometry, Scalar,
32 PoiseuilleFlowSpatialParams<GridGeometry, Scalar, VolumeVariables>>
33 {
34 using ThisType = PoiseuilleFlowSpatialParams<GridGeometry, Scalar, VolumeVariables>;
35 using ParentType = FreeFlowSpatialParams<GridGeometry, Scalar, ThisType>;
36 using GridView = typename GridGeometry::GridView;
37 using FVElementGeometry = typename GridGeometry::LocalView;
38 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
39 using Element = typename GridView::template Codim<0>::Entity;
40 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
41
42 public:
43 1 PoiseuilleFlowSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
44
3/12
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
2 : ParentType(gridGeometry)
45 {
46
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gravity_ = getParam<Scalar>("Problem.Gravity");
47
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 bedSlope_ = getParam<Scalar>("Problem.BedSlope");
48
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
6 channelLength_ = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0];
49
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
1 frictionLaw_ = std::make_unique<FrictionLawViscousNoSlip<VolumeVariables>>();
50 1 }
51
52 Scalar gravity(const GlobalPosition& globalPos) const
53 { return gravity_; }
54
55 Scalar bedSurface(const Element& element, const SubControlVolume& scv) const
56 1656 { return bedSlope_*(channelLength_ - scv.center()[0]); }
57
58 const FrictionLaw<VolumeVariables>& frictionLaw(const Element& element, const SubControlVolume& scv) const
59 640 { return *frictionLaw_; }
60
61 private:
62 Scalar gravity_;
63 Scalar bedSlope_;
64 Scalar channelLength_;
65
66 std::unique_ptr<FrictionLaw<VolumeVariables>> frictionLaw_;
67 };
68
69 } // end namespace Dumux
70
71 #endif
72