GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/richardsextended/iofields.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 2 6 33.3%
Branches: 8 24 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 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
4/12
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
33004 out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::phase1Idx, FS::comp0Idx); },
38 IOName::moleFraction<FS>(FS::phase1Idx, FS::comp0Idx));
39
4/12
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
66004 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