GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/2p1c/iofields.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 2 4 50.0%
Branches: 4 12 33.3%

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 TwoPOneCModel
10 * \copydoc Dumux::TwoPOneCIOFields
11 */
12
13 #ifndef DUMUX_TWOP_ONEC_IO_FIELDS_HH
14 #define DUMUX_TWOP_ONEC_IO_FIELDS_HH
15
16 #include <dumux/porousmediumflow/2p/iofields.hh>
17 #include <dumux/io/name.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup TwoPOneCModel
23 * \brief Adds I/O fields specific to two-phase one-component model.
24 */
25 class TwoPOneCIOFields
26 {
27 public:
28 template <class OutputModule>
29 4 static void initOutputModule(OutputModule& out)
30 {
31 // use default fields from the 2p model
32 4 TwoPIOFields::initOutputModule(out);
33
34 // output additional to TwoP output:
35
4/12
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 4 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 4 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
49608 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
36 IOName::phasePresence());
37 4 }
38
39 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
40 static std::string primaryVariableName(int pvIdx, int state)
41 {
42 using Indices = typename ModelTraits::Indices;
43
44 if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1)
45 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) :
46 (state == Indices::twoPhases)
47 ? IOName::saturation<FluidSystem>(FluidSystem::phase1Idx)
48 : IOName::temperature();
49 else
50 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) :
51 (state == Indices::twoPhases)
52 ? IOName::saturation<FluidSystem>(FluidSystem::phase0Idx)
53 : IOName::temperature();
54 }
55 };
56
57 } // end namespace Dumux
58
59 #endif
60