diff --git a/dumux/common/start.hh b/dumux/common/start.hh index 2da828911700d5620984dbac6b29e3e286566806..553a1d6539aa0312144f20e962be819afd32725d 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 eb787e12afdd325dfd50b5852c13f4931e2ea2f4..3049311e905fd9b54c69c8760c84c9c765289faa 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 c9118be37edb40cc637ab0162680d86913ec5800..4e4d7efa5cef7dc51da3957a79ec42545fc841f9 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 e17049b166566a46a810d8b6befd15612e4929ee..f0b9222f541418332f07e16a95bab95edf49afc4 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 f79049eec1204eac6455d649e720e616157d750c..7172c7ad169cb5e0cc103d25ef5f141482a7c622 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 a71ae2f09d390ce0c4c6df68cb346396423fe8f2..0d0dd47c488445b9b17b1fc643c0c9fc65d43252 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 86c7031199f2bdcb6ca3877f7071646a93a5dcc0..57c0783b864d9abc8d3a3ecf11f37bc38aeed22f 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 fafc94e10eb28c9dd89edc4059f762f59807ad90..abfe53c3b3f7385394107dcd83cf5e280772a404 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