GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/nonisothermal/iofields.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 11 63.6%
Functions: 72 136 52.9%
Branches: 8 26 30.8%

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 NIModel
10 * \brief Adds I/O fields specific to non-isothermal models.
11 */
12 #ifndef DUMUX_ENERGY_IO_FIELDS_HH
13 #define DUMUX_ENERGY_IO_FIELDS_HH
14
15 #include <string>
16 #include <dumux/io/name.hh>
17
18 namespace Dumux {
19
20 /*!
21 * \ingroup NIModel
22 * \brief Adds I/O fields specific to non-isothermal models
23 * \tparam IsothermalIOFields the isothermal io fields to adapt to non-isothermal io fields
24 */
25 template<class IsothermalIOFields = void>
26 class EnergyIOFields
27 {
28 public:
29 template <class OutputModule>
30 94 static void initOutputModule(OutputModule& out)
31 {
32 94 IsothermalIOFields::initOutputModule(out);
33
4/12
✓ Branch 2 taken 82 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 82 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 82 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 82 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
35580 out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, IOName::temperature());
34 94 }
35
36 template <class ModelTraits, class FluidSystem = void, class SolidSystem = void>
37 static std::string primaryVariableName(int pvIdx, int state = 0)
38 {
39 using IsothermalTraits = typename ModelTraits::IsothermalTraits;
40
41 if (pvIdx < ModelTraits::numEq() - 1)
42 return IsothermalIOFields::template primaryVariableName<IsothermalTraits, FluidSystem, SolidSystem>(pvIdx, state);
43 else
44 return IOName::temperature();
45 }
46 };
47
48 /*!
49 * \ingroup NIModel
50 * \brief Adds I/O fields specific to non-isothermal models.
51 * \note Specialization if this is class used on its own (not as an adapter)
52 */
53 template<>
54 class EnergyIOFields<void>
55 {
56 public:
57 template <class OutputModule>
58 1 static void initOutputModule(OutputModule& out)
59 {
60
4/12
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
2 out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, IOName::temperature());
61 1 }
62
63 template <class ModelTraits, class FluidSystem = void, class SolidSystem = void>
64 static std::string primaryVariableName(int pvIdx, int state = 0)
65 {
66 return IOName::temperature();
67 }
68 };
69
70 } // end namespace Dumux
71
72 #endif
73