version 3.10-dev
porousmediumflow/nonisothermal/iofields.hh
Go to the documentation of this file.
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//
12#ifndef DUMUX_ENERGY_IO_FIELDS_HH
13#define DUMUX_ENERGY_IO_FIELDS_HH
14
15#include <string>
16#include <dumux/io/name.hh>
17
18namespace Dumux {
19
25template<class IsothermalIOFields = void>
27{
28public:
29 template <class OutputModule>
30 static void initOutputModule(OutputModule& out)
31 {
32 IsothermalIOFields::initOutputModule(out);
33 out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, IOName::temperature());
34 }
35
36 template <class ModelTraits, class FluidSystem = void, class SolidSystem = void>
37 static std::string primaryVariableName(int pvIdx, int state = 0)
38 {
39 using IsothermalTraits = typename ModelTraits::IsothermalTraits;
40
41 if (pvIdx < ModelTraits::numEq() - 1)
42 return IsothermalIOFields::template primaryVariableName<IsothermalTraits, FluidSystem, SolidSystem>(pvIdx, state);
43 else
44 return IOName::temperature();
45 }
46};
47
53template<>
54class EnergyIOFields<void>
55{
56public:
57 template <class OutputModule>
58 static void initOutputModule(OutputModule& out)
59 {
60 out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, IOName::temperature());
61 }
62
63 template <class ModelTraits, class FluidSystem = void, class SolidSystem = void>
64 static std::string primaryVariableName(int pvIdx, int state = 0)
65 {
66 return IOName::temperature();
67 }
68};
69
70} // end namespace Dumux
71
72#endif
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/nonisothermal/iofields.hh:58
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/nonisothermal/iofields.hh:64
Adds I/O fields specific to non-isothermal models.
Definition: porousmediumflow/nonisothermal/iofields.hh:27
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/nonisothermal/iofields.hh:30
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/nonisothermal/iofields.hh:37
A collection of input/output field names for common physical quantities.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
Definition: adapt.hh:17