From e71bd79f6a8a9568f844c651cdc3e49fefbbb925 Mon Sep 17 00:00:00 2001
From: Katharina Heck <katharina.heck@iws.uni-stuttgart.de>
Date: Thu, 8 Mar 2018 14:56:39 +0100
Subject: [PATCH] [3pwateroil] remove typtags in vtkoutput

---
 dumux/porousmediumflow/3pwateroil/model.hh    | 12 ++++-
 .../3pwateroil/vtkoutputfields.hh             | 50 ++++++++-----------
 2 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh
index bb05191621..376c5d95ce 100644
--- a/dumux/porousmediumflow/3pwateroil/model.hh
+++ b/dumux/porousmediumflow/3pwateroil/model.hh
@@ -214,8 +214,16 @@ public:
 // Property values for isothermal model required for the general non-isothermal model
 //////////////////////////////////////////////////////////////////
 
-//set isothermal output fields
-SET_TYPE_PROP(ThreePWaterOilNI, IsothermalVtkOutputFields, ThreePWaterOilVtkOutputFields<TypeTag>);
+//! Set the isothermal vktoutputfields
+SET_PROP(ThreePWaterOilNI, IsothermalVtkOutputFields)
+{
+private:
+   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
+   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+
+public:
+    using type = ThreePWaterOilVtkOutputFields<FluidSystem, Indices>;
+};
 
 //set isothermal Indices
 SET_PROP(ThreePWaterOilNI, IsothermalIndices)
diff --git a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
index 3ba94b7c78..11b9e0265a 100644
--- a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
@@ -33,47 +33,41 @@ namespace Dumux
  * \ingroup ThreePWaterOilModel
  * \brief Adds vtk output fields specific to the three-phase three-component model
  */
-template<class TypeTag>
+template<class FluidSystem, class Indices>
 class ThreePWaterOilVtkOutputFields
 {
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
-    enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases),
-           numComponents = GET_PROP_VALUE(TypeTag, NumComponents)
-         };
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
         // register standardized vtk output fields
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.saturation(Indices::wPhaseIdx); }, "sw");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.saturation(Indices::nPhaseIdx); },"sn");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.saturation(Indices::gPhaseIdx); },"sg");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.pressure(Indices::wPhaseIdx); },"pw");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.pressure(Indices::nPhaseIdx); },"pn");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.pressure(Indices::gPhaseIdx); },"pg");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.density(Indices::wPhaseIdx); },"rhow");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.density(Indices::nPhaseIdx); },"rhon");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.density(Indices::gPhaseIdx); },"rhog");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "sw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::nPhaseIdx); },"sn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::gPhaseIdx); },"sg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::wPhaseIdx); },"pw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::nPhaseIdx); },"pn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::gPhaseIdx); },"pg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::wPhaseIdx); },"rhow");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::nPhaseIdx); },"rhon");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::gPhaseIdx); },"rhog");
+        vtk.addVolumeVariable( [](const auto& v){ return
         v.mobility(Indices::wPhaseIdx); },"MobW");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.mobility(Indices::nPhaseIdx); },"MobN");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.mobility(Indices::gPhaseIdx); },"MobG");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return
+        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(Indices::nPhaseIdx); },"MobN");
+        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(Indices::gPhaseIdx); },"MobG");
+        vtk.addVolumeVariable( [](const auto& v){ return
         v.viscosity(Indices::wPhaseIdx); },"ViscosW");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.viscosity(Indices::nPhaseIdx); },"ViscosN");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.viscosity(Indices::gPhaseIdx); },"ViscosG");
+        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(Indices::nPhaseIdx); },"ViscosN");
+        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(Indices::gPhaseIdx); },"ViscosG");
 
-        for (int i = 0; i < numPhases; ++i)
-            for (int j = 0; j < numComponents; ++j)
-                vtk.addVolumeVariable([i,j](const VolumeVariables& v){ return v.moleFraction(i,j); },
+        for (int i = 0; i < FluidSystem::numPhases; ++i)
+            for (int j = 0; j < FluidSystem::numComponents; ++j)
+                vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },
                                       "x^" + FluidSystem::phaseName(i) + "_" +  FluidSystem::componentName(j));
 
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.porosity(); },"porosity");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.priVars().state(); },"phase presence");
-        vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.permeability(); },"permeability");
+        vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity");
+        vtk.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence");
+        vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability");
     }
 };
 
-- 
GitLab