GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/freeflow/shallowwater/dambreak/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 4 8 50.0%
Functions: 1 3 33.3%
Branches: 3 12 25.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 ShallowWaterTests
10 * \brief The spatial parameters for the dam break problem.
11 */
12 #ifndef DUMUX_DAM_BREAK_SPATIAL_PARAMETERS_HH
13 #define DUMUX_DAM_BREAK_SPATIAL_PARAMETERS_HH
14
15 #include <dumux/freeflow/spatialparams.hh>
16
17 namespace Dumux {
18
19 /*!
20 * \ingroup ShallowWaterTests
21 * \brief The spatial parameters class for the dam break test.
22 *
23 */
24 template<class GridGeometry, class Scalar>
25
1/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
3 class DamBreakSpatialParams
26 : public FreeFlowSpatialParams<GridGeometry, Scalar, DamBreakSpatialParams<GridGeometry, Scalar>>
27 {
28 using ThisType = DamBreakSpatialParams<GridGeometry, Scalar>;
29 using ParentType = FreeFlowSpatialParams<GridGeometry, Scalar, ThisType>;
30 using GridView = typename GridGeometry::GridView;
31 using FVElementGeometry = typename GridGeometry::LocalView;
32 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
33 using Element = typename GridView::template Codim<0>::Entity;
34 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
35
36 public:
37 3 DamBreakSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
38
2/6
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
3 : ParentType(gridGeometry)
39 3 {}
40
41 /*! \brief Define the porosity in [-].
42 *
43 * \param globalPos The global position where we evaluate
44 */
45 Scalar porosityAtPos(const GlobalPosition& globalPos) const
46 { return 1.0; }
47
48
49 /*! \brief Define the gravitation.
50 *
51 * \return gravity constant
52 */
53 Scalar gravity(const GlobalPosition& globalPos) const
54 {
55 return gravity_;
56 }
57
58 /*! \brief Define the bed surface
59 *
60 * \param element The current element
61 * \param scv The sub-control volume inside the element.
62 * \return the bed surface
63 */
64 Scalar bedSurface(const Element& element,
65 const SubControlVolume& scv) const
66 {
67 // todo depends on index e.g. eIdx = scv.elementIndex();
68 return 0.0;
69 }
70
71 private:
72 static constexpr Scalar gravity_ = 9.81;
73 };
74
75 } // end namespace Dumux
76
77 #endif
78