GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/porenetwork/2p/iofields.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 18 18 100.0%
Functions: 2 2 100.0%
Branches: 14 28 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 PNMTwoPModel
10 * \copydoc Dumux::PoreNetwork::TwoPIOFields
11 */
12 #ifndef DUMUX_PNM_TWOP_IO_FIELDS_HH
13 #define DUMUX_PNM_TWOP_IO_FIELDS_HH
14
15 #include <dumux/porousmediumflow/2p/iofields.hh>
16 #include <dumux/porenetwork/common/iofields.hh>
17
18 namespace Dumux::PoreNetwork {
19
20 /*!
21 * \ingroup PNMTwoPModel
22 * \brief Adds output fields specific to the PNM 2p model
23 */
24 class TwoPIOFields
25 {
26 public:
27 template <class OutputModule>
28 2 static void initOutputModule(OutputModule& out)
29 {
30 // use default fields from the 2p model
31 2 Dumux::TwoPIOFields::initOutputModule(out);
32 using VolumeVariables = typename OutputModule::VolumeVariables;
33 using FS = typename VolumeVariables::FluidSystem;
34
35 2 CommonIOFields::initOutputModule(out);
36
37
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
38 31236 { return fluxVarsCache.pcEntry(); }, "pcEntry");
39
40
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
41 31236 { return fluxVarsCache.transmissibility(FS::phase0Idx); }, "transmissibilityW");
42
43
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
44 31236 { return fluxVarsCache.transmissibility(FS::phase1Idx); }, "transmissibilityN");
45
46 31236 auto volumeFluxW = [](const auto& fluxVars, const auto& fluxVarsCache)
47 {
48 31236 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase0Idx); };
49 using std::abs;
50 31236 return abs(fluxVars.advectiveFlux(FS::phase0Idx, upwindTerm));
51 };
52
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 out.addFluxVariable(volumeFluxW, "volumeFluxW");
53
54 31236 auto volumeFluxN = [](const auto& fluxVars, const auto& fluxVarsCache)
55 {
56 31236 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase1Idx); };
57 using std::abs;
58 31236 return abs(fluxVars.advectiveFlux(FS::phase1Idx, upwindTerm));
59 };
60
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
4 out.addFluxVariable(volumeFluxN, "volumeFluxN");
61 2 }
62
63 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
64 static std::string primaryVariableName(int pvIdx, int state = 0)
65 {
66 return TwoPIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state);
67 }
68 };
69
70 } // end namespace Dumux::PoreNetwork
71
72 #endif
73