GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/1pnc/iofields.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 51 206 24.8%
Branches: 34 73 46.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 OnePNCModel
10 * \brief Adds I/O fields specific to the OnePNC model.
11 */
12
13 #ifndef DUMUX_ONEPNC_IO_FIELDS_HH
14 #define DUMUX_ONEPNC_IO_FIELDS_HH
15
16 #include <string>
17 #include <dumux/io/name.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup OnePNCModel
23 * \brief Adds I/O fields specific to the OnePNC model.
24 */
25 class OnePNCIOFields
26 {
27 public:
28 template <class OutputModule>
29 89 static void initOutputModule(OutputModule& out)
30 {
31 using VolumeVariables = typename OutputModule::VolumeVariables;
32 using FluidSystem = typename VolumeVariables::FluidSystem;
33
34
4/12
✓ Branch 2 taken 63 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 63 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 63 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 63 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
82722 out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); },
35 IOName::pressure());
36
4/12
✓ Branch 2 taken 63 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 63 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 63 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 63 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
82722 out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); },
37 IOName::density());
38
4/12
✓ Branch 2 taken 63 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 63 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 63 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 63 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
82722 out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); },
39 IOName::viscosity());
40
41
2/2
✓ Branch 0 taken 63 times.
✓ Branch 1 taken 129 times.
270 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
42
10/19
✗ Branch 0 not taken.
✓ Branch 1 taken 882108 times.
✓ Branch 2 taken 52 times.
✓ Branch 3 taken 81536 times.
✓ Branch 4 taken 77 times.
✓ Branch 5 taken 52 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 129 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 77 times.
✓ Branch 10 taken 52 times.
✓ Branch 11 taken 6 times.
✓ Branch 12 taken 71 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
964012 out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); },
43 IOName::moleFraction<FluidSystem>(0, i));
44
45
2/2
✓ Branch 0 taken 129 times.
✓ Branch 1 taken 63 times.
270 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
46
8/14
✓ Branch 2 taken 52 times.
✓ Branch 3 taken 77 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 52 times.
✓ Branch 6 taken 77 times.
✓ Branch 7 taken 52 times.
✓ Branch 8 taken 77 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 58 times.
✓ Branch 11 taken 71 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
964012 out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); },
47 IOName::massFraction<FluidSystem>(0, i));
48 89 }
49
50 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
51 static std::string primaryVariableName(int pvIdx, int state = 0)
52 {
53 if (pvIdx == 0)
54 return IOName::pressure();
55 else if (ModelTraits::useMoles())
56 return IOName::moleFraction<FluidSystem>(0, pvIdx);
57 else
58 return IOName::massFraction<FluidSystem>(0, pvIdx);
59 }
60 };
61
62 } // end namespace Dumux
63
64 #endif
65