From c2be0703a2fc554a21d1936eaac1b435ae9654ee Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Thu, 4 Jan 2018 12:01:28 +0100
Subject: [PATCH] [cleanup] Use constexpr bool for use moles

---
 dumux/porousmediumflow/1pnc/volumevariables.hh                  | 2 +-
 dumux/porousmediumflow/3pwateroil/localresidual.hh              | 2 +-
 dumux/porousmediumflow/co2/volumevariables.hh                   | 2 +-
 dumux/porousmediumflow/richardsnc/volumevariables.hh            | 2 +-
 test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh  | 2 +-
 test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh  | 2 +-
 test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh          | 2 +-
 test/porousmediumflow/2p2c/implicit/waterairproblem.hh          | 2 +-
 test/porousmediumflow/2pnc/implicit/2pncdiffusion.hh            | 2 +-
 test/porousmediumflow/co2/implicit/heterogeneousproblem.hh      | 2 +-
 test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh      | 2 +-
 test/porousmediumflow/tracer/constvel/tracertestproblem.hh      | 2 +-
 .../tracer/multicomp/maxwellstefantestproblem.hh                | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dumux/porousmediumflow/1pnc/volumevariables.hh b/dumux/porousmediumflow/1pnc/volumevariables.hh
index 0ca6e1abff..62812ff26b 100644
--- a/dumux/porousmediumflow/1pnc/volumevariables.hh
+++ b/dumux/porousmediumflow/1pnc/volumevariables.hh
@@ -78,7 +78,7 @@ class OnePNCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
 
     };
 
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     static const int dim = GridView::dimension;
     static const int dimWorld = GridView::dimensionworld;
 
diff --git a/dumux/porousmediumflow/3pwateroil/localresidual.hh b/dumux/porousmediumflow/3pwateroil/localresidual.hh
index 4bb312fd78..317a02d5c4 100644
--- a/dumux/porousmediumflow/3pwateroil/localresidual.hh
+++ b/dumux/porousmediumflow/3pwateroil/localresidual.hh
@@ -77,7 +77,7 @@ protected:
     };
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 public:
     using ParentType::ParentType;
 
diff --git a/dumux/porousmediumflow/co2/volumevariables.hh b/dumux/porousmediumflow/co2/volumevariables.hh
index 430be2ef4b..bcd8b7190a 100644
--- a/dumux/porousmediumflow/co2/volumevariables.hh
+++ b/dumux/porousmediumflow/co2/volumevariables.hh
@@ -82,7 +82,7 @@ class TwoPTwoCCO2VolumeVariables : public TwoPTwoCVolumeVariables<TypeTag>
         pressureIdx = Indices::pressureIdx
     };
 
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
 public:
     //! The type of the object returned by the fluidState() method
diff --git a/dumux/porousmediumflow/richardsnc/volumevariables.hh b/dumux/porousmediumflow/richardsnc/volumevariables.hh
index 60e722d434..cca386cd04 100644
--- a/dumux/porousmediumflow/richardsnc/volumevariables.hh
+++ b/dumux/porousmediumflow/richardsnc/volumevariables.hh
@@ -330,7 +330,7 @@ class RichardsNCVolumeVariables : public RichardsBaseVolumeVariables<TypeTag>
         pressureIdx = Indices::pressureIdx
     };
 
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     static const int dim = GridView::dimension;
     static const int dimWorld = GridView::dimensionworld;
     static const int numComponents = GET_PROP_VALUE(TypeTag, NumComponents);
diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
index 944ae32dbe..a670d5b1ea 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
@@ -134,7 +134,7 @@ class OnePTwoCNIConductionProblem : public PorousMediumFlowProblem<TypeTag>
     };
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static const bool isBox = GET_PROP_VALUE(TypeTag, DiscretizationMethod) == DiscretizationMethods::Box;
 
diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
index cc8a0be81b..2a43f8025d 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
@@ -134,7 +134,7 @@ class OnePTwoCNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     };
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static const bool isBox = GET_PROP_VALUE(TypeTag, DiscretizationMethod) == DiscretizationMethods::Box;
 
diff --git a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
index 88d755f36c..dfaa61e90c 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
@@ -129,7 +129,7 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem<TypeTag>
     };
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static const bool isBox = GET_PROP_VALUE(TypeTag, DiscretizationMethod) == DiscretizationMethods::Box;
 
diff --git a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
index d61b8c7eb4..8ed321de7a 100644
--- a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
+++ b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
@@ -143,7 +143,7 @@ class WaterAirProblem : public PorousMediumFlowProblem<TypeTag>
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
 public:
     /*!
diff --git a/test/porousmediumflow/2pnc/implicit/2pncdiffusion.hh b/test/porousmediumflow/2pnc/implicit/2pncdiffusion.hh
index e42972b5b9..d033419a2d 100644
--- a/test/porousmediumflow/2pnc/implicit/2pncdiffusion.hh
+++ b/test/porousmediumflow/2pnc/implicit/2pncdiffusion.hh
@@ -108,7 +108,7 @@ class TwoPNCDiffusionProblem : public PorousMediumFlowProblem<TypeTag>
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
 public:
     /*!
diff --git a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
index 6d13735af3..92415f8515 100644
--- a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
+++ b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
@@ -168,7 +168,7 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag>
     using CO2 = Dumux::CO2<Scalar, HeterogeneousCO2Tables::CO2Tables>;
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
     // the discretization method we are using
     static constexpr auto discMethod = GET_PROP_VALUE(TypeTag, DiscretizationMethod);
diff --git a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
index b828cd580a..c1003b7c92 100644
--- a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
+++ b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
@@ -146,7 +146,7 @@ class TracerTestProblem : public PorousMediumFlowProblem<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
     static const int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
diff --git a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
index 8e1f5abbbe..b60cc8f01a 100644
--- a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
+++ b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
@@ -168,7 +168,7 @@ class TracerTest : public PorousMediumFlowProblem<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
     static const int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
diff --git a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
index 7be6fc9431..342e395443 100644
--- a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
+++ b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
@@ -188,7 +188,7 @@ class MaxwellStefanTestProblem : public PorousMediumFlowProblem<TypeTag>
     using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector);
 
     //! property that defines whether mole or mass fractions are used
-    static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
 
     static const int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-- 
GitLab