GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/mineralization/iofields.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 7 14 50.0%
Branches: 8 16 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-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 7 static void initOutputModule(OutputModule& out)
31 {
32 using SolidSystem = typename OutputModule::VolumeVariables::SolidSystem;
33
34 // output of the model without mineralization
35 7 NonMineralizationIOFields::initOutputModule(out);
36
37 // additional output
38
2/2
✓ Branch 1 taken 9 times.
✓ Branch 2 taken 7 times.
16 for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i)
39 {
40
4/12
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 9 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 9 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
27 out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },
41 IOName::solidVolumeFraction<SolidSystem>(i));
42 }
43 7 }
44
45 template <class ModelTraits, class FluidSystem, class SolidSystem>
46 24 static std::string primaryVariableName(int pvIdx, int state = 0)
47 {
48 static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComps() + ModelTraits::numInertSolidComps();
49
50
2/2
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 6 times.
24 if (pvIdx < nonMinNumEq)
51 18 return NonMineralizationIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state);
52 else
53 6 return IOName::solidVolumeFraction<SolidSystem>(pvIdx - nonMinNumEq);
54 }
55 };
56
57 } // end namespace Dumux
58
59 #endif
60