GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/shallowwater/iofields.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 6 6 100.0%
Branches: 34 88 38.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 ShallowWaterModels
10 * \brief Add I/O fields specific to shallow water
11 */
12 #ifndef DUMUX_FREEFLOW_SHALLOW_WATER_IO_FIELDS_HH
13 #define DUMUX_FREEFLOW_SHALLOW_WATER_IO_FIELDS_HH
14
15 #include <dumux/io/name.hh>
16 #include <string>
17
18 namespace Dumux {
19
20 /*!
21 * \ingroup ShallowWaterModels
22 * \brief Adds vtk output fields for the shallow water model
23 */
24 class ShallowWaterIOFields
25 {
26 public:
27 template <class OutputModule>
28 16 static void initOutputModule(OutputModule& out)
29 {
30 using VolumeVariables = typename OutputModule::VolumeVariables;
31
32
7/18
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 16 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✓ Branch 17 taken 16 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
48 out.addVolumeVariable([](const VolumeVariables& v){ return v.waterDepth(); }, "waterDepth");
33
7/18
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 16 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✓ Branch 17 taken 16 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
48 out.addVolumeVariable([](const VolumeVariables& v){ return v.velocity(0); }, "velocityX");
34
7/18
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 16 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✓ Branch 17 taken 16 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
48 out.addVolumeVariable([](const VolumeVariables& v){ return v.velocity(1); }, "velocityY");
35
7/18
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 16 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✓ Branch 17 taken 16 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
48 out.addVolumeVariable([](const VolumeVariables& v){ return v.bedSurface(); }, "bedSurface");
36
6/16
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 16 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 16 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
48 out.addVolumeVariable([](const VolumeVariables& v){ return v.bedSurface() + v.waterDepth(); }, "freeSurface");
37 16 }
38
39 /* Restart is limited for shallow water models since only primary
40 * variables are regarded. Important parameters like the bedSurface,
41 * fricition,.. are missing so far.
42 */
43 template <class ModelTraits>
44 static std::string primaryVariableName(int pvIdx)
45 {
46 std::string name;
47
48 switch(pvIdx){
49 case 0 : name = "waterDepth";
50 case 1 : name = "velocityX";
51 case 2 : name = "velocityY";
52 }
53
54 return name;
55 }
56
57 };
58
59 } // end namespace Dumux
60
61 #endif
62