From 3bb14e465506cc2b31b5b7cce93777142063eaac Mon Sep 17 00:00:00 2001
From: Christoph Grueninger <christoph.grueninger@iws.uni-stuttgart.de>
Date: Thu, 5 Feb 2015 08:04:01 +0000
Subject: [PATCH] 2p2c,cleanup: Fix deprecation warning.

Re-arrange weired if clauses.
Remove empty destructors.
(reviewed by fetzer)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14192 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/implicit/2p2c/2p2cvolumevariables.hh   |  8 +++++--
 test/implicit/2p2c/injectionproblem.hh       | 24 ++++++++++----------
 test/implicit/2p2c/injectionspatialparams.hh |  6 -----
 test/implicit/2p2c/waterairproblem.hh        | 13 ++++-------
 test/implicit/2p2c/waterairspatialparams.hh  |  3 ---
 5 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/dumux/implicit/2p2c/2p2cvolumevariables.hh b/dumux/implicit/2p2c/2p2cvolumevariables.hh
index 02e609f3bf..063da831e2 100644
--- a/dumux/implicit/2p2c/2p2cvolumevariables.hh
+++ b/dumux/implicit/2p2c/2p2cvolumevariables.hh
@@ -25,6 +25,8 @@
 #ifndef DUMUX_2P2C_VOLUME_VARIABLES_HH
 #define DUMUX_2P2C_VOLUME_VARIABLES_HH
 
+#include <dune/common/version.hh>
+
 #include <dumux/implicit/common/implicitmodel.hh>
 #include <dumux/material/fluidstates/compositionalfluidstate.hh>
 #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
@@ -183,9 +185,11 @@ public:
         Scalar t = Implementation::temperature_(priVars, problem, element,
                                                 fvGeometry, scvIdx);
         fluidState.setTemperature(t);
-        
+#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
+        int dofIdxGlobal = problem.model().dofMapper().subIndex(element, scvIdx, dofCodim);
+#else
         int dofIdxGlobal = problem.model().dofMapper().map(element, scvIdx, dofCodim);
-        
+#endif
         int phasePresence = problem.model().phasePresence(dofIdxGlobal, isOldSol);
         
         /////////////
diff --git a/test/implicit/2p2c/injectionproblem.hh b/test/implicit/2p2c/injectionproblem.hh
index 3ab8337e6c..4724bf814d 100644
--- a/test/implicit/2p2c/injectionproblem.hh
+++ b/test/implicit/2p2c/injectionproblem.hh
@@ -86,8 +86,8 @@ SET_BOOL_PROP(InjectionProblem, VtkAddVelocity, false);
  * This problem uses the \ref TwoPTwoCModel.
  *
  * To run the simulation execute the following line in shell:
- * <tt>./test_box2p2c -parameterFile ./test_box2p2c.input</tt> or
- * <tt>./test_cc2p2c -parameterFile ./test_cc2p2c.input</tt>
+ * <tt>./test_box2p2c</tt> or
+ * <tt>./test_cc2p2c</tt>
  */
 template <class TypeTag>
 class InjectionProblem : public ImplicitPorousMediaProblem<TypeTag>
@@ -192,13 +192,13 @@ public:
                           /*np=*/nPressure_);
 
         //stateing in the console whether mole or mass fractions are used
-        if(!useMoles)
+        if(useMoles)
         {
-        	std::cout<<"problem uses mass-fractions"<<std::endl;
+            std::cout<<"problem uses mole-fractions"<<std::endl;
         }
         else
         {
-        	std::cout<<"problem uses mole-fractions"<<std::endl;
+            std::cout<<"problem uses mass-fractions"<<std::endl;
         }
     }
 
@@ -387,14 +387,16 @@ private:
         Scalar meanM =
             FluidSystem::molarMass(wCompIdx)*moleFracLiquidH2O +
             FluidSystem::molarMass(nCompIdx)*moleFracLiquidN2;
-        if(!useMoles) //mass fraction formulation
+        if(useMoles)
         {
-        	Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(nCompIdx)/meanM;
-        	values[Indices::switchIdx] = massFracLiquidN2;
+            //mole-fraction formulation
+            values[Indices::switchIdx] = moleFracLiquidN2;
         }
-        else //mole-fraction formulation
+        else
         {
-        	values[Indices::switchIdx] = moleFracLiquidN2;
+            //mass fraction formulation
+            Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(nCompIdx)/meanM;
+            values[Indices::switchIdx] = massFracLiquidN2;
         }
         values[Indices::pressureIdx] = pl;
     }
@@ -410,8 +412,6 @@ private:
 
     Scalar pressureLow_, pressureHigh_;
     Scalar temperatureLow_, temperatureHigh_;
-
-
 };
 } //end namespace
 
diff --git a/test/implicit/2p2c/injectionspatialparams.hh b/test/implicit/2p2c/injectionspatialparams.hh
index 1a4c8da831..029140c28e 100644
--- a/test/implicit/2p2c/injectionspatialparams.hh
+++ b/test/implicit/2p2c/injectionspatialparams.hh
@@ -119,12 +119,6 @@ public:
         coarseMaterialParams_.setLambda(2.0);
     }
 
-    /*!
-     * \brief The destructor
-     */
-    ~InjectionSpatialParams()
-    {}
-
     /*!
      * \brief Returns the intrinsic permeability tensor \f$[m^2]\f$
      *
diff --git a/test/implicit/2p2c/waterairproblem.hh b/test/implicit/2p2c/waterairproblem.hh
index 9f27c5fef8..18904fdbce 100644
--- a/test/implicit/2p2c/waterairproblem.hh
+++ b/test/implicit/2p2c/waterairproblem.hh
@@ -101,8 +101,8 @@ SET_BOOL_PROP(WaterAirProblem, UseMoles, true);
  * This problem uses the \ref TwoPTwoCModel and \ref NIModel model.
  *
  * To run the simulation execute the following line in shell:
- * <tt>./test_box2p2cni -parameterFile test_box2p2cni.input</tt> or
- * <tt>./test_cc2p2cni -parameterFile test_cc2p2cni.input</tt>
+ * <tt>./test_box2p2cni</tt> or
+ * <tt>./test_cc2p2cni</tt>
  *  */
 template <class TypeTag >
 class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag>
@@ -117,7 +117,6 @@ class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag>
     // copy some indices for convenience
     typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
     enum {
-
         pressureIdx = Indices::pressureIdx,
         switchIdx = Indices::switchIdx,
 
@@ -138,10 +137,8 @@ class WaterAirProblem : public ImplicitPorousMediaProblem<TypeTag>
 
         conti0EqIdx = Indices::conti0EqIdx,
         contiNEqIdx = conti0EqIdx + Indices::nCompIdx
-
     };
 
-
     typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
     typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
     typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager;
@@ -177,13 +174,13 @@ public:
         name_               = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.Name);
 
         //stating in the console whether mole or mass fractions are used
-        if(!useMoles)
+        if(useMoles)
         {
-        	std::cout<<"problem uses mass-fractions"<<std::endl;
+            std::cout<<"problem uses mole-fractions"<<std::endl;
         }
         else
         {
-        	std::cout<<"problem uses mole-fractions"<<std::endl;
+            std::cout<<"problem uses mass-fractions"<<std::endl;
         }
     }
 
diff --git a/test/implicit/2p2c/waterairspatialparams.hh b/test/implicit/2p2c/waterairspatialparams.hh
index 61d9c1b0d2..8eb1236baf 100644
--- a/test/implicit/2p2c/waterairspatialparams.hh
+++ b/test/implicit/2p2c/waterairspatialparams.hh
@@ -114,9 +114,6 @@ public:
         coarseMaterialParams_.setLambda(2.0);
     }
 
-    ~WaterAirSpatialParams()
-    {}
-
     /*!
      * \brief Apply the intrinsic permeability tensor to a pressure
      *        potential gradient.
-- 
GitLab