From a9895363f336b33cdeaf462a1a2745ba1dc7cfcc Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Fri, 13 Jul 2018 10:46:19 +0200
Subject: [PATCH] [cleanup] Rename haveParam->hasParam in all files

---
 dumux/common/start.hh                         |  2 +-
 dumux/io/grid/cakegridcreator.hh              |  6 +--
 dumux/io/grid/gridmanager.hh                  | 42 +++++++++----------
 .../implicit/adaptive/test_2p_adaptive_fv.cc  |  2 +-
 .../2p/sequential/test_3d2pproblem.hh         |  6 +--
 .../sequential/test_impesadaptiveproblem.hh   |  2 +-
 .../3p3c/implicit/test_3p3c_fv.cc             |  2 +-
 .../tracer/constvel/test_tracer.cc            |  2 +-
 8 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/dumux/common/start.hh b/dumux/common/start.hh
index 2da8289117..553a1d6539 100644
--- a/dumux/common/start.hh
+++ b/dumux/common/start.hh
@@ -100,7 +100,7 @@ int start_(int argc,
     // check if we are about to restart a previously interrupted simulation
     bool restart = false;
     Scalar restartTime = 0;
-    if (haveParam("Restart") || haveParam("TimeManager.Restart"))
+    if (hasParam("Restart") || hasParam("TimeManager.Restart"))
     {
         restart = true;
         restartTime =  getParam<Scalar>("TimeManager.Restart");
diff --git a/dumux/io/grid/cakegridcreator.hh b/dumux/io/grid/cakegridcreator.hh
index eb787e12af..3049311e90 100644
--- a/dumux/io/grid/cakegridcreator.hh
+++ b/dumux/io/grid/cakegridcreator.hh
@@ -103,9 +103,9 @@ public:
 
         for (int i = 0; i < dim; ++i)
         {
-            const bool hasRadial = haveParamInGroup(modelParamGroup, "Grid.Radial" + std::to_string(i));
-            const bool hasAngular = haveParamInGroup(modelParamGroup, "Grid.Angular" + std::to_string(i));
-            const bool hasAxial = (dim == 3) && haveParamInGroup(modelParamGroup, "Grid.Axial" + std::to_string(i));
+            const bool hasRadial = hasParamInGroup(modelParamGroup, "Grid.Radial" + std::to_string(i));
+            const bool hasAngular = hasParamInGroup(modelParamGroup, "Grid.Angular" + std::to_string(i));
+            const bool hasAxial = (dim == 3) && hasParamInGroup(modelParamGroup, "Grid.Axial" + std::to_string(i));
             if (static_cast<int>(hasRadial) + static_cast<int>(hasAngular) + static_cast<int>(hasAxial) != 1)
                 DUNE_THROW(Dune::RangeError, "Multiple or no position vectors (radial, angular, axial) specified in coord direction: " << i << std::endl);
 
diff --git a/dumux/io/grid/gridmanager.hh b/dumux/io/grid/gridmanager.hh
index c9118be37e..4e4d7efa5c 100644
--- a/dumux/io/grid/gridmanager.hh
+++ b/dumux/io/grid/gridmanager.hh
@@ -284,7 +284,7 @@ protected:
      */
     void maybeRefineGrid(const std::string& modelParamGroup)
     {
-        if (haveParamInGroup(modelParamGroup, "Grid.Refinement"))
+        if (hasParamInGroup(modelParamGroup, "Grid.Refinement"))
             grid().globalRefine(getParamFromGroup<int>(modelParamGroup, "Grid.Refinement"));
     }
 
@@ -350,7 +350,7 @@ public:
     void init(const std::string& modelParamGroup = "")
     {
         // First try to create it from a DGF file in GridParameterGroup.File
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             ParentType::makeGridFromDgfFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"));
             postProcessing_(modelParamGroup);
@@ -358,7 +358,7 @@ public:
         }
 
         // Then look for the necessary keys to construct from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.UpperRight"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
         {
 
             // get the upper right corner coordinates
@@ -375,7 +375,7 @@ public:
             const int overlap =  getParamFromGroup<int>(modelParamGroup, "Grid.Overlap", 1);
 
             // make the grid
-            if (!haveParamInGroup(modelParamGroup, "Grid.Partitioning"))
+            if (!hasParamInGroup(modelParamGroup, "Grid.Partitioning"))
             {
                 // construct using default load balancing
                 ParentType::gridPtr() = std::make_shared<Grid>(upperRight, cells, periodic, overlap);
@@ -446,7 +446,7 @@ public:
     void init(const std::string& modelParamGroup = "")
     {
         // First try to create it from a DGF file in GridParameterGroup.File
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             ParentType::makeGridFromDgfFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"));
             postProcessing_(modelParamGroup);
@@ -454,7 +454,7 @@ public:
         }
 
         // Then look for the necessary keys to construct from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.UpperRight"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
         {
             using GlobalPosition = Dune::FieldVector<ct, dim>;
             const auto upperRight = getParamFromGroup<GlobalPosition>(modelParamGroup, "Grid.UpperRight");
@@ -471,7 +471,7 @@ public:
             const int overlap = getParamFromGroup<int>(modelParamGroup, "Grid.Overlap", 1);
 
             // make the grid
-            if (!haveParamInGroup(modelParamGroup, "Grid.Partitioning"))
+            if (!hasParamInGroup(modelParamGroup, "Grid.Partitioning"))
             {
                 // construct using default load balancing
                 ParentType::gridPtr() = std::make_shared<Grid>(lowerLeft, upperRight, cells, periodic, overlap);
@@ -619,7 +619,7 @@ public:
         const auto globalPositions = computeGlobalPositions_(positions, cells, grading, verbose);
 
         // make the grid
-        if (!haveParamInGroup(modelParamGroup, "Grid.Partitioning"))
+        if (!hasParamInGroup(modelParamGroup, "Grid.Partitioning"))
         {
             // construct using default load balancing
             ParentType::gridPtr() = std::make_shared<Grid>(globalPositions, periodic, overlap);
@@ -783,7 +783,7 @@ public:
     {
 
         // try to create it from a DGF or msh file in GridParameterGroup.File
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             ParentType::makeGridFromDgfFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"));
             postProcessing_(modelParamGroup);
@@ -791,7 +791,7 @@ public:
         }
 
         // Look for the necessary keys to construct from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.RightBoundary"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.RightBoundary"))
         {
             // The required parameters
             using CoordinateType = typename Grid::ctype;
@@ -805,7 +805,7 @@ public:
         }
 
         // Look for the necessary keys to construct from the input file with just a coordinates vector
-        else if (haveParamInGroup(modelParamGroup, "Grid.Coordinates"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.Coordinates"))
         {
             const auto coordinates = getParamFromGroup<std::vector<typename Grid::ctype>>(modelParamGroup, "Grid.Coordinates");
             ParentType::gridPtr() = std::make_shared<Grid>(coordinates);
@@ -885,7 +885,7 @@ public:
     {
 
         // try to create it from a DGF or msh file in GridParameterGroup.File
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             preProcessing_(modelParamGroup);
             ParentType::makeGridFromFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"), modelParamGroup);
@@ -894,7 +894,7 @@ public:
         }
 
         // Then look for the necessary keys to construct from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.UpperRight"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
         {
             preProcessing_(modelParamGroup);
             // make the grid
@@ -958,7 +958,7 @@ private:
      */
     void preProcessing_(const std::string& modelParamGroup)
     {
-        if(haveParamInGroup(modelParamGroup, "Grid.HeapSize"))
+        if(hasParamInGroup(modelParamGroup, "Grid.HeapSize"))
             Grid::setDefaultHeapSize(getParamFromGroup<unsigned>(modelParamGroup, "Grid.HeapSize"));
     }
 
@@ -1027,11 +1027,11 @@ public:
     {
         // restarting an adaptive grid using Dune's BackupRestoreFacility
         // TODO: the part after first || is backward compatibilty with old sequential models remove once sequential adpative restart is replaced
-        if (adaptiveRestart || haveParam("Restart") || haveParam("TimeManager.Restart"))
+        if (adaptiveRestart || hasParam("Restart") || hasParam("TimeManager.Restart"))
         {
             auto restartTime = getParamFromGroup<double>(modelParamGroup, "TimeLoop.Restart", 0.0);
             // TODO: backward compatibilty with old sequential models remove once sequential adpative restart is replaced
-            if (haveParam("Restart") || haveParam("TimeManager.Restart"))
+            if (hasParam("Restart") || hasParam("TimeManager.Restart"))
             {
                 restartTime = getParamFromGroup<double>("TimeManager", "Restart");
                 std::cerr << "Warning: You are using a deprecated restart mechanism. The usage will change in the future.\n";
@@ -1048,7 +1048,7 @@ public:
         }
 
         // try to create it from a DGF or msh file in GridParameterGroup.File
-        else if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             makeGridFromFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"), modelParamGroup);
             ParentType::maybeRefineGrid(modelParamGroup);
@@ -1057,7 +1057,7 @@ public:
         }
 
         // Then look for the necessary keys to construct from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.UpperRight"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
         {
             // make a structured grid
             if (elType == Dune::cube)
@@ -1183,7 +1183,7 @@ public:
     void init(const std::string& modelParamGroup = "")
     {
         // try to create it from file
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             ParentType::makeGridFromFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"), modelParamGroup);
             ParentType::maybeRefineGrid(modelParamGroup);
@@ -1192,7 +1192,7 @@ public:
         }
 
         // Then look for the necessary keys to construct a structured grid from the input file
-        else if (haveParamInGroup(modelParamGroup, "Grid.UpperRight"))
+        else if (hasParamInGroup(modelParamGroup, "Grid.UpperRight"))
         {
             ParentType::template makeStructuredGrid<dim, dimworld>(ParentType::CellType::Simplex, modelParamGroup);
             ParentType::maybeRefineGrid(modelParamGroup);
@@ -1239,7 +1239,7 @@ public:
     void init(const std::string& modelParamGroup = "")
     {
         // try to create it from file
-        if (haveParamInGroup(modelParamGroup, "Grid.File"))
+        if (hasParamInGroup(modelParamGroup, "Grid.File"))
         {
             ParentType::makeGridFromFile(getParamFromGroup<std::string>(modelParamGroup, "Grid.File"), modelParamGroup);
             ParentType::maybeRefineGrid(modelParamGroup);
diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc
index e17049b166..f0b9222f54 100644
--- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc
+++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc
@@ -184,7 +184,7 @@ int main(int argc, char** argv) try
 
     // check if we are about to restart a previously interrupted simulation
     Scalar restartTime = 0;
-    if (haveParam("Restart") || haveParam("TimeLoop.Restart"))
+    if (hasParam("Restart") || hasParam("TimeLoop.Restart"))
         restartTime = getParam<Scalar>("TimeLoop.Restart");
 
     // intialize the vtk output module
diff --git a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
index f79049eec1..7172c7ad16 100644
--- a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
@@ -156,7 +156,7 @@ Test3D2PProblem(TimeManager& timeManager, Grid& grid) :
 ParentType(timeManager, grid), inflowEdge_(0), outflowEdge_(0)
 {
     int refinementFactor = 0;
-    if (haveParam("Grid.RefinementFactor") && !GET_PROP_VALUE(TypeTag, AdaptiveGrid))
+    if (hasParam("Grid.RefinementFactor") && !GET_PROP_VALUE(TypeTag, AdaptiveGrid))
     {
         refinementFactor = getParam<Scalar>("Grid.RefinementFactor");
         grid.globalRefine(refinementFactor);
@@ -183,14 +183,14 @@ ParentType(timeManager, grid), inflowEdge_(0), outflowEdge_(0)
     }
 
     int outputInterval = 0;
-    if (haveParam("Problem.OutputInterval"))
+    if (hasParam("Problem.OutputInterval"))
     {
         outputInterval = getParam<int>("Problem.OutputInterval");
     }
     this->setOutputInterval(outputInterval);
 
     Scalar outputTimeInterval = 1e6;
-    if (haveParam("Problem.OutputTimeInterval"))
+    if (hasParam("Problem.OutputTimeInterval"))
     {
         outputTimeInterval = getParam<Scalar>("Problem.OutputTimeInterval");
     }
diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
index a71ae2f09d..0d0dd47c48 100644
--- a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
@@ -127,7 +127,7 @@ public:
 
         // Refine the grid provided that no restart occurs. Otherwise, an
         // already refined grid will be read.
-        if (!(haveParam("Restart") || haveParam("TimeManager.Restart")))
+        if (!(hasParam("Restart") || hasParam("TimeManager.Restart")))
             grid.globalRefine(getParam<int>("GridAdapt.MaxLevel"));
 
         this->setOutputInterval(10);
diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc
index 86c7031199..57c0783b86 100644
--- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc
+++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc
@@ -183,7 +183,7 @@ int main(int argc, char** argv) try
 
         // write vtk output
         // if episode length was specificied output only at the end of episodes
-        if (!haveParam("TimeLoop.EpisodeLength") || timeLoop->isCheckPoint() || timeLoop->finished() || timeLoop->timeStepIndex() == 1)
+        if (!hasParam("TimeLoop.EpisodeLength") || timeLoop->isCheckPoint() || timeLoop->finished() || timeLoop->timeStepIndex() == 1)
             vtkWriter.write(timeLoop->time());
 
         // report statistics of this time step
diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc
index fafc94e10e..abfe53c3b3 100644
--- a/test/porousmediumflow/tracer/constvel/test_tracer.cc
+++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc
@@ -104,7 +104,7 @@ int main(int argc, char** argv) try
 
     //! check if we are about to restart a previously interrupted simulation
     Scalar restartTime = 0;
-    if (haveParam("Restart") || haveParam("TimeLoop.Restart"))
+    if (hasParam("Restart") || hasParam("TimeLoop.Restart"))
         restartTime = getParam<Scalar>("TimeLoop.Restart");
 
     //! instantiate time loop
-- 
GitLab