GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/porousmediumflow/1pnc/iofields.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 53 53 100.0%
Branches: 14 20 70.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-FileCopyrightText: 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 93 static void initOutputModule(OutputModule& out)
30 {
31 using VolumeVariables = typename OutputModule::VolumeVariables;
32 using FluidSystem = typename VolumeVariables::FluidSystem;
33
34
2/3
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 1 taken 61 times.
41458 out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); },
35 IOName::pressure());
36
1/2
✓ Branch 1 taken 67 times.
✗ Branch 2 not taken.
41458 out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); },
37 IOName::density());
38
1/2
✓ Branch 1 taken 67 times.
✗ Branch 2 not taken.
41458 out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); },
39 IOName::viscosity());
40
41
2/2
✓ Branch 0 taken 137 times.
✓ Branch 1 taken 67 times.
282 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
42
4/6
✗ Branch 0 not taken.
✓ Branch 1 taken 978664 times.
✓ Branch 4 taken 85 times.
✗ Branch 5 not taken.
✓ Branch 2 taken 52 times.
✓ Branch 3 taken 81536 times.
1060578 out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); },
43 IOName::moleFraction<FluidSystem>(0, i));
44
45
2/2
✓ Branch 0 taken 137 times.
✓ Branch 1 taken 67 times.
282 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
46
2/3
✓ Branch 3 taken 85 times.
✗ Branch 4 not taken.
✓ Branch 2 taken 52 times.
1060578 out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); },
47 IOName::massFraction<FluidSystem>(0, i));
48 93 }
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