GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porenetwork/2p/iofields.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 16 18 88.9%
Functions: 2 16 12.5%
Branches: 34 92 37.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-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 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
7/18
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
6 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
38 31236 { return fluxVarsCache.pcEntry(); }, "pcEntry");
39
40
7/18
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
8 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
41 62472 { return fluxVarsCache.transmissibility(FS::phase0Idx); }, "transmissibilityW");
42
43
7/18
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
8 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
44 62472 { return fluxVarsCache.transmissibility(FS::phase1Idx); }, "transmissibilityN");
45
46 auto volumeFluxW = [](const auto& fluxVars, const auto& fluxVarsCache)
47 {
48 124944 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase0Idx); };
49 using std::abs;
50
0/2
✗ Branch 2 not taken.
✗ Branch 3 not taken.
31236 return abs(fluxVars.advectiveFlux(FS::phase0Idx, upwindTerm));
51 };
52
7/18
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
6 out.addFluxVariable(volumeFluxW, "volumeFluxW");
53
54 auto volumeFluxN = [](const auto& fluxVars, const auto& fluxVarsCache)
55 {
56 124944 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase1Idx); };
57 using std::abs;
58
0/2
✗ Branch 2 not taken.
✗ Branch 3 not taken.
31236 return abs(fluxVars.advectiveFlux(FS::phase1Idx, upwindTerm));
59 };
60
6/16
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
6 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