Commit 966af200 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Kilian Weishaupt
Browse files

[io] change from `IOFieldNames` to `IOName` in the models

See discussion in !1212.
parent b0ee6fa2
......@@ -24,9 +24,11 @@
#ifndef DUMUX_FREEFLOW_NC_IO_FIELDS_HH
#define DUMUX_FREEFLOW_NC_IO_FIELDS_HH
#include <dumux/freeflow/navierstokes/iofields.hh>
#include <dune/common/deprecated.hh>
#include <dumux/io/name.hh>
#include <dumux/freeflow/navierstokes/iofields.hh>
namespace Dumux
{
......@@ -54,12 +56,11 @@ public:
{
BaseOutputFields::initOutputModule(out);
using namespace IOFieldNames;
using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem;
for (int j = 0; j < FluidSystem::numComponents; ++j)
{
out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, massFraction<FluidSystem>(0, j));
out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, moleFraction<FluidSystem>(0, j));
out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, IOName::massFraction<FluidSystem>(0, j));
out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, IOName::moleFraction<FluidSystem>(0, j));
if (j != FluidSystem::getMainComponent(0))
{
......@@ -76,12 +77,11 @@ public:
template <class FluidSystem>
static std::string primaryVariableName(int pvIdx = 0, int state = 0)
{
using namespace IOFieldNames;
if (pvIdx <= ModelTraits::dim())
return BaseOutputFields::template primaryVariableName<FluidSystem>(pvIdx, state);
else
return ModelTraits::useMoles() ? moleFraction<FluidSystem>(pvIdx - ModelTraits::dim())
: massFraction<FluidSystem>(pvIdx - ModelTraits::dim());
return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(pvIdx - ModelTraits::dim())
: IOName::massFraction<FluidSystem>(pvIdx - ModelTraits::dim());
}
};
......
......@@ -25,11 +25,11 @@
#define DUMUX_NAVIER_STOKES_IO_FIELDS_HH
#include <dune/common/fvector.hh>
#include <dune/common/deprecated.hh>
#include <dumux/common/parameters.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/io/fieldnames.hh>
#include <dune/common/deprecated.hh>
#include <dumux/io/name.hh>
namespace Dumux
{
......@@ -50,11 +50,10 @@ public:
template <class OutputModule>
static void initOutputModule(OutputModule& out)
{
using namespace IOFieldNames;
using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem;
out.addVolumeVariable([](const auto& v){ return v.pressure(); }, pressure());
out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, molarDensity<FluidSystem>());
out.addVolumeVariable([](const auto& v){ return v.density(); }, density());
out.addVolumeVariable([](const auto& v){ return v.pressure(); }, IOName::pressure());
out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity<FluidSystem>());
out.addVolumeVariable([](const auto& v){ return v.density(); }, IOName::density());
// add discretization-specific fields
additionalOutput_(out, discMethodTag<FVGridGeometry::discMethod>{});
......@@ -71,13 +70,12 @@ public:
template <class FluidSystem = void>
static std::string primaryVariableName(int pvIdx = 0, int state = 0)
{
using namespace IOFieldNames;
const std::array<std::string, 3> velocities = {"v_x", "v_y", "v_z"};
if (pvIdx < FVGridGeometry::Grid::dimension)
return velocities[pvIdx];
else
return pressure();
return IOName::pressure();
}
private:
......
......@@ -24,9 +24,10 @@
#ifndef DUMUX_FREEFLOW_NI_IO_FIELDS_HH
#define DUMUX_FREEFLOW_NI_IO_FIELDS_HH
#include <dumux/io/fieldnames.hh>
#include <dune/common/deprecated.hh>
#include <dumux/io/name.hh>
namespace Dumux
{
......@@ -54,8 +55,7 @@ public:
{
IsothermalIOFields::initOutputModule(out);
using namespace IOFieldNames;
out.addVolumeVariable([](const auto& v){ return v.temperature(); }, temperature());
out.addVolumeVariable([](const auto& v){ return v.temperature(); }, IOName::temperature());
out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda");
if (ModelTraits::usesTurbulenceModel())
out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t");
......@@ -65,11 +65,10 @@ public:
template <class FluidSystem = void>
static std::string primaryVariableName(int pvIdx, int state = 0)
{
using namespace IOFieldNames;
if (pvIdx < ModelTraits::numEq() - 1)
return IsothermalIOFields::template primaryVariableName<FluidSystem>(pvIdx, state);
else
return temperature();
return IOName::temperature();
}
};
......
......@@ -26,12 +26,10 @@
#include <dune/common/deprecated.hh>
#include <dumux/io/fieldnames.hh>
#include <dumux/io/name.hh>
namespace Dumux {
using namespace IOFieldNames;
/*!
* \ingroup OnePModel
* \brief Adds I/O fields specific to the one phase model
......@@ -43,7 +41,7 @@ public:
static void initOutputModule(OutputModule& out)
{
out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); },
pressure());
IOName::pressure());
}
template <class OutputModule>
......@@ -56,7 +54,7 @@ public:
template <class FluidSystem = void, class SolidSystem = void>
static std::string primaryVariableName(int pvIdx = 0, int state = 0)
{
return pressure();
return IOName::pressure();
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment