GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/2p/iofields.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 11 81.8%
Functions: 64 449 14.3%
Branches: 26 76 34.2%

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 TwoPModel
10 * \brief Adds I/O fields specific to the two-phase model.
11 */
12
13 #ifndef DUMUX_TWOP_IO_FIELDS_HH
14 #define DUMUX_TWOP_IO_FIELDS_HH
15
16 #include <dumux/io/name.hh>
17
18 #include "model.hh"
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup TwoPModel
24 * \brief Adds I/O fields specific to the two-phase model.
25 */
26 class TwoPIOFields
27 {
28 public:
29 template <class OutputModule>
30 87 static void initOutputModule(OutputModule& out)
31 {
32 using VolumeVariables = typename OutputModule::VolumeVariables;
33 using FS = typename VolumeVariables::FluidSystem;
34
35
2/2
✓ Branch 0 taken 174 times.
✓ Branch 1 taken 87 times.
261 for (int phaseIdx = 0; phaseIdx < FS::numPhases; ++phaseIdx)
36 {
37
4/12
✓ Branch 2 taken 174 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 174 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 174 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 174 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
348 out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.saturation(phaseIdx); },
38 IOName::saturation<FS>(phaseIdx));
39
4/12
✓ Branch 2 taken 174 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 174 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 174 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 174 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
348 out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.pressure(phaseIdx); },
40 IOName::pressure<FS>(phaseIdx));
41
4/12
✓ Branch 2 taken 174 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 174 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 174 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 174 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
348 out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); },
42 IOName::density<FS>(phaseIdx));
43
4/12
✓ Branch 2 taken 174 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 174 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 174 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 174 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
348 out.addVolumeVariable([phaseIdx](const auto& v){ return v.mobility(phaseIdx); },
44 IOName::mobility<FS>(phaseIdx));
45 }
46
47
4/12
✓ Branch 2 taken 87 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 87 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 87 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 87 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
174 out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); },
48 IOName::capillaryPressure());
49
4/12
✓ Branch 2 taken 87 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 87 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 87 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 87 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
174 out.addVolumeVariable([](const auto& v){ return v.porosity(); },
50 IOName::porosity());
51 87 }
52
53 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
54 static std::string primaryVariableName(int pvIdx, int state = 0)
55 {
56 if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1)
57 return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx)
58 : IOName::saturation<FluidSystem>(FluidSystem::phase1Idx);
59 else
60 return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx)
61 : IOName::saturation<FluidSystem>(FluidSystem::phase0Idx);
62 }
63 };
64
65 } // end namespace Dumux
66
67 #endif
68