GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/shallowwater/problem.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 12 12 100.0%
Branches: 14 27 51.9%

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 ShallowWaterModels
10 * \copydoc Dumux::ShallowWaterProblem
11 */
12 #ifndef DUMUX_FREEFLOW_SHALLOW_WATER_PROBLEM_HH
13 #define DUMUX_FREEFLOW_SHALLOW_WATER_PROBLEM_HH
14
15 #include <dumux/common/fvproblem.hh>
16 #include <dumux/common/properties.hh>
17 #include "model.hh"
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup ShallowWaterModels
23 * \brief Shallow water problem base class.
24 */
25 template<class TypeTag>
26 class ShallowWaterProblem : public FVProblem<TypeTag>
27 {
28 using ParentType = FVProblem<TypeTag>;
29 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
30
31 public:
32 using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>;
33
34 /*!
35 * \brief Constructor, passing the spatial parameters
36 *
37 * \param gridGeometry The finite volume grid geometry
38 * \param spatialParams The spatial parameter class
39 * \param paramGroup The parameter group in which to look for runtime parameters first (default is "")
40 */
41 16 ShallowWaterProblem(std::shared_ptr<const GridGeometry> gridGeometry,
42 std::shared_ptr<SpatialParams> spatialParams,
43 const std::string& paramGroup = "")
44 : ParentType(gridGeometry, paramGroup)
45
2/6
✓ Branch 2 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
32 , spatialParams_(spatialParams)
46 16 {}
47
48 /*!
49 * \brief Constructor, constructing the spatial parameters
50 *
51 * \param gridGeometry The finite volume grid geometry
52 * \param paramGroup The parameter group in which to look for runtime parameters first (default is "")
53 */
54 16 ShallowWaterProblem(std::shared_ptr<const GridGeometry> gridGeometry,
55 const std::string& paramGroup = "")
56 : ShallowWaterProblem(gridGeometry,
57 std::make_shared<SpatialParams>(gridGeometry),
58
3/10
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 16 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
32 paramGroup)
59 16 {}
60
61
62
63 /*!
64 * \brief Returns the spatial parameters object.
65 */
66 const SpatialParams &spatialParams() const
67
9/11
✓ Branch 2 taken 18192 times.
✓ Branch 3 taken 98479 times.
✓ Branch 4 taken 18192 times.
✓ Branch 5 taken 98479 times.
✓ Branch 8 taken 3037 times.
✓ Branch 9 taken 557794 times.
✓ Branch 10 taken 3037 times.
✓ Branch 11 taken 933114 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 375320 times.
✗ Branch 15 not taken.
418644052 { return *spatialParams_; }
68
69 // \}
70
71
72 private:
73 std::shared_ptr<SpatialParams> spatialParams_; //!< the spatial parameters
74 };
75
76 } // end namespace Dumux
77
78 #endif
79