GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/porousmediumflow/richardsextended/iofields.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 2 2 100.0%
Branches: 2 4 50.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 ExtendedRichardsModel
10 * \brief Adds I/O fields specific to the extended Richards model.
11 */
12
13 #ifndef DUMUX_RICHARDSEXTENDED_IO_FIELDS_HH
14 #define DUMUX_RICHARDSEXTENDED_IO_FIELDS_HH
15
16 #include <dumux/io/name.hh>
17 #include <dumux/porousmediumflow/richards/iofields.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup ExtendedRichardsModel
23 * \brief Adds I/O fields specific to the extended Richards model.
24 */
25 class ExtendedRichardsIOFields : public RichardsIOFields
26 {
27 using ParentType = RichardsIOFields;
28 public:
29 template <class OutputModule>
30 2 static void initOutputModule(OutputModule& out)
31 {
32 using VV = typename OutputModule::VolumeVariables;
33 using FS = typename VV::FluidSystem;
34
35 2 ParentType::initOutputModule(out);
36
37
1/2
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
33004 out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::phase1Idx, FS::comp0Idx); },
38 IOName::moleFraction<FS>(FS::phase1Idx, FS::comp0Idx));
39
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
33004 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
40 IOName::phasePresence());
41 2 }
42 };
43
44 template<class ModelTraits, class FluidSystem, class SolidSystem = void>
45 static std::string primaryVariableName(int pvIdx, int state)
46 {
47 using Indices = typename ModelTraits::Indices;
48
49 if (state == Indices::gasPhaseOnly)
50 return IOName::moleFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::phase0Idx);
51 else
52 return IOName::pressure<FluidSystem>(FluidSystem::phase0Idx);
53 }
54 } // end namespace Dumux
55
56 #endif
57