GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/porousmediumflow/tracer/iofields.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 18 18 100.0%
Branches: 5 8 62.5%

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 TracerModel
10 * \brief Adds I/O fields specific to the tracer model.
11 */
12
13 #ifndef DUMUX_TRACER_IO_FIELDS_HH
14 #define DUMUX_TRACER_IO_FIELDS_HH
15
16 #include <string>
17
18 #include <dumux/io/name.hh>
19
20 namespace Dumux {
21
22 /*!
23 * \ingroup TracerModel
24 * \brief Adds I/O fields specific to the tracer model.
25 */
26 class TracerIOFields
27 {
28 public:
29 template <class OutputModule>
30 28 static void initOutputModule(OutputModule& out)
31 {
32 using VolumeVariables = typename OutputModule::VolumeVariables;
33 using FluidSystem = typename VolumeVariables::FluidSystem;
34
35 // register standardized out output fields
36
2/2
✓ Branch 0 taken 30 times.
✓ Branch 1 taken 20 times.
66 for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx)
37 {
38
1/2
✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
1093789 out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(0, compIdx); },
39 "x^" + FluidSystem::componentName(compIdx));
40
1/2
✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
1093789 out.addVolumeVariable([compIdx](const auto& v){ return v.massFraction(0, compIdx); },
41 "X^" + FluidSystem::componentName(compIdx));
42 }
43
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
1093731 out.addVolumeVariable( [](const auto& v){ return v.density(); }, IOName::density());
44 28 }
45
46 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
47 static std::string primaryVariableName(int pvIdx, int state = 0)
48 {
49 const std::string xString = ModelTraits::useMoles() ? "x" : "X";
50 return xString + "^" + FluidSystem::componentName(pvIdx);
51 }
52 };
53
54 } // end namespace Dumux
55
56 #endif
57