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 RichardsModel | ||
10 | * \brief Adds I/O fields specific to the Richards model. | ||
11 | */ | ||
12 | |||
13 | #ifndef DUMUX_RICHARDS_IO_FIELDS_HH | ||
14 | #define DUMUX_RICHARDS_IO_FIELDS_HH | ||
15 | |||
16 | #include <dumux/common/parameters.hh> | ||
17 | #include <dumux/common/typetraits/state.hh> | ||
18 | #include <dumux/io/name.hh> | ||
19 | |||
20 | namespace Dumux { | ||
21 | |||
22 | /*! | ||
23 | * \ingroup RichardsModel | ||
24 | * \brief Adds I/O fields specific to the Richards model. | ||
25 | */ | ||
26 | class RichardsIOFields | ||
27 | { | ||
28 | public: | ||
29 | template <class OutputModule> | ||
30 | 41 | static void initOutputModule(OutputModule& out) | |
31 | { | ||
32 | using VV = typename OutputModule::VolumeVariables; | ||
33 | using FS = typename VV::FluidSystem; | ||
34 | |||
35 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); }, |
36 | IOName::saturation<FS>(FS::phase0Idx)); | ||
37 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); }, |
38 | IOName::saturation<FS>(FS::phase1Idx)); | ||
39 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); }, |
40 | IOName::pressure<FS>(FS::phase0Idx)); | ||
41 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); }, |
42 | IOName::pressure<FS>(FS::phase1Idx)); | ||
43 |
3/4✓ Branch 0 taken 420360 times.
✓ Branch 1 taken 42920 times.
✓ Branch 3 taken 41 times.
✗ Branch 4 not taken.
|
463362 | out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, |
44 | IOName::capillaryPressure()); | ||
45 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, |
46 | IOName::density<FS>(FS::phase0Idx)); | ||
47 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); }, |
48 | IOName::mobility<FS>(FS::phase0Idx)); | ||
49 |
1/2✓ Branch 2 taken 41 times.
✗ Branch 3 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::phase0Idx); }, |
50 | IOName::relativePermeability<FS>(FS::phase0Idx)); | ||
51 |
1/2✓ Branch 1 taken 41 times.
✗ Branch 2 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.porosity(); }, |
52 | IOName::porosity()); | ||
53 | |||
54 |
3/6✓ Branch 0 taken 41 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 41 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 41 times.
✗ Branch 7 not taken.
|
41 | static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity"); |
55 | |||
56 |
2/2✓ Branch 0 taken 27 times.
✓ Branch 1 taken 14 times.
|
41 | if(gravity) |
57 |
1/2✓ Branch 1 taken 27 times.
✗ Branch 2 not taken.
|
54 | out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::phase0Idx); }, |
58 | IOName::pressureHead()); | ||
59 |
1/2✓ Branch 1 taken 41 times.
✗ Branch 2 not taken.
|
82 | out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::phase0Idx); }, |
60 | IOName::waterContent()); | ||
61 | 41 | } | |
62 | |||
63 | template<class ModelTraits, class FluidSystem, class SolidSystem = void> | ||
64 | 4 | static std::string primaryVariableName(int pvIdx, int state) | |
65 | { | ||
66 | 4 | return IOName::pressure<FluidSystem>(FluidSystem::phase0Idx); | |
67 | } | ||
68 | }; | ||
69 | |||
70 | } // end namespace Dumux | ||
71 | |||
72 | #endif | ||
73 |