From 966af2003c1aae8991a7c7750fdea46205da5f64 Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Fri, 31 Aug 2018 12:48:31 +0200
Subject: [PATCH] [io] change from `IOFieldNames` to `IOName` in the models

See discussion in !1212.
---
 dumux/freeflow/compositional/iofields.hh | 14 +++++++-------
 dumux/freeflow/navierstokes/iofields.hh  | 16 +++++++---------
 dumux/freeflow/nonisothermal/iofields.hh |  9 ++++-----
 dumux/porousmediumflow/1p/iofields.hh    |  8 +++-----
 4 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh
index bfdc6dd436..554a89abe8 100644
--- a/dumux/freeflow/compositional/iofields.hh
+++ b/dumux/freeflow/compositional/iofields.hh
@@ -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());
     }
 };
 
diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh
index d8b607f5ee..63fb9f1225 100644
--- a/dumux/freeflow/navierstokes/iofields.hh
+++ b/dumux/freeflow/navierstokes/iofields.hh
@@ -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:
diff --git a/dumux/freeflow/nonisothermal/iofields.hh b/dumux/freeflow/nonisothermal/iofields.hh
index cfe560702a..aab75f7562 100644
--- a/dumux/freeflow/nonisothermal/iofields.hh
+++ b/dumux/freeflow/nonisothermal/iofields.hh
@@ -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();
     }
 };
 
diff --git a/dumux/porousmediumflow/1p/iofields.hh b/dumux/porousmediumflow/1p/iofields.hh
index ad66508d6b..3e6aeccb5f 100644
--- a/dumux/porousmediumflow/1p/iofields.hh
+++ b/dumux/porousmediumflow/1p/iofields.hh
@@ -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();
     }
 };
 
-- 
GitLab