GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/mineralization/iofields.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 5 9 55.6%
Functions: 6 14 42.9%
Branches: 6 16 37.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-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 MineralizationModel
10 * \brief Adds I/O fields specific to the models considering
11 * mineralization processes.
12 */
13
14 #ifndef DUMUX_MINERALIZATION_IO_FIELDS_HH
15 #define DUMUX_MINERALIZATION_IO_FIELDS_HH
16
17 #include <dumux/io/name.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup MineralizationModel
23 * \brief Adds I/O fields specific to a NCMin model.
24 */
25 template<class NonMineralizationIOFields>
26 class MineralizationIOFields
27 {
28 public:
29 template <class OutputModule>
30 6 static void initOutputModule(OutputModule& out)
31 {
32 using SolidSystem = typename OutputModule::VolumeVariables::SolidSystem;
33
34 // output of the model without mineralization
35 6 NonMineralizationIOFields::initOutputModule(out);
36
37 // additional output
38
2/2
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 6 times.
14 for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i)
39 {
40
4/12
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 8 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
24 out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },
41 IOName::solidVolumeFraction<SolidSystem>(i));
42 }
43 6 }
44
45 template <class ModelTraits, class FluidSystem, class SolidSystem>
46 static std::string primaryVariableName(int pvIdx, int state = 0)
47 {
48 static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComps() + ModelTraits::numInertSolidComps();
49
50 if (pvIdx < nonMinNumEq)
51 return NonMineralizationIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state);
52 else
53 return IOName::solidVolumeFraction<SolidSystem>(pvIdx - nonMinNumEq);
54 }
55 };
56
57 } // end namespace Dumux
58
59 #endif
60